Re: phpgtk2 bug ? - Tootips must be globals
| From: | Andrei Zmievski | Date: | Sat, 05 Aug 2006 21:39:24 +0000 |
| Subject: | Re: phpgtk2 bug ? - Tootips must be globals | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-7074@lists.php.net to get a copy of this message | ||
Since $tooltips is local to the function, as soon as the function exits, the tooltip is destroyed. When you make it global, it persists outside the function and functions as expected.
-Andrei
On Aug 5, 2006, at 2:35 PM, thomas favennec wrote:
Finally i've find that : function test() { global $tooltips; $window = new gtkWindow(); $button = new gtkButton('hello'); $tooltips = new GtkTooltips(); $tooltips->set_tip($button,"tooltip test !"); $window->add($button); $window->show_all(); } test(); gtk::main(); That's work. Why the tooltip must be global ? Thanks (and good luck). Thomas.