Created
May 4, 2018 10:16
-
-
Save canwe/f1cbd419c74c1683eefaa6b5b103bdcb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
mouse event handling | |
@author: Dazhuang | |
""" | |
import wx | |
class Frame1(wx.Frame): | |
def __init__(self, parent): | |
wx.Frame.__init__(self, parent, title = "Example", pos= (100,200), size= (350,200)) | |
self.panel = wx.Panel(self) | |
self.panel.Bind(wx.EVT_LEFT_UP, self.OnClick) | |
def OnClick(self, event): | |
posm = event.GetPosition() | |
wx.StaticText(parent = self.panel,label = "Hello, World!",pos = (posm.x, posm.y)) | |
if __name__ == '__main__': | |
app = wx.App() | |
frame = Frame1(None) | |
frame.Show(True) | |
app.MainLoop() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment