Re: twice-echoed returns

From: Date: Tue, 03 Jul 2001 00:38:28 +0000
Subject: Re: twice-echoed returns
References: 1  Groups: php.gtk 
Request: Send a blank email to php-gtk+get-2031@lists.php.net to get a copy of this message
okey. This one, and also the colorselection in the hpaned demo on hitchiker does the same. <? dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so')) || die("Can't load php_gtk module!\n"); function echo_it($list, $listed) { global $items; $number = $list->child_position($listed); echo "\n".$items[$number]."\t= ".$number."\n"; } $window = &new GtkWindow(); $window->set_title("testbay window"); $window->set_default_size(320, 200); $window->set_uposition(0, 0); $window->connect_object('destroy', array('gtk', 'main_quit')); $combo = &new GtkCombo(); $list = $combo->list; $items = array("item 1", "item 2", "item 3", "item 4", "item 5"); $list_items = array(); foreach($items as $listed) { $trythis = $list_items[] = &new GtkListItem($listed); $trythis->show(); } if (count($list_items) > 0) $list->append_items($list_items); $list->set_selection_mode(GTK_SELECTION_SINGLE); $list->connect('select-child', 'echo_it', $listed); $list->show(); $window->add($combo); $combo->show(); $window->show_all(); Gtk::main(); ?> ----- Original Message ----- From: "Andrei Zmievski" <andrei@ispi.net> To: "Steph" <steph.fox@btinternet.com>; <php-gtk@lists.php.net> Sent: Tuesday, July 03, 2001 1:27 AM Subject: Re: [PHP-GTK] twice-echoed returns At 01:12 AM 7/3/01 +0100, Steph wrote: >I've spent some time pulling things apart now & still can't see why a >return from a "connect" function would repeat when printed/echoed. I >suspect but am not sure that it only occurs in compound widgets. > >This makes no difference if you're trapping the results of the signal to >trigger an action, but it does if you're relying on echoing those results. > >Comments, anyone? Sample code? -Andrei

« previous php.gtk (#2031) next »