Re: [PHP-GTK] php-gtk win crashes

[email protected] ("Steph") Mon, 6 Aug 2001 17:45:05 +0100
Newsgroups php.gtk
Message-ID <024d01c11e97$450a9160$0612073e@t2r1o8>
I've got it running, give or take the odd error message.  I won't pretend to understand how.

(Julia?)

----- Original Message ----- 
From: "Hien Quan" <[email protected]>
To: <[email protected]>
Cc: "'php-gtk dist.'" <[email protected]>
Sent: Monday, August 06, 2001 4:05 PM
Subject: RE: [PHP-GTK] php-gtk win crashes


Thanks for the response....

the answer is NOPE!

Strange thing is that I've got this to work before until I tried playing
around with some other widgets.

-----Original Message-----
From: [email protected] [mailto:[email protected]]
Sent: 06 August 2001 15:08
To: [email protected]
Subject: Re: [PHP-GTK] php-gtk win crashes


only a very tiny thought, and probably wrong -

When I've set counters in the past I've always declared it as an integer
type.

$timer = 0;
$timer = (int)$timer;

Does that make a difference here?

> Hi All,
>
> >From various code snippets posted to this group and the example files,
I'm
> trying to run the program below, but keep getting a Dr. Watson php.exe
crash
> dump on WinNT.
> The window opens up OK with the default NULL value in the entry box.
However
> php crashes when the timeout_add(...) routine is called for the second
time.
> Any thoughts?
>
> Thanks,
> Hien
>
> ----code snippet----
> <?
> if (strtoupper(substr(PHP_OS, 0, 3)) == 'WIN')
>         dl('php_gtk.dll');
> else
>         dl('php_gtk.so');
>
> function delete_event() {
>         return false;
> }
>
> /*
>  * Called when the window is being destroyed. Simply quit the main loop.
>  */
> function destroy() {
>         Gtk::main_quit();
> }
>
> // general close window function all widgets
> function close_window($widget,$text_entry)
> {
> $value = $text_entry->get_text();
> print $value;
> $window = $widget->get_toplevel();
> $window->hide();
> return true;
> }
>
> function create_entry()
> {
> $window = &new GtkWindow;
> $windows['entry'] = $window;
> $window->connect('delete-event', 'delete_event');
> $window->set_title('Configuration');
> $window->set_border_width(0);
>
> $box1 = &new GtkVBox();
> $window->add($box1);
> $box1->show();
>
> $box2 = &new GtkVBox(false, 10);
> $box2->set_border_width(10);
> $box1->pack_start($box2);
> $box2->show();
>
> $entry = &new GtkEntry();
> $entry->set_text('Hello World');
> $entry->select_region(0, 5);
> $box2->pack_start($entry);
> $entry->show();
>                 $entry->set_visibility(false);
>
> $separator = &new GtkHSeparator();
> $box1->pack_start($separator, false);
> $separator->show();
>
> $box2 = &new GtkVBox(false, 10);
> $box2->set_border_width(10);
> $box1->pack_start($box2, false);
> $box2->show();
>
> $button = &new GtkButton(' Save and Close');
> $button->connect('clicked', 'close_window',$entry);
> $button->set_flags(GTK_CAN_DEFAULT);
> $button->grab_default();
> $button->show();
> }
>
>
> function draw_screen(){
> global $entry1,$timer;
>    $entry1->set_text("".$timer  );
> return true;
> }
>
>
> // create_main_window()
> $window = &new GtkWindow();
> $window->set_policy(false, false, false);
> $window->set_name('main window');
> $window->set_usize(200, 400);
> $window->set_uposition(20, 20);
>
> $window->connect_object('destroy', array('gtk', 'main_quit'));
> $window->connect_object('delete-event', array('gtk', 'false'));
>
> $box1 = &new GtkVBox();
> $window->add($box1);
>
> $label = &new GtkLabel('Timer');
> $box1->pack_start($label,false);
> $label->show();
>
> $entry1 = &new GtkEntry();
> $entry1->set_text('NULL');
> $box1->pack_start($entry1,false);
> $entry1->show();
> $entry1->set_editable(false);
> $entry1->set_sensitive(true);
>
> $separator = &new GtkHSeparator();
> $box1->pack_start($separator, false);
>
> $box2 = &new GtkVBox(false, 10);
> $box2->set_border_width(10);
> $box1->pack_start($box2, false);
>
> $button = &new GtkButton('close');
> $button->connect_object('clicked', array('gtk', 'main_quit'));
> $box2->pack_start($button);
> $button->set_flags(GTK_CAN_DEFAULT);
> $button->grab_default();
>
> $window->show_all();
>
>
> //******* Global variables
> $timer = 0;
>
> //create_main_window();
> gtk::timeout_add(1500, 'draw_screen');
>
> Gtk::main();
> ?>
>
>
> --
> PHP GTK Mailing List (<a href="/bti/redirect.html?http://www.php.net/)"
target="t21Link">http://www.php.net/)</a>
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
> To contact the list administrators, e-mail: [email protected]
>


-- 
PHP GTK Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
To contact the list administrators, e-mail: [email protected]