I have a Tcl/Tk application with multiple dialogs which may be visible at the same time. However, I would like to set my “main dialog” (which is defined as top level) to be “always on top”. How do I do this?
Asked
Active
Viewed 1,434 times
1 Answers
4
Just use
wm attribute . -topmost 1

Johannes Kuhn
- 14,778
- 4
- 49
- 73
-
I've tried it, but no good. Whenever additional dialog is opened, it covers the top level – HardwareEng. Oct 14 '13 at 06:08
-
On my windows machine, it behaves as advertised. – Johannes Kuhn Oct 14 '13 at 06:21
-
Idea: is it possible that your solution works when handling several top levels? In my application, I use 'dialog' widget from IWidgets. – HardwareEng. Oct 14 '13 at 06:29
-
If you specify `.` as parent of your dialog, then the dialog will inherit this. (e.g. `tk_chooseColor -parent .` will always be on top, the `.` window does not accept any input. The `wm attribute . -topmost 1` sets a system flag (always on top), so other programs like firefox are behind this window. – Johannes Kuhn Oct 14 '13 at 06:50
-
I understand. But I can I make a specific top level of my application to be always on top of all other IWidgets dialogs of the application? – HardwareEng. Oct 14 '13 at 06:59