Re: one more try...(sorry about me doing something silly when copy code)
| From: | Markus Fischer | Date: | Sat, 17 Nov 2001 21:34:46 +0000 |
| Subject: | Re: one more try...(sorry about me doing something silly when copy code) | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-610@lists.php.net to get a copy of this message | ||
At the first glance it seems to me you triggered a bug, but I'm
not yet sure.
Anyway, you don't need to do the add another (!) timeout with
timeout_add() . Just
return true;
Instead of
Gtk::timeout_add(1000,time1);
return false;
This circumvents the bug for now.
- Markus
On Sat, Nov 17, 2001 at 09:19:52PM +0000, a n wrote :
> one more try...(sorry, I did something silly when copy code)
>
> Dear all
> Anyone how can telling me why this GTK-PHP application just shutdown it
> self? The purpose of the app is to send a number to a socketserver every
> sek.
>
> <?php
> if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN')
> dl('php_gtk.dll');
> else
> dl('php_gtk.so');
>
> function delete_event()
> {
> Gtk::main_quit();
> return false;
> }
>
> function time1()
> {
> global $label;
> global $i;
> $i=$i+1;
> $label->set_text($i);
>
> $fp = fsockopen ("10.0.0.11", 1007, $errno, $errstr, 30);
> fputs ($fp, $i);
> fclose ($fp);
> Gtk::timeout_add(1000,time1);
> return false;
> }
>
> $window = &new GtkWindow;
> $window->connect('delete-event', delete_event);
>
> $box1 = &new GtkVBox();
> $window->add($box1);
> $box1->show();
>
> $table = &new GtkTable(2, 1);
> $table->set_row_spacings(5);
> $table->set_col_spacings(5);
> $table->set_border_width(10);
> $box1->pack_start($table);
> $table->show();
>
> $label = new GtkLabel();
> $i=0;
> $label->set_text($i);
> $table->attach($label,0,1,0,1);
> $label->show();
> global $label;
>
> $buttons2 = new GtkButton("Exit");
> $table->attach($buttons2,1,2,0,1);
> $buttons2->show();
> $buttons2->connect('clicked', delete_event);
>
>
> $window->show();
> Gtk::timeout_add(1000,time1);
> Gtk::main();
>
> ?>
>
> Gratefully for any help
> /Anders
>
>
> _________________________________________________________________
> Hämta MSN Explorer kostnadsfritt på http://explorer.msn.se
>
>
> --
> 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-