tkinter: wait_variable
John Grayson
johngrayson at home.com
Thu Jun 15 06:32:22 EDT 2000
In article <39482E96.350D115E at uniserve.com>,
Bob van der Poel <bvdpoel at uniserve.com> wrote:
>
> How does wait_variable() work? I've got the following in a class:
>
> __marked = []
>
> ....
>
> def mark(self):
> a callback to mark certain items
> self.__marked.append(x)
>
> def wait(self, root):
> root.wait_variable(self.__marked)
> return self.__marked
>
> and I call it, after setting up,etc:
>
> print myclass.wait(root)
>
> However, it never seems to return. With test print statements I have
> determined that my __marked variable is being updated...but
> wait_variable() doesn't seem to sense it.
>
> --
> __
> / ) / Bob van der Poel
> /--< ____/__ bvdpoel at uniserve.com
> /___/_(_) /_) http://users.uniserve.com/~bvdpoel
>
>
You've got to wait for a Tkinter (Tk) variable. There is no ListVar
class, so you need to wait on an IntVar or BooleanVar, then in your
mark method, set self.__marked *and* your Tkinter variable...
John
Sent via Deja.com http://www.deja.com/
Before you buy.
More information about the Python-list
mailing list