- Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathClickBitmap.py
More file actions
Latest commit
executable file
·35 lines (23 loc) · 810 Bytes
/
Copy pathClickBitmap.py
File metadata and controls
executable file
·35 lines (23 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/usr/bin/env python
importwx
importwx.lib.statbmpasstatbmp
classMainFrame(wx.Frame):
def__init__(self, *args, **kwargs):
wx.Frame.__init__(self, *args, **kwargs)
bmp=wx.Bitmap("Images/medtest.jpg")
self.Image=statbmp.GenStaticBitmap(self, wx.ID_ANY, bmp)
self.Image.Bind(wx.EVT_LEFT_DOWN, self.OnClick)
S=wx.BoxSizer(wx.VERTICAL)
S.Add(self.Image, 0)
self.SetSizerAndFit(S)
defOnClick(self, event):
print("Image: was clicked at: %i, %i "%(event.GetX(), event.GetY()))
classApp(wx.App):
defOnInit(self):
frame=MainFrame(None, title="wxWindowBitmap Test")
self.SetTopWindow(frame)
frame.Show(True)
returnTrue
if__name__=="__main__":
app=App(0)
app.MainLoop()