[pygtk] pygtk applet Menu trouble

Jay Graves jay at skabber.com
Sat Jun 3 05:06:56 WST 2006


Hello,

I am writing an applet that displays a list of items and then
refreshes them every so often.  To do this I am using an EventBox that
when clicked does a menu.popup().  This works fine until the refresh
method is called.  I try to destroy the menu and then build another
one.  After this happens when the EventBox is clicked on I get the
following stacktrace.

/usr/local/bin/applet.py:40: GtkWarning: gtk_window_set_accept_focus:
assertion `GTK_IS_WINDOW (window)' failed
  theMenu.popup(None, None, None, ev.button, gtk.get_current_event_time())
/usr/local/bin/applet.py:40: GtkWarning: gtk_window_move: assertion
`GTK_IS_WINDOW (window)' failed
  theMenu.popup(None, None, None, ev.button, gtk.get_current_event_time())
/usr/local/bin/applet.py:40: GtkWarning: gtk_widget_size_request:
assertion `GTK_IS_WIDGET (widget)' failed
  theMenu.popup(None, None, None, ev.button, gtk.get_current_event_time())
/usr/local/bin/applet.py:40: GtkWarning: gtk_widget_size_allocate:
assertion `GTK_IS_WIDGET (widget)' failed
  theMenu.popup(None, None, None, ev.button, gtk.get_current_event_time())
/usr/local/bin/applet.py:40: GtkWarning: gtk_widget_realize: assertion
`GTK_WIDGET_ANCHORED (widget) || GTK_IS_INVISIBLE (widget)' failed
  theMenu.popup(None, None, None, ev.button, gtk.get_current_event_time())

I have attached an example script of that shows exactly how I am doing
this.  The script uses the GNOME_PythonAppletSample.server file that
comes with the python gnome applet package.

I was hoping someone could tell my what I am doing wrong, and what the
proper way to achieve this is.

Thanks

-- 
Jay Graves
jay at skabber.com
jay.skabber.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: applet.py
Type: text/x-python
Size: 1688 bytes
Desc: not available
Url : http://www.daa.com.au/pipermail/pygtk/attachments/20060602/03be881e/applet.py


More information about the pygtk mailing list