Re: Getting text from gtk_entry

From: Date: Fri, 03 Aug 2001 06:52:00 +0000
Subject: Re: Getting text from gtk_entry
References: 1  Groups: php.gtk 
Request: Send a blank email to php-gtk+get-2485@lists.php.net to get a copy of this message
> On pressing OK runs another function... however, im not sure how to get > the value of the entry box out of one function and into another... i > have globalized the variable however when i try using the method: > > $user = $username->get_text(); > > in the second function, it errors with the error: call to member > function on a non - object... > > So my question is how do i get the value of $username->get_text from one > function to another? WILD GUESS ALERT: > $okbutton->connect_object('clicked', array($query, 'destroy')); > $query->connect('delete_event', create_function('', > 'gtk::main_quit();')); This bit here looks to me like it's going to maybe trash the Preferences window, and thusly all its children when you click it. So, by the time write_preferences is executed, all those widgets are gone, gone, gone... Either get the Window to survive longer than it takes to execute write_preferences, or have the OK button call gettext() and stuff that into $user (a global) which is just a string and won't get de-allocated cuz you asked GTK to trash the Window... Disclaimer: I ain't even downloaded GTK yet... -- WARNING richard@zend.com address is an endangered species -- Use ceo@l-i-e.com Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm

« previous php.gtk (#2485) next »