from tkinter import * class ThemedButton(Button): def __init__(self, parent=None, **configs): Button.__init__(self, parent, **configs) self.pack() self.config(fg='red', bg='black', font=('courier', 12), relief=RAISED, bd=5,command=self.onSpam) def onSpam(self): print('ONSPAM...') B1 = ThemedButton(text='TES1') B2 = ThemedButton(text='TES2') B2.pack(expand=YES, fill=BOTH) mainloop()
Previous
Next Post »
Thanks for your comment