Options
(Configuration options learned from New Mexico Tech tkinter reference on TopLevel)
Colors:
bg or background -- background color of window (TkinterColors)
bd or borderwidth -- border width in pixels -- Does this actually do anything? How does this show up? (TkinterDimensions)
Focus & Focus Colors:
takefocus -- normally, a TopLevel doesn't take focus. Set takefocus=True to take focus. See: TkinterFocus. -- I'm not sure how this works; I see no difference.
highlightbackground -- color of a border when the toplevel window does NOT have focus (is inactive) (TkinterColors)
highlightcolor -- color of a border when the toplevel window DOES have focus (is active) (TkinterColors)
- highlightthickness -- thickness of the highlight; the default value is 1, which is barely perceptible; set to 0 to suppress highlighting entirely
To see the effects very quickly, you can run:
import tkinter t = tkinter.Tk() t.configure(highlightthickness=5) t.configure(highlightbackground="#FF0000") t.configure(highlightcolor="#00FF00")
Style:
class_ -- string class name in the OptionDatabase, for styling
relief -- default: no 3-d border; to get shaded border, set bd > 0 (default) (ReliefStyle)
cursor -- string name of cursor (TkinterCursors) when mouse is over window
Dimensions:
height -- window height (TkinterDimensions)
width -- window width (TkinterDimensions)
padx -- provide extra space on the left and right sides of the window (how?) (TkinterDimensions)
pady -- provide extra space on the top and bottom sides of the window (how?) (TkinterDimensions)
Menu:
menu -- supply a Menu widget to set the menu
Questions
I don't understand how to get a TopLevel to take focus. How does that work?
Resources
Discussion
LionKimbro: I'm generally of the mind that Flat is better than nested. Which is to say, rather than making menus upon menus of content, try to consolidate content onto a single page.
I would name this page "TopLevel" rather than "Widgets/TopLevel", and I would include content like "How do I hide the main toplevel Tkinter automatically pops up?" right on TopLevel, rather than making a whole page with a name that nobody is ever going to use or remember. (Simple noun phrases of 2-3 words generally make the best wiki names.)
Editorializing ends.