这是我的密码:
for i in posortowane:
z += 20
result = '%s: %s' % (i[0], i[1])
wx.StaticText(panel, -1, result, (345, 125 + z), style=wx.ALIGN_CENTRE)
btn4 = wx.Button(panel, -1, u"Remove", (485, 120 + z))
self.Bind(wx.EVT_BUTTON, self.Rem, btn4)
有两个按钮,一个在另一个下面。它们称为Rem函数:
def Rem(self, i):
print i
当我点击按钮时,我想从“posortowane”写“I”。它不起作用。我试过:
self.Bind(wx.EVT_BUTTON, self.Rem(i), btn4)
但它在我点击按钮之前调用Rem函数。我怎样才能做到这一点?我为我的英语感到抱歉。谢谢你的帮助。你知道吗
当您添加paranthesis时,您告诉解释器立即调用该函数。} 。你知道吗
要传递参数而不立即调用回调,应该使用^{
相关问题 更多 >
编程相关推荐