[pygtk] DrawingArea user feedback

Frédéric frederic.mantegazza at gbiloba.org
Tue Nov 18 00:31:38 WST 2008


Le 17/11/2008, "A.T.Hofkamp" <a.t.hofkamp at tue.nl> a écrit:

>In the scribble tutorial example (appendix B), they use
>
>drawing_area.connect("button_press_event", button_press_event)
>
>with a function
>
>def button_press_event(widget, event):
>    ...

Thanks for pointing me to that example.

I tried to bind this signal, but it didn't work. This is because it
needs to be enabled, calling set_events() method. But when I do that, I
get:

GtkWarning: gtk_widget_set_events: assertion `!GTK_WIDGET_REALIZED
(widget)' failed

Why?

--
   Frédéric


More information about the pygtk mailing list