Re: help with entry value :)
| From: | Andrei Zmievski | Date: | Wed, 07 Mar 2001 15:48:15 +0000 |
| Subject: | Re: help with entry value :) | ||
| References: | 1 | Groups: | php.gtk |
| Request: | Send a blank email to php-gtk+get-486@lists.php.net to get a copy of this message | ||
On Wed, 07 Mar 2001, Iuri Fiedoruk wrote:
> I have this:
>
> $entry = &new GtkEntry();
> $entry->set_text('Hello World');
> $entry->select_region(0, 5);
> $box2->pack_start($entry);
> $entry->show();
>
> $button = &new GtkButton('show');
> $button->connect('clicked', 'show_value', $entry);
> $box2->pack_start($button);
> $button->show();
>
> function show_value($entry) {
> $children = $entry->children();
> $text = $children[0]->get();
> echo($text);
> }
>
> But it returns the value "show" and not the entry text value.
> What I'm doing wrong? (hey, sorry for so many questions) :)
show_value() gets passed the clicked button as the first argument and
the rest are supplied by you. So it should be:
function show_value($button, $entry)
-Andrei
"The galaxy is, in other words, an immensely, intrinsically,
and inexhaustibly interesting place." -- Iain M. Banks