There are quite a few posts on trying to push a Tkinter window on top:
- How to put a Tkinter window on top of the others
- Determining what tkinter window is currently on top
... and one post (only partially about Tkinter) I found, for a window on bottom, which is what I'm interested in:
... however, here I'd like to open a Tkinter window below the current terminal window - say I open a terminal, and run the Python shell there:
$ python2.7
Python 2.7.1+ (r271:86832, Sep 27 2012, 21:16:52)
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import Tkinter as tk
>>> root = tk.Tk()
>>> str(root)
'.'
>>> root.tk.eval('wm stackorder '+str(root))
'.'
>>> root.lower()
When I enter root.lower()
(very carefully, so the window remains on top, while I'm pressing the Enter key), I cannot see any changes in the window stacking order on the desktop (that is, the window simply remains on top).
Now, from what I can see from wm stackorder
, Tkinter probably only keeps track of its own windows - not the terminal window (in which Python itself runs), which would be handled by the window manager proper; is that correct? (I myself am using gnome-terminal
on Ubuntu 11.04 Gnome)
In that case, I guess it would be unreasonable to expect that lower()
would send the window at the bottom of the stacking order of desktop windows, that tkinter doesn't even know about. But is this correctly understood - is there no way to send a window "to back" from Tkinter?