Re: Refresh the label-text???

From: Date: Sun, 18 Nov 2001 16:58:55 +0000
Subject: Re: Refresh the label-text???
References: 1  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-619@lists.php.net to get a copy of this message
The first argument passed to 'get_input()' is not the GtkLabel you passed to connect() but the GtkEntry object itself (see documentation about connect()). Replace connect() with connect_object() and you have your GtkLabel widget in $label. - Markus On Sun, Nov 18, 2001 at 04:30:15PM +0100, Hendrik Daldrup wrote : > hi there, > > i know this one is a dumb question, but i really dont know, why it > doesnt work! > I just wanted to get a line from a text-entry and get it displayed as a > label. > If the user enters a new line, the label will display the new text! > > ...so i made this script, but it wont work... > why cant i simply say > > $label->set_text("$input"); > > to update the label??? > > thx, > > so long, > > Hendrik > > > > <?php > if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN') > dl('php_gtk.dll'); > else > dl('php_gtk.so'); > > function closeWindow($widget) { > > $window = $widget->get_toplevel(); > $window->destroy(); > unset($window); > } > > > function get_input($label) { > global $entry; > $input=$entry->get_text(); > print "$input\n"; > > $label->set_text("$input"); > > $entry->grab_focus(); > $entry->set_text(""); > } > > $window = &new GtkWindow(); > $window->set_position(GTK_WIN_POS_MOUSE); > $window->connect_object("destroy", array("gtk", "main_quit")); > > $vpaned = &new GtkVPaned(); > $window->add($vpaned); > $vpaned->show(); > > $label = &new GtkLabel(); > $vpaned->pack1($label); > $label->show(); > > $entry = &new GtkEntry(); > $vpaned->pack2($entry); > $entry->connect("activate", "get_input", $label); > $entry->show(); > > $window->show_all(); > > gtk::main(); > > ?> > > > -- > PHP-GTK General Mailing List (http://gtk.php.net/) > To unsubscribe, e-mail: php-gtk-general-unsubscribe@lists.php.net > For additional commands, e-mail: php-gtk-general-help@lists.php.net > To contact the list administrators, e-mail: php-list-admin@lists.php.net -- Markus Fischer, http://guru.josefine.at/~mfischer/ EMail: mfischer@guru.josefine.at PGP Public Key: http://guru.josefine.at/~mfischer/C2272BD0.asc PGP Fingerprint: D3B0 DD4F E12B F911 3CE1 C2B5 D674 B445 C227 2BD0 -All your scripts are belong to Zend-

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