Tkinter issue

John Grayson johngrayson at home.com
Sun Aug 27 12:32:51 EDT 2000


In article <8obb1c$r14$1 at reda.worldonline.fr>,
  "Benjamin" <benjamin.sauthier at worldonline.fr> wrote:
> I made 2 widget
> 1 checkbutton
> 1 frame containing some other button, label, ....
>
> when I check the button I want to activate the frame and disactivate
it when
> I uncheck the button.
>
> I did it with a callback
> checkbutton(text="....", ...., command=callback)
>
> def callback():
>  if check button status:
>      frame.config(status=DISABLED)
> else:
>         frame.config(status=ENABLED)
>
> But it seems there is no status for a frame. Is there an other widget
who
> could do the job, or should I unactivate all the widget inside the
frame
>
> is there and visual development tool for Python/Tkinter?
>
> thanks
>
> Benjamin
>
>

You really have answered your own question -- frames don't have a
state attribute. You'll have to individually set that for each of the
contained widgets.

Hint: Store the widget instances in a list:

        self.widList = []

        wid = Button(master, .....)
        wid.pack(...)
        self.widList.append(wid)
        etc...

    def setWidList(self, state=NORMAL):
        for widget in self.widList:
            widget.configure(state=state)


Hope this helps...

    John






Sent via Deja.com http://www.deja.com/
Before you buy.



More information about the Python-list mailing list