1
我添加了一個按鈕:如何禁用Pmw.ButtonBox中的特定按鈕?
def addButtons(self):
self.buttonBox = Pmw.ButtonBox(self.dataFrame,
labelpos = 'nw',
label_text = '',
frame_borderwidth = 1,
frame_relief = 'groove')
self.buttonBox.pack()
self.buttonBox.place(relx=.75, rely=.750, anchor=W)
# Add some buttons to the ButtonBox.
self.buttonBox.add('Login', command = self.login)
# Set the default button (the one executed when <Return> is hit).
self.buttonBox.setdefault('Login')
self.dataFrame.bind('<Return>', self._processReturnKey)
self.dataFrame.focus_set()
現在,我想禁用登錄按鈕,當用戶按下它。我怎樣才能做到這一點?我找到了簡單按鈕的答案,但是此按鈕位於按鈕框中。