From: Programmingkid <pro...@gm...> - 2017-12-01 14:03:35
|
> On Dec 1, 2017, at 1:30 AM, Steve Landers <st...@di...> wrote: > > Should Tk work in a thread on MacOS ? > > The following script works on Linux and Windows, but not MacOS the toplevel window resizes but the label doesn’t appear. > > I can’t find any documentation that says it shouldn’t work. > package require Thread > set id [thread::create] > thread::send $id { > package require Tk > label .l1 -text "This is a label" > grid configure .l1 > } > > It seems the grid is the problem, because I can see the label widget exists. Replacing grid with a pack doesn’t fix it. > > Can anyone shed some light? > > —Steve It is common for GUI frameworks to only want to use the main thread for all their GUI work. When I tried out your code in wish I saw the label, so it works for me. Only when I tried quitting the application an exception occurred. My info: TK 8.5.9 Mac OS 10.12.6 |