[prev in list] [next in list] [prev in thread] [next in thread] 

List:       php-gtk-general
Subject:    Re: [PHP-GTK] a small prize to the nix user who returns results of this soonest ...
From:       Markus Fischer <mfischer () guru ! josefine ! at>
Date:       2001-12-14 4:38:13
[Download RAW message or body]

    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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic