Hello! Can you give me an example of Button widget in Kivy language? I can creat the button but don't know how to use it's callback. I mean how can i set a command for the Button in Kivy?

Member Avatar
Member Avatar
+0 forum 10

It seems to me that the Audio object can not be easily played inside a JavaScript callback when running on a mobile device. The code below shows an onload function which, on a PC, plays the sound when the web page is loaded, but on Android phones plays nothing. My uninformed guess is that the callback returns before the Audio object starts to play, and thus, for some deep reason, dies. Is there any way over this? In the full version the JavaScript would read the sound to play from the URL. <!DOCTYPE html> <html> <head lang="en"> <meta charset="UTF-8"> <title>Play …

Member Avatar
Member Avatar
+0 forum 1

Hello, I've an array with different type of values: int, null, strings, arrays. I'm trying to remove nulls and empty strings, but I want to save ints, even when it equals to zero, so I tried with `array_filter()`, by default it will remove `0`, `''` and `null`, but by applying a callback it's possible to apply own rules. So I made few tests, and I'm getting unexpected results. The switch method will remove `null` and `0`, while the if statements will remove the empty string and `null`, as I wanted. Now, I can use the if statements, but I don't …

Member Avatar
Member Avatar
+2 forum 2

**<iframe width="608" frameborder="0" id="mainframe" name="mainframe" onload="$(this).height($(this).contents().height());" src="mindex/forratt.php" scrolling="no" /></iframe>** So I have written this code to automatically adjust the iframe to its content and it works fine. The thing is that when I access a page with a lower height, the height from the previous page stays put. I want it to automatically adjust to the height of the new page. How do I make that happen? Give me some pointers please! <3

Member Avatar
Member Avatar
+0 forum 2

Heyall. I'm trying to use the sqlite3_exec function and am having trouble with the callback feature. I've placed my code below. I realise the callback function provides and argument void *data and the sqlite3_exec function provides a const char *data variable. That is where I'm getting the error. I've searched the web for a similar example but I think this is occuring because I haven't cast the address of 'const char data' to the 'void data variable'. I'm just not sure where to put it. I've provided all my code below. The error message (from the build log) is also …

Member Avatar
Member Avatar
+0 forum 4

Hello everyone, I have a little question regarding a project for my class. We are making a tower defense game with ants and zombies objects for our project. My question is with this piece of code provided to us. /** * Callback invoked when the player attempts to recruit an ant. * @param antType Type of ant to recruit * @return true if the player may recruit the ant, false if not. */ public boolean recruitAnt(String antType); This is code from an interface file that was prvoided to us. I have no idea what "Callback invoked" means and how to …

Member Avatar
Member Avatar
+0 forum 2

I have a a few callback functions. i need to register them as a list. And callback all the registered functions in a main after a certain task is done. I am new to callback functions. Please shed some insight on this xcallback(register_callbackfunctions); ycallback(register_callbackfunctions); register_callbackfunctions()//not too sure what goes in as the parameters here { //create the list of the functions } int main(){ if( certain_task_is_done){ //callback all the functions in the list that was registered } }

Member Avatar
Member Avatar
+0 forum 2

I have the following code where I have several small problems. I have included some comments as I can't seem to get my 'pop up menu' button to work in order to retrieve the number of columns requested by the user. I then need to be able to get the values entered into each entry box within these columns but by EACH ROW (a list of values per row) and I have not got a clue how to get these values when I don't always know how many columns I will have (see lambda function where there is currently 4 …

Member Avatar
Member Avatar
+0 forum 7

Hi, I have a problem with jquery callback. The callback is executed before the fadeIn animation is completed. What im trying to do is, I want to replace an existing image with a new image and resize the new image to a specific size. [CODE] var filepath = "images/test.jpg"; $('#imagewrap').css('background-image', 'url("images/loader.gif")');//display a loading gif $('#uimage').hide();//hide the current image var i = $('<img />').attr('src', filepath).load(function()//load the new image { $('#uimage').attr('src', i.attr('src'));//change the src to new image $('#imagewrap').css('background-image', 'none');//hide the loading gif $('#uimage').fadeIn('slow', resize());//fade in the new image }); function resize() { alert($('#uimage').width());//it shows the width of the previous image } [/CODE]

Member Avatar
Member Avatar
+0 forum 4

The End.