Jamie Norrish wrote:

Nikos Kouremenos writes:

> eventhough both pygtk ref and I think FAQ has it:

I certainly couldn't find this information in the Reference (grepping
through it), and while the FAQ has gtk.keysyms.Return in an example
piece of code, it wasn't obvious that the question it was answering
was my question. But that aside, and I'm probably missing something
else here, it's not clear to me how this helps me with setting an
accelerator.

The gtk.keysyms are aliases for numbers, but don't seem to be
recognised within an accelerator. The alt part is '<alt>', but
including the keysym after that leads to:

 GtkWarning: Unable to parse accelerator '<alt>65293' for action
 'Properties'

There may be useful information in the gtk.AccelGroup reference page:

http://www.pygtk.org/pygtk2reference/class-gtkaccelgroup.html

Using:

gtk.accelerator_parse('<alt>Return')

will return:

(65293, <flags GDK_MOD1_MASK of type GdkModifierType>)

a tuple containing the keyval and modifier for use in setting an accelerator. This may be what you are looking for. Note that the keyval is the same as the gtk.keysyms.Return which may be what Nikos was indicating. You are correct that there is no entry in the Reference manual for the gtk.keysyms module. Please file a bug against the docs for this oversight.

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