This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Nikolay.Fomichev
Recipients Nikolay.Fomichev
Date 2011-03-03.18:30:13
SpamBayes Score 1.8587981e-08
Marked as misclassified No
Message-id <1299177014.21.0.99633865764.issue11387@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2011-03-03 18:30:14Nikolay.Fomichevsetrecipients: + Nikolay.Fomichev
2011-03-03 18:30:14Nikolay.Fomichevsetmessageid: <1299177014.21.0.99633865764.issue11387@psf.upfronthosting.co.za>
2011-03-03 18:30:13Nikolay.Fomichevlinkissue11387 messages
2011-03-03 18:30:13Nikolay.Fomichevcreate