有没有办法,我可以把两个事件按顺序绑定到一个按钮上。我的意思是:
在本例中,按钮1和2分别绑定到其事件。在
self.button1 = wx.Button(panel, -1, 'BUTTON1')
self.button1.Bind(wx.EVT_BUTTON, self.OnButton1)
self.button2 = wx.Button(panel, -1, 'Button2')
self.button2.Bind(wx.EVT_BUTTON, self.OnButton2)
def OnButton1(self,event):
a = 1
b = 3
print a+b # basically some commands
# Here I want to execute OnButton2 EVENT - So I use the following LINE
OnButton2(event)
# But the above command should not be executed unless the OnButton2 event has processed in the past - (Meaning unless the Button2 event has happen in the past) So How would I solve that problem.
# It should be like IF CONDITION (BUTTON 2 HAS BEEN PRESSED IN THE PAST) - EXECUTE: SOME BASIC COMMANDS LIKE PRINT "HELLO"
def OnButton2(self,event):
c = 4
d = 5
print c*d
目前没有回答
相关问题 更多 >
编程相关推荐