Re: a small prize to the nix user who returns results of this soonest ...

From: Date: Fri, 14 Dec 2001 04:38:13 +0000
Subject: Re: a small prize to the nix user who returns results of this soonest ...
References: 1  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-855@lists.php.net to get a copy of this message
It only exposes an error if uncommenting the set_flags() line if you don't add the refcount: Gtk-WARNING **: invalid unclassed pointer in cast to `GtkWidget' Gtk-CRITICAL **: file gtkobject.c: line 1172 (gtk_object_unref): assertion `GTK_IS_OBJECT (object)' failed. Ie: $button->set_flags(GTK_VISIBLE | GTK_HAS_GRAB); $button->ref(); works. On Fri, Dec 14, 2001 at 12:29:38AM -0000, Steph wrote : > Running the following script on win32 provokes an error message if one of the 'grab' > lines is uncommented, but not for the other if switched. > > I have no idea why and just want to know at present, does it do the same on linux? > > - course, it could be down to my coding ... if so I'd like to know that too, please - > > <? > dl('php_gtk.' . (strstr(PHP_OS, 'WIN') ? 'dll' : 'so')) > || > die("Can't load php_gtk module!\n"); > > function end_stuff($button, $window3) { > $window3->destroy(); > } > > $window = &new GtkWindow(); > $window->set_title('parent window'); > $window->set_position(GTK_WIN_POS_CENTER); > $window->set_default_size(200,300); > $window->connect_object('destroy', array('gtk', 'main_quit')); > > $window3 = &new GtkWindow(GTK_WINDOW_DIALOG); > $window3->set_title('dialog window'); > $window3->realize(); > > $button = &new GtkButton('test'); > > /*PLEASE UNCOMMENT ONE OF THE FOLLOWING TWO LINES ........!!!! THANKS sf */ > //$button->set_flags(GTK_VISIBLE | GTK_HAS_GRAB); > //gtk::grab_add($button); > > $button->connect('enter', 'end_stuff', $window3); > $window3->add($button); > > $window->show(); > $window3->show_all(); > > gtk::main(); > ?> > > > > > -- > 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 -- Please always Cc to me when replying to me on the lists.

« previous php.gtk.general (#855) next »