[Glade-users] python glade: `!GTK_WIDGET_REALIZED (widget)' failed



Hallo,
I created some small application with glade and now I would like to
build some python program arraund it. There should be gtk.DrawingArea 

        [...]

        self.xml = gtk.glade.XML(gladexml, "window1")
        self.window = self.xml.get_widget("window1")

        self.da = self.xml.get_widget("drawingarea1")

        # Signals used to handle backing pixmap
        self.da.connect("expose_event", self.draw)
        self.da.connect("configure_event", self.configure_event)

        # Event signals
        self.da.connect("motion_notify_event", self.motion_notify_event)
        self.da.connect("button_press_event", self.button_press_event)

        self.da.set_events(gtk.gdk.EXPOSURE_MASK
                            | gtk.gdk.LEAVE_NOTIFY_MASK
                            | gtk.gdk.BUTTON_PRESS_MASK
                            | gtk.gdk.POINTER_MOTION_MASK
                            | gtk.gdk.POINTER_MOTION_HINT_MASK)

        [...]


Result is, that the e.g. button_press_event function is not called and I
get:

GtkWarning: gtk_widget_set_events: assertion `!GTK_WIDGET_REALIZED
(widget)' failed
  self.da.set_events(gtk.gdk.EXPOSURE_MASK

I know, that the widget.set_events(events) function should be called
immediately after creating the widget.

But howto, if the widget is created by glade?

Thank you for any tips

Jachym

-- 
Jachym Cepicky
e-mail: jachym cepicky centrum cz
URL: http://les-ejk.cz
GPG: http://les-ejk.cz/gnupg_public_key/jachym_cepicky-gpg_public_key.asc
-----------------------------------------   
OFFICE:                                     
GDF-Hannover
Mengendamm 16d
30177 Hannover
Germany
e-mail: cepicky gdf-hannover de
URL:    http://gdf-hannover.de
Tel.:   +49 511-39088507
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://lists.ximian.com/pipermail/glade-users/attachments/20060528/9daf4fdf/attachment.bin



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]