Fw: [PHP-GTK] twice-echoed returns



Last appeal to the GTK+ list on this issue I promise ...

In PHP-GTK compound widgets appear to be sending signals twice over for no good reason.  Is this feature familiar to GTK+ users in any other form?

----- Original Message ----- 
From: "Steph" <Steph Fox btinternet com>
To: "Andrei Zmievski" <andrei ispi net>
Cc: <php-gtk lists php net>
Sent: Thursday, July 05, 2001 11:56 PM
Subject: Fw: [PHP-GTK] twice-echoed returns


Actually thinking about it it's probable that the function does run twice.  It'll be redrawing, effectively, where I've used it and it appears to only run once.

So it's a case of being a bit careful with coding where redrawing isn't an option, I guess.  Til there's more time for you to investigate it, anyways (or til GTK 2's stable release turns up and it isn't there any more, whatever).

I'll make a note of it on hitchhiker where I know it occurs, I think; that way nobody gets confused.

Can somebody please confirm that this isn't only in win32? - code for test is at the bottom of this mail's history.

----- Original Message ----- 
From: "Steph" <Steph Fox btinternet com>
To: "Andrei Zmievski" <andrei ispi net>
Cc: <php-gtk lists php net>
Sent: Thursday, July 05, 2001 9:35 PM
Subject: Re: [PHP-GTK] twice-echoed returns


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



-- 
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



-- 
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






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]