I am unfamiliar with this syntax and am having trouble finding info about it...

void MyTextCtrl::OnChar(wxKeyEvent& event)
if ( isalpha( event.KeyCode() ) )
// key code is within legal range. we call event.Skip() so the
// event can be processed either in the base wxWidgets class
// or the native control.

// illegal key hit. we don't call event.Skip() so the
// event is not processed anywhere else.


I get unfamillar with the first line where the :: is. could someone explain what type of operator or other this is?

also on execution get error right at this point.

10 Years
Discussion Span
Last Post by asrekdal

The good folk over in the C++ forum will be happy to, I'm sure. wxWidgets is written in C++, and wxPython sits on top of it. Are you trying to figure out something in wxPython?



Ahh, that makes sense...

I am working with wxPython attempting working with GUI Events in hopes of making some ground towards a CSS editor but have run into problems finding the Bind function of the EvtHandler Class as is referenced in a tutorial.

Any clues where to find Bind function and EVT types for Bind in the wxPython documentation?


Ah. I see from the posted code that you've already found the "Event Handling Overview."

Here's a basic example of binding in wxPython:

app.frame.canvas = Canvas(parent=app.frame)
app.frame.canvas.Bind(wx.EVT_LEFT_UP, callback)

# This is frequently a class method, so will have the header 'callback(self, event)'
def callback(event):

If you want a full listing of all possible events, try this at the command line:

print [x for x in dir(wx) if x.startswith('EVT')]

Hope that helps. Let us know if you have something more specific in mind.



Well that does produce a nice list of 'em :)

Although would be helpfull to have some descriptions as well.

thanks -- andrew

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.