Dummy Question

Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Mar 2008
Posts: 24
Reputation: asrekdal is an unknown quantity at this point 
Solved Threads: 0
asrekdal asrekdal is offline Offline
Newbie Poster

Dummy Question

 
0
  #1
Mar 1st, 2008
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.
Last edited by asrekdal; Mar 1st, 2008 at 4:04 pm.
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 608
Reputation: jrcagle is on a distinguished road 
Solved Threads: 150
jrcagle jrcagle is offline Offline
Practically a Master Poster

Re: Dummy Question

 
0
  #2
Mar 1st, 2008
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?

Jeff
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 24
Reputation: asrekdal is an unknown quantity at this point 
Solved Threads: 0
asrekdal asrekdal is offline Offline
Newbie Poster

Re: Dummy Question

 
0
  #3
Mar 1st, 2008
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?
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 608
Reputation: jrcagle is on a distinguished road 
Solved Threads: 150
jrcagle jrcagle is offline Offline
Practically a Master Poster

Re: Dummy Question

 
0
  #4
Mar 1st, 2008
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:

  1. app.frame.canvas = Canvas(parent=app.frame)
  2. app.frame.canvas.Bind(wx.EVT_LEFT_UP, callback)
  3. ...
  4.  
  5. # This is frequently a class method, so will have the header 'callback(self, event)'
  6. def callback(event):
  7. 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
Reply With Quote Quick reply to this message  
Join Date: Mar 2008
Posts: 24
Reputation: asrekdal is an unknown quantity at this point 
Solved Threads: 0
asrekdal asrekdal is offline Offline
Newbie Poster

Re: Dummy Question

 
0
  #5
Mar 1st, 2008
Well that does produce a nice list of 'em

Although would be helpfull to have some descriptions as well.

thanks -- andrew
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC