[Tutor] how can a value be retrieved from an event loop?

Alan Gauld alan.gauld at yahoo.co.uk
Fri Nov 17 05:02:28 EST 2023


On 16/11/2023 23:20, Phil wrote:
> On 17/11/23 01:12, Alan Gauld via Tutor wrote:
>> I was sufficiently intrigued by this that I took another pass
>> and added a label to demonstrate how it could be used and

> Thank you Alan, I never thought of using string_var. 

You could use an IntVar just as easily (and avoid the
string conversion) but I used StringVar because a string
is more easily formatted. The key thing is that the Tkinter
Var objects allow communication  between two widgets
automatically without you having to do anything other
than assign the same Var to each widget.

It was your comment that you wanted something like Scale
that triggered the idea - that's how Scale works too.


-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos





More information about the Tutor mailing list