Tkinter Widget-TopLevel

Toplevel widgets are used to create a Window, which are directly managed by the Window manager.

w = Toplevel (option)
Option- attribute of button widget.
  1. from tkinter import *  
  2. main = Tk()  
  3. t = Toplevel()  
  4. t.mainloop()  
 Option  Description
 bg It sets normal background color.
 bd It sets border width in pixels. Default is 2.
 cursorCursor is used to create cursor in widgets like arrow, circle, dot etc.
Normally, text selected within a text widget is exported to be the selection in the Window manager. Set exportselection=0, if you don't want that behavior.
 font  It is used to define a font of widgets
 fg It sets normal foreground (text) color of widgets.
 height It is used to define Window height.
 relief Relief is a special type of border. The values are SUNKEN, RAISED, GROOVE, and RIDGE.
 width It is used to define width of the Window.
In this chapter, you learnt what Toplevel widget is and how to use the property of the widget.
Next » Tkinter Widget-SpinBox