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

From: Date: Fri, 14 Dec 2001 04:35:20 +0000
Subject: Re: a small prize to the nix user who returns results of this soonest ...
References: 1 2  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-857@lists.php.net to get a copy of this message
Nice one, thanks Markus, that echoes exactly what happens in the source for the gtk::grab_add() function. There is no clue anywhere that you have to replicate that in order to use set_flags(GTK_HAS_GRAB) - and believe me I've looked! Weird stuff earlier too - someone got a return with no error on debian regardless of the reference count on the widget. ----- Original Message ----- From: "Markus Fischer" <mfischer@guru.josefine.at> To: "Steph" <steph.fox@btinternet.com> Cc: "PHP-GTK gen" <php-gtk-general@lists.php.net> Sent: Friday, December 14, 2001 4:38 AM Subject: Re: [PHP-GTK] a small prize to the nix user who returns results of this soonest ... > 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. > > -- > 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 >

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