# -*- coding: utf-8 -*-
"""
Created on Tue Jan 15 22:34:11 2019
@author: Administrator
"""
import wx
class ButtonFrame(wx.Frame):
def __init__(self):
wx.Frame.__init__(self, None, -1, 'Button Example',
size=(300, 300))
panel = wx.Panel(self, -1)
self.button = wx.Button(panel, -1, "Hello", pos=(50, 20))
self.Bind(wx.EVT_BUTTON, self.OnClick, self.button)
self.button.SetDefault()
self.text = wx.TextCtrl(panel, wx.ID_ANY,pos=(0,140), size =(200,200 ), value="1234567890qwertyu",style = wx.TE_RICH|wx.TE_MULTILINE)
self.text.Bind(wx.EVT_LEFT_UP, self.leftUP)
def OnClick(self, event):
self.button.SetLabel("Clicked")
def leftUP(self,event):
print("ssssssssss")
self.text.SetValue("vvvvvvvvv")
if __name__ == '__main__':
app = wx.PySimpleApp()
frame = ButtonFrame()
frame.Show()
app.MainLoop()
wx.TextCtrl bind事件2