- tkwait visibility name
if {![window already visible]} { tkwait visibility $w }MG
[winfo viewable $w]perhaps?2015-12-22 HaO: Good suggestion. It is perhaps like [winfo mapped]? When you show a window, but the background process to physically show it was not run, it already shows 1. Well, all this "background showing" is a myth to me...
Windows bug or whatever - looking for help
HaO 2015-12-02:I had an issue today with tkwait visibility, I could not really track down.A large application does the following:
# hide main window on initialisation wm withdraw . update # initialisation of many things including main window wm state . normal catch {tkwait visibility .} ;# if error etc ommited for clarity wm geometry . $SavedGeometryUnder strange totally unrelated circumstances (empty config file not present) but repeatable, the tkwait waits forever.Thus, I have modified it as follows:
# hide main window on initialisation wm deiconify . update # initialisation of many things including main window wm state . normal if {[winfo ismapped .]} { catch {tkwait visibility .} ;# if error etc ommited for clarity } wm geometry . $SavedGeometryThe "winfo ismapped" is only 0 if the tkwait will stall. I tried thousands of other things including update, wm deiconfy etc. With the upper patch, the window shows up quite delayed when tkwait is not used, but it shows up. The wm geometry is eventually not correctly honored (what the tk visibility is for) but that is better than nothing.Anybody with the same experience may add to whether nail it down to a test script or whatever.This is:
- TCL 8.6.4 32 bit
- Windows 10 64 bit (German)
# hide main window on initialisation wm withdraw . # initialisation of many things including main window wm geometry . $SavedGeometry update wm deiconify . wm raise . focus -force .Remarks:The last two lines are required to bring the main window in front and give it the focus. As you can see, there is no "tkwait visibility ." in play.HaO 2015-12-22: Thank you, [HoMi], for the contribution. This is all ok but does not get the point. The point here is that I see a bug with tkwait I wanted to transform into a ticket but I have not enough in my hands for that.About your solution: The point is, that "wm geometry . $geom" is only honored when the window is really visible and when multiple "update" rounds have passed as there might be "Configure" events, which itself cause "Configure" events and all this must be passed. To get this moment, I used "tkwait visibility" which is very elegant in most cases.