I was wondering if there was a dictionary containing string versions of wxPython class (like 'Button' for wx.Button) to the events they call. This is what I want: {'Button': wx.EVT_BUTTON, ...}. Is there a dictionary like this anywhere in the module or on the web?
views:
72answers:
2
A:
This is what I do (probably taken from the mailing list at some time):
for i in dir(wx):
if i.startswith('EVT_'):
print i
Clearly this isn't exactly what you're asking for, but the result is pretty intuitive to figure out what does what.
DrBloodmoney
2010-05-12 16:17:54
A:
wxGlade knows about this: For every Widget there is a class EditWidget derived from class ManagedBase that has a class attribute events holding the names of the events sent by Widget:
e.g. in widgets/bitmap_button/bitmap_button.py you'll find
class EditBitmapButton(ManagedBase):
events = ['EVT_BUTTON']
You could collect the information you want by importing all these classes (can be done automatically, I think) and reading their events attribute.
Ber
2010-05-12 22:47:19