| | |
Dummy Question
Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Mar 2008
Posts: 24
Reputation:
Solved Threads: 0
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.
event.Skip();
}
else
{
// illegal key hit. we don't call event.Skip() so the
// event is not processed anywhere else.
wxBell();
}
}
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.
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.
event.Skip();
}
else
{
// illegal key hit. we don't call event.Skip() so the
// event is not processed anywhere else.
wxBell();
}
}
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.
Last edited by asrekdal; Mar 1st, 2008 at 4:04 pm.
•
•
Join Date: Mar 2008
Posts: 24
Reputation:
Solved Threads: 0
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?
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?
•
•
Join Date: Jul 2006
Posts: 608
Reputation:
Solved Threads: 150
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:
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.
Jeff
Here's a basic example of binding in wxPython:
Python Syntax (Toggle Plain Text)
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): handle_my_event_here()
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.
Jeff
![]() |
Similar Threads
- Install Windows XP in another machine ... (Windows NT / 2000 / XP)
- Newbie Question (Hello World) (C++)
- implemetation question regarding interfaces and classes (Java)
- vBulletin mod_rewrite (PHP)
- Amazing Website Designs - How do they do this? (Site Layout and Usability)
- Question about comparing a string with a character (C++)
- Dummy in VB (Visual Basic 4 / 5 / 6)
- hard drive (Storage)
Other Threads in the Python Forum
- Previous Thread: gui based chat server
- Next Thread: Optimization advice?
| Thread Tools | Search this Thread |
abrupt ansi anti apache approximation array assignment backend beginner binary book builtin calculator chmod code converter countpasswordentry curved customdialog dan08 dictionaries dictionary drive dynamic examples file filename float format function graphics gui heads homework import inches input java launcher library line lines linux list lists loop mouse mysql mysqlquery number numbers numeric output parsing path phonebook plugin pointer port prime programming progressbar projects py2exe pygame pysimplewizard python random recursion redirect scrolledtext software statictext statistics string strings sum table terminal text textarea thread threading time tkinter tlapse trick tricks tuple tutorial twoup ubuntu unicode urllib urllib2 variable windows wordgame write wxpython






