[wxPython-users] Re: The Holy Grail - Introspection on hotkey

Werner F. Bruhin werner.bruhin at free.fr
Wed Dec 13 10:37:45 PST 2006


Hi Don,

Don Taylor wrote:
> Robin Dunn wrote:
>
>> The module is in cvs 
>> here:http://cvs.wxwidgets.org/viewcvs.cgi/wxWidgets/wxPython/wx/lib/mixins/inspect.py?rev=1.1&content-type=text/vnd.viewcvs-markup 
>>
>>
> I think that there is an error in this line in OnKeyPress():
>
>         if evt.AltDown() and evt.CmdDown() and evt.KeyCode == ord('I'):
>
> maybe it should read:
>
>         if evt.AltDown() and evt.CmdDown() and evt.KeyCode() == ord('I'):
Quote from the 2.8.0.1 changes file:
Added Python properties for many of the getter/setter methods of wx 
classes. In order for the names to be predicatble for somebody already 
familiar with wxPython the property names are simply the name of the 
getter with the "Get" dropped. For example, wx.Window has a property 
named "Size" that maps to GetSize and SetSize. So far there is only one 
known name conflict using this naming convention, and that is 
wx.KeyEvent.KeyCode, however since KeyCode was formerly a compatibility 
alias for GetKeyCode (and has been for a long time) it was decided to 
just switch it to a property. If you want to use the method then change 
your calls to event.KeyCode() to event.GetKeyCode(), otherwise you can 
use it as a property just by dropping the parentheses.

Werner





More information about the wxpython-users mailing list