tkinter - Python - Configuring multiple buttons at once in Tk -


i have eighteen buttons need change 1 image upon press of button. call .configure on each , set way, however, feel though there cleaner simpler way. ideas?

if buttons in list, can loop on them, this:

self.buttons = [button1, button2, ..., button18]  def updatebuttonimage(self):     button in self.buttons:         button.configure(image=self.newimage)  updatebutton = button(root, text="change button image", command=self.updatebutton) 

is had in mind?


Comments

Popular posts from this blog

vb.net - Alternative to the T-SQL AS keyword -

php - MySQLi binding parameters in a prepared statement doesn't work unless inserted after "WHERE" -

ios - CFRelease causing crash in iPad application -