Re: twice-echoed returns
| From: | Steph | Date: | Thu, 05 Jul 2001 20:35:57 +0000 |
| Subject: | Re: twice-echoed returns | ||
| References: | 1 2 3 | Groups: | php.gtk |
| Request: | Send a blank email to php-gtk+get-2055@lists.php.net to get a copy of this message | ||
Doesn't affect most calls (echoes twice, but if you're running a function from the signal
that function will only run once).
Shall I just add it to the Mysteries file?
----- Original Message -----
From: "Andrei Zmievski" <andrei@ispi.net>
To: "Steph" <steph.fox@btinternet.com>
Cc: <php-gtk@lists.php.net>
Sent: Thursday, July 05, 2001 7:27 PM
Subject: Re: [PHP-GTK] twice-echoed returns
Gee, I don't know, I didn't get any reply from the list. Short of
tracing through the gtk+ code with a debugger, I don't know what to do.
On Tue, 03 Jul 2001, Steph wrote:
> 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
>
>
-Andrei
* DOS is, quite possibly, the worst text-adventure game ever. *
--
PHP GTK Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-gtk-unsubscribe@lists.php.net
For additional commands, e-mail: php-gtk-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net