phpgtk2 bug ? - Tootips must be globals

From: Date: Sat, 05 Aug 2006 21:35:32 +0000
Subject: phpgtk2 bug ? - Tootips must be globals
Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-7073@lists.php.net to get a copy of this message
Hi, I've find strange thing ! Hi, I have find something ! This code work (tooltip is ok) : $window = new gtkWindow(); $button = new gtkButton('hello'); $tooltips = new GtkTooltips(); $tooltips->set_tip($button,"tooltip test !"); $window->add($button); $window->show_all(); gtk::main(); this code don't work (no tooltip on screen !) : function test() { $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(); I don't understand. 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.

« previous php.gtk.general (#7073) next »