Marcus Habermehl wrote:

Hi.

I want to add an accelerator to my gtk.Window().

After I read the pygtk reference several hours I meant this is the right
way.

accelgroup = gtk.AccelGroup()
window1.add_accel_group(accelgroup)
window1.add_accelerator('destroy', accelgroup, 113, gtk.gdk.CONTROL_MASK, 0)

But it doesn't work. I become this message:

GtkWarning: gtkwidget.c:3075: widget `GtkWindow' has no activatable
signal "destroy" without arguments

So I think the construction of add_accelerator is correct. Only the
signal isn't the right one.

Which signal I must use?


As mentioned in the docs you must use a signal which has the gobject.SIGNAL_ACTION flag set and has. You have to check the GTK+ source ocde to find that info unless you are using PyGTK 2.6 which has the gobject.signal_query() function that returns the signal flags in addition to other info. The usual signal emitted by an accelerator is "activate" for Actions, Buttons, Entrys, Expanders and MenuItems.

John
_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to