Changeset 396


Ignore:
Timestamp:
05/30/2011 02:50:12 PM (12 years ago)
Author:
marcus
Message:

key binding, using GTK the global AcceleratorTable? doesn't work

File:
1 edited

Legend:

Unmodified
Added
Removed
  • SHX/trunk/sandbox/traceplotter.py

    r395 r396  
    1111    def __init__(self, parent, fname=None): 
    1212        SP.ScrolledPanel.__init__(self, parent, style=wx.BORDER_SIMPLE) 
    13          
     13 
    1414        self.parent = parent 
    1515        self.Bind(wx.EVT_PAINT, self.OnPaint) 
     
    2626        duration = self.end - self.start 
    2727        x = evt.GetX() 
    28          
     28 
    2929        t = x * duration / self.width 
    3030 
     
    4242                print e.message 
    4343                return 
    44          
     44 
    4545        print "Loading %s..." % fname 
    4646        self.tr = st[0] 
     
    8484            offsetX = portion * width 
    8585            print portion, offsetX 
    86              
     86 
    8787        dc2 = wx.AutoBufferedPaintDCFactory(self) 
    8888        dc2.Clear() 
     
    118118            ]) 
    119119        self.SetAcceleratorTable(self.Accelerators) 
    120          
     120 
    121121        self.Bind(wx.EVT_CHAR_HOOK, self.onKeyDown) 
    122          
     122 
    123123        self.Show() 
    124124 
    125125    def onKeyDown(self, evt): 
    126         print evt.GetKeyCode() 
     126        kc = evt.GetKeyCode() 
     127        if kc == 114: # lower-case R 
     128            self.onRead(evt) 
     129        else: 
     130            print "key code", kc 
    127131 
    128132    def onQuit(self, evt): 
Note: See TracChangeset for help on using the changeset viewer.