Message129990
A simple code:
class App():
def __init__(self):
self.root = tk.Tk()
self.btn = tk.Button(self.root, text='Click me')
self.btn.pack()
self.btn.bind('<Button-1>', self.click)
self.root.mainloop()
def click(self, event):
# Messagebox or filedialog
pass
When the button is clicked, it calls the function where a filedialog or messagebox is called. After the function is done the button changes - it looks like it's pressed. Its relief is sunken. Something like "self.btn.config(relief=tk.RAISED)" has no effect - relief is raised, but the button still looks pressed.
If no dialogs are called, all is fine.
But... if instead of "bind" I use config option "command", it works - the function goes well with dialogs, etc and the button is really raised.
I checked this in 2.6.6, 2.7, 3.1.2 and 3.2 on Linux and Win, everywhere is the same tune. |
|
Date |
User |
Action |
Args |
2011-03-03 18:30:14 | Nikolay.Fomichev | set | recipients:
+ Nikolay.Fomichev |
2011-03-03 18:30:14 | Nikolay.Fomichev | set | messageid: <1299177014.21.0.99633865764.issue11387@psf.upfronthosting.co.za> |
2011-03-03 18:30:13 | Nikolay.Fomichev | link | issue11387 messages |
2011-03-03 18:30:13 | Nikolay.Fomichev | create | |
|