Creating an additional window

As you have seen simply invoking the wish shell automatically creates a window for our needs. However, many programs require the creation of secondary windows. To assist us in this process Tcl has provided the toplevel command. The toplevel command accepts several options as listed next:

Standard options:

  • -borderwidth or -bd: Specifies a non-negative value indicating the width of the 3D border to draw around the outside of the window
  • -cursor: Specifies the mouse cursor to be used for the window
  • -highlightbackground: Specifies the color to display in the traversal highlight region when the window does not have the input focus
  • -highlightcolor: Specifies the color to use for the traversal highlight rectangle that is drawn ...

Get Tcl/Tk 8.5 Programming Cookbook now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.