Getting 'Data' from Glade 'Signals' tab, GladeXML global
| From: | php-gtk User | Date: | Sun, 12 Jan 2003 04:50:22 +0000 |
| Subject: | Getting 'Data' from Glade 'Signals' tab, GladeXML global | ||
| Groups: | php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-2894@lists.php.net to get a copy of this message | ||
First question:
I'd like to write a function that incorporates the Data present in the
'Data' field within the Glade widget property 'Signals' tab (the one
with the tooltip, "The data passed to the handler").
I'm trying to write a (single, reusable) handler to update an arbitrary
Entry widget by passing it the Object name and the Text to update it
with.
function update_entry($widget_name, $text) {
$widget_name->set_text($text);
}
Suggestions are appreciated. Especially if they contain URLs or
examples. "RTFM" is acceptable if accompanied by the above. The above
code is only a rough guess.
Second question:
More PHP-related, I suppose, but I've got the following:
$gx = &new GladeXML('gui.glade');
Is there a cleaner way to keep $gx global than declaring, 'global $gx;'
within every function that needs access to the GladeXML object?
$GLOBALS["gx"] is a bit ugly.
Thanks again.