mainwindow - Create and manipulate a mainwindow widget

SYNOPSIS

mainwindow pathName ?options?

INHERITANCE

itk::Toplevel <- shell <- mainwindow

STANDARD OPTIONS

background
foreground
cursor
highlightBackground
disabledForeground
highlightColor
font
highlightThickness

See the "options" manual entry for details on the standard options.

ASSOCIATED OPTIONS

balloonBackground
balloonForeground
balloonDelay1
balloonDelay2
ballonFont

See the "toolbar" manual entry for details on the above associated options.

INHERITED OPTIONS

title

See the "Toplevel" manual entry for details on the above inherited options.

height
padY
master
width
modality
padX

See the "shell" manual entry for details on the above inherited options.

WIDGET-SPECIFIC OPTIONS

Name:                   helpLine
Class:                  HelpLine
Command-Line Switch:	-helpline

Name:                   menuBarBackground
Class:                  Background
Command-Line Switch:	-menubarbackground

Name:                   menuBarFont
Class:                  Font
Command-Line Switch:	-menubarfont

Name:                   menuBarForeround
Class:                  Foreground
Command-Line Switch:	-menubarforeground

Name:                   statusLine
Class:                  StatusLine
Command-Line Switch:	-statusline

Name:                   toolBarBackground
Class:                  Background
Command-Line Switch:	-toolbarbackground

Name:                   toolBarFont
Class:                  Font
Command-Line Switch:	-toolbarfont

Name:                   toolBarForeround
Class:                  Foreground
Command-Line Switch:	-toolbarforeground

DESCRIPTION

The mainwindow command creates a mainwindow shell which contains a menubar, toolbar, mousebar, childsite, status line, and help line. Each item may be filled and configured to suit individual needs.

METHODS

The mainwindow command create a new Tcl command whose name is pathName. This command may be used to invoke various operations on the widget. It has the following general form:

pathName option ?arg arg ...?
Option and the args determine the exact behavior of the command. The following commands are possible for mainwindow widgets:

INHERITED METHODS

activate
center
deactivate

See the "shell" manual entry for details on the above inherited methods.

WIDGET-SPECIFIC METHODS

pathName cget option
Returns the current value of the configuration option given by option. Option may have any of the values accepted by the mainwindow command.
pathName childsite
Returns the pathname of the child site widget.
pathName configure ?option? ?value option value ...?
Query or modify the configuration options of the widget. If no option is specified, returns a list describing all of the available options for pathName (see Tk_ConfigureInfo for information on the format of this list). If option is specified with no value, then the command returns a list describing the one named option (this list will be identical to the corresponding sublist of the value returned if no option is specified). If one or more option-value pairs are specified, then the command modifies the given widget option(s) to have the given value(s); in this case the command returns an empty string. Option may have any of the values accepted by the mainwindow command.
pathName menubar ?args?
The menubar method provides access to the menubar. Invoked with no arguments it returns the pathname of the menubar. With arguments, they are evaluated against the menubar which in effect provides access to the entire API of the menubar. See the "menubar" manual entry for details on the commands available in the menubar.
pathName mousebar ?args?
The mousebar method provides access to the mousebar which is a vertical toolbar. Invoked with no arguments it returns the pathname of the mousebar. With arguments, they are evaluated against the mousebar which in effect provides access to the entire API of the underlying toolbar. See the "toolbar" manual entry for details on the commands available in the mousebar.
pathName msgd ?args?
The msgd method provides access to the messagedialog contained in the mainwindow. Invoked with no arguments it returns the pathname of the messagedialog. With arguments, they are evaluated against the messagedialog which in effect provides access to the entire API of the messagedialog. See the "messagedialog" manual entry for details on the commands available in the messagedialog.
pathName toolbar ?args?
The toolbar method provides access to the toolbar. Invoked with no arguments it returns the pathname of the toolbar. With arguments, they are evaluated against the toolbar which in effect provides access to the entire API of the toolbar. See the "toolbar" manual entry for details on the commands available in the toolbar.

COMPONENTS

Name:                   help
Class:                  Label

Name:                   menubar
Class:                  Menubar

Name:                   mousebar
Class:                  Toolbar

Name:                   msgd
Class:                  Messagedialog

Name:                   status
Class:                  Label

Name:                   toolbar
Class:                  Toolbar

EXAMPLE

 mainwindow .mw

 #
 # Add a File menubutton
 #
 .mw menubar add menubutton file -text "File" -underline 0 -padx 8 -pady 2 \\
    -menu {options -tearoff no
	   command new -label "New" -underline 0 \\
	       -helpstr "Create a new file"
	   command open -label "Open ..." -underline 0 \\
	       -helpstr "Open an existing file"
	   command save -label "Save" -underline 0 \\
	       -helpstr "Save the current file"
	   command saveas -label "Save As ..." -underline 5 \\
	       -helpstr "Save the file as a differnet name"
	   command print -label "Print" -underline 0 \\
	       -helpstr "Print the file"
           separator sep1
	   command close -label "Close" -underline 0 \\
	       -helpstr "Close the file"
	   separator sep2
	   command exit -label "Exit" -underline 1 \\
	       -helpstr "Exit this application" 
    }

 #
 # Install a scrolledtext widget in the childsite.
 #
 scrolledtext [.mw childsite].st
 pack [.mw childsite].st -fill both -expand yes

 #
 # Activate the main window.
 #
 .mw activate

AUTHOR

Mark L. Ulferts John A. Tucker

KEYWORDS

mainwindow, shell, widget