import wx
import wx.lib.statbmp
class wrappedBitmap(wx.lib.statbmp.GenStaticBitmap):
    def __init__(self, parent):
        jpg = wx.Image('test.jpg', wx.BITMAP_TYPE_JPEG).ConvertToBitmap()
        sz = (jpg.GetWidth(), jpg.GetHeight())
        wx.lib.statbmp.GenStaticBitmap.__init__(self,parent,-1,jpg,(0,0),sz,0,"aname")
        
class MyFrame(wx.Frame):
    def __init__(self,parent, id,title,position,size):
        wx.Frame.__init__(self,parent, id,title,position, size)
        
        p1 = wrappedBitmap(self)
        self.Bind(wx.EVT_LEFT_UP,self.OnClick,p1)
        
        wx.EVT_CLOSE(self, self.OnCloseWindow)
        
    def OnCloseWindow(self,event):
        self.Destroy()
    
    def OnClick(self,event):
        print "OnClick"
        print event.getId()
        print event.GetEventObject()
        
class App(wx.App):
    def OnInit(self):
        frame = MyFrame(None, -1, "wxBitmap Events?", wx.DefaultPosition,(500,400))
        self.SetTopWindow(frame)
        frame.Show(True)
        return True

app = App(0)
app.MainLoop()