Tkinter event question

Russell E. Owen no at spam.invalid
Tue Nov 4 12:18:58 EST 2003


In article <bo7r4g$26h$1 at news-reader1.wanadoo.fr>,
 Eric Brunel <eric.brunel at pragmadev.N0SP4M.com> wrote:

>> #!/usr/local/bin/python
>> from Tkinter import *
>> root = Tk()
>> 
>> class myLabel(Label):
>>     def sendFoo(self):
>>         self.event_generate("<<Foo>>")
>
>Do you really need to send the event to the label itself here? Apparently, it 
>is 
>what causes the problem: doing a self.master.event_generate("<<Foo>>") has the 
>expected result.

That sounds like a good workaround. Thanks!

What I'm actually trying to do is:
- I have a "manage panels" widget that takes a list of control panel 
widgets, displays a column of checkbuttons (one per widget) and then 
either displays or hides each control panel depending on its associated 
checkbutton
- In certain limited cases I want a control panel to open itself (with 
the associated checkbox toggling appropriately)
- I was sending "<<ShowMe>>" from the panel to accomplish this, and it 
only worked if the panel had ever been shown.

I was considering using a logical variable, but felt it was 
inappropriately tight coupling between the "manage panels" widget and 
the panels themselves. 

I will verify that it's a tcl/tk bug and report it if so (and I agree it 
seems virtually certain to be so).

-- Russell




More information about the Python-list mailing list