Hi,

I run into some trouble if I override the "realize" handler.

In the example below I get warnings when subclassing Gtk.Button and
the application terminates when subclassing Gtk.DrawingArea.



from gi.repository import Gtk

class MyButton(Gtk.Button):

    def do_realize(self):
        Gtk.Button.do_realize(self)


class MyArea(Gtk.DrawingArea):

    def do_realize(self):
        Gtk.DrawingArea.do_realize(self)


w = Gtk.Window()
#b = Gtk.Button("Hello world")
#b = MyButton("Hello world")
b = MyArea()
w.add(b)
b.show()
w.show()
w.connect('destroy', Gtk.main_quit)

Gtk.main()


Output for MyButton:

(subclass.py:3737): Gdk-CRITICAL **: gdk_window_move_resize_internal: asserti
`GDK_IS_WINDOW (window)' failed


Output for MyArea:

Gtk:ERROR:/build/buildd/gtk+3.0-3.2.0/./gtk/gtkwidget.c:10794:gtk_widget_real
alize: assertion failed: (!gtk_widget_get_has_window (widget))
Aborted

Is there something I missed in the code? I'm using pygobject 3.0.0,
gobject-introspection 1.30.0 and Gtk+ 3.2.0.

Regards,

Arjan
_______________________________________________
pygtk mailing list   pygtk@daa.com.au
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://faq.pygtk.org/

Reply via email to