Reputation: 21
I want to collect input from the user in test box. So when I click a button it should give me name of that button in test box Error: you should omit either rows of column
for i in A:
hbox1=wx.BoxSizer(wx.HORIZONTAL)
btn = wx.Button(p, -1, i, (10,20))
btn.myname = I
gs.Add(btn,0,)
self.Bind(wx.EVT_BUTTON, self.OnClick, btn)
self.t1=wx.TextCtrl(p)
gs.Add(btn,0,)
self.t1.Bind(wx.EVT_BUTTON, self.OnClick, btn)
gs.Add(hbox1)
p.SetSizer(gs)
def OnClick(self, event): #When the button is clicked
name = event.GetEventObject().myname
Upvotes: 0
Views: 237