events

Thanks, Roger!!!

here is that GUI,
http://osdn.dl.sourceforge.net/sourceforge/sndrec/sndrecGUI.rar

one more question:

I've Binded the LEFT_UP, LEFT_DOWN mouse events to buttons, but how
implement exactly a mouse click (when the area where mouse were down
and then up is the same object) and react differently on all buttons?

I have there a class.attr dictionary imgData which stores data about
the object (instance).

maybe I should link a reference to the function defined in the main
module with imgData['action'] variable? And then just do some IFs at
LEFT_UP /if "the mouse WAS_DOWN here" then "call imgData['action']/ ?

What do you guys think about it?

any comments about code welcomed,
thanks

import wx
class SkinnedButton(wx.StaticBitmap):
   def __init__(self, parent, imgData):
       self.imgData = imgData
       wx.StaticBitmap.__init__(self, parent, wx.ID_ANY,
imgData['idle'], imgData['size'])

       self.Bind(wx.EVT_LEFT_DOWN, self.OnPress)
       self.Bind(wx.EVT_LEFT_UP, self.OnBtnUp)
       #self.Bind(wx.EVT_BUTTON, self.OnClick)
       self.Bind(wx.EVT_ENTER_WINDOW, self.OnEnter)
       self.Bind(wx.EVT_LEAVE_WINDOW, self.OnLeave)

   def OnClick(self, event): self.SetBitmap(self.imgData['click'])
   def OnPress(self, event): self.SetBitmap(self.imgData['click'])
   def OnBtnUp(self, event): self.SetBitmap(self.imgData['focus'])
   def OnEnter(self, event): self.SetBitmap(self.imgData['focus'])
   def OnLeave(self, event): self.SetBitmap(self.imgData['idle'])