| View previous topic :: View next topic |
| Author |
Message |
zedzed
Joined: 23 Jan 2006 Posts: 1
|
Posted: Mon Jan 23, 2006 2:03 pm Post subject: launch function after gtk::main(); |
|
|
Hello,
I want start function after php-aplication has started.
My apps show data in clist and refresh data regulary.
If i use timeout_add before main, the window freez.
what am i supose to do ?
Thanks
ps: Sorry for my very bad english ... |
|
| Back to top |
|
 |
clange
Joined: 24 Jan 2006 Posts: 14
|
Posted: Tue Jan 24, 2006 9:15 am Post subject: |
|
|
Can you make an example or show your code?
<?PHP
....
function bla() {
while(1) {
//updateing
}
}
gtk::timeout_add(1000,"bla");
gtk::main();
?>
now the app will hang, until the while is breaking.
i think your timout function doesn't return.
mfg clange |
|
| Back to top |
|
 |
karlbowden
Joined: 18 Dec 2005 Posts: 21 Location: Taree, NSW, Australia
|
Posted: Wed Jan 25, 2006 4:38 pm Post subject: |
|
|
Also might like to try a slightly less invasive method.
| Code: | function bla () {
// do one update loop
return true;
}
gtk::timeout_add (1000, "bla");
gtk::main ();
|
If bla () does not return true, it will not be called again. bla () needs to return control back to gtk as quickly as possible, and from memory timeouts will not start until you make a call to gtk::main (), so i'm pretty sure clange's on the right track. If you need it updating quicker, just set the timeout delay lower. |
|
| Back to top |
|
 |
|