Re[2]: [PHP-GTK] Connecting data

From: Date: Fri, 03 Dec 2004 13:57:52 +0000
Subject: Re[2]: [PHP-GTK] Connecting data
References: 1 2 3 4 5 6 7 8 9  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-5301@lists.php.net to get a copy of this message
Hi, Friday, December 3, 2004, 11:47:50 PM, you wrote: SM> Tom Rogers wrote: >> PHP GTK seems to do strange things with events and classes. SM> This only because PHP-Gtk uses PHP4. Objects are still copied instead of SM> passed by reference. When PHP-Gtk2 is ready you shouldn't see these SM> problems as much (at all). >> The way I avoid this is to store class variables in the gtk object with >> >> $gtk_object->set_data() and $gtk_object->get_data() SM> I think its cleaner to use members of you class rather than have one SM> widget hold info for the whole class. Why tie the value to the widget if SM> it's really part of the class? OF course it would if it was reliable, but it isn't, the only things that seems to stay constant when using events are the gtk objects, so they make excellent and reliable storage containers, trust me I have tried all combinations of &$this and it is not reliable when events are involved. (at least not on windows which is where I use php-gtk) -- regards, Tom

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