Re: Getting text from gtk_entry
[email protected] ("Richard Lynch")
| Newsgroups | php.gtk |
|---|---|
| Organization | Lynch Interplanetary Enterprises |
| Message-ID | <060101c11be9$7dc0c5c0$6401a8c0@Lynchux100> |
> 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 [email protected] address is an endangered species -- Use
[email protected]
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