문제

I'm using Tcl/Tk to build a UI and im running into the problem of trying to interact with a toplevel window before it's actually been created.

I created the toplevel window like this:

toplevel .t

Then i try and interact with it like this:

wm stackorder .t isabove .

But .t doesn't exist yet and i get an error about the window not being mapped. Effectively it equates to doing this:

winfo ismapped [toplevel .t]

which returns 0 but if i immediately run the following:

winfo ismapped .t

Then the return value is 1.

How can i know when a toplevel window is mapped (and therefore ready to interact with) so that i can proceed with my program?

도움이 되었습니까?

해결책

I found the answer, i needed the following:

tkwait visibility .t
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top