NAME
iwidgets::mainwindow - Create and manipulate a mainwindow widget
SYNOPSIS
iiwwiiddggeettss::::mmaaiinnwwiinnddooww pathName ?options? IINNHHEERRIITTAANNCCEEitk::Toplevel <- iwidgets::Shell <- iwidgets::Mainwindow
SSTTAANNDDAARRDD OOPPTTIIOONNSS bbaacckkggrroouunndd ccuurrssoorr ddiissaabblleeddFFoorreeggrroouunndd ffoonntt ffoorreeggrroouunndd hhiigghhlliigghhttBBaacckkggrroouunndd hhiigghhlliigghhttCCoolloorr hhiigghhlliigghhttTThhiicckknneessss See the "options" manual entry for details on the standard options. AASSSSOOCCIIAATTEEDD OOPPTTIIOONNSS bbaalllloooonnBBaacckkggrroouunndd bbaalllloooonnDDeellaayy11 bbaalllloooonnDDeellaayy22bbaalllloonnFFoonntt bbaalllloooonnFFoorreeggrroouunndd See the "toolbar" manual entry for details on the above associated options. IINNHHEERRIITTEEDD OOPPTTIIOONNSS ttiittllee See the "Toplevel" manual entry for details on the above inherited options. hheeiigghhtt mmaasstteerr mmooddaalliittyy ppaaddXX ppaaddYY wwiiddtthh See the "shell" manual entry for details on the above inherited options.WWIIDDGGEETT-SSPPEECCIIFFIICC OOPPTTIIOONNSS
Name: hheellppLLiinnee Class: HHeellppLLiinneeCommand-Line Switch: -hheellpplliinnee
Specifies whether or not to display the help line. The value may be given in any of the forms acceptable to TkGetBoolean. The default is yes. Name: mmeennuuBBaarrBBaacckkggrroouunndd Class: BBaacckkggrroouunnddCommand-Line Switch: -mmeennuubbaarrbbaacckkggrroouunndd
Specifies the normal background color for the menubar. Name: mmeennuuBBaarrFFoonntt Class: FFoonnttCommand-Line Switch: -mmeennuubbaarrffoonntt
Specifies the font to use when drawing text inside the menubar. Name: mmeennuuBBaarrFFoorreerroouunndd Class: FFoorreeggrroouunnddCommand-Line Switch: -mmeennuubbaarrffoorreeggrroouunndd
Specifies the normal foreground color for the menubar. Name: ssttaattuussLLiinnee Class: SSttaattuussLLiinneeCommand-Line Switch: -ssttaattuusslliinnee
Specifies whether or not to display the status line. The value may be given in any of the forms acceptable to TkGetBoolean. The default is yes. Name: ttoooollBBaarrBBaacckkggrroouunndd Class: BBaacckkggrroouunnddCommand-Line Switch: -ttoooollbbaarrbbaacckkggrroouunndd
Specifies the normal background color for the toolbar. Name: ttoooollBBaarrFFoonntt Class: FFoonnttCommand-Line Switch: -ttoooollbbaarrffoonntt
Specifies the font to use when drawing text inside the toolbar. Name: ttoooollBBaarrFFoorreerroouunndd Class: FFoorreeggrroouunnddCommand-Line Switch: -ttoooollbbaarrffoorreeggrroouunndd
Specifies the normal foreground color for the toolbar.DESCRIPTION
The iiwwiiddggeettss::::mmaaiinnwwiinnddooww command creates a mainwindow shell which con-
tains a menubar, toolbar, mousebar, childsite, status line, and help line. Each item may be filled and configured to suit individual needs. MMEETTHHOODDSS The iiwwiiddggeettss::::mmaaiinnwwiinnddooww 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: IINNHHEERRIITTEEDD MMEETTHHOODDSS aaccttiivvaattee cceenntteerr ddeeaaccttiivvaatteeSee the "shell" manual entry for details on the above inherited meth-
ods.WWIIDDGGEETT-SSPPEECCIIFFIICC MMEETTHHOODDSS
pathName ccggeett option Returns the current value of the configuration option given byoption. Option may have any of the values accepted by the iiwwiidd-
ggeettss::::mmaaiinnwwiinnddooww command. pathName cchhiillddssiittee Returns the pathname of the child site widget. pathName ccoonnffiigguurree ?option? ?value option value ...? Query or modify the configuration options of the widget. If nooption is specified, returns a list describing all of the avail-
able options for pathName (see TTkkCCoonnffiigguurreeIInnffoo 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 ormore 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 iiwwiiddggeettss::::mmaaiinnwwiinnddooww command. pathName mmeennuubbaarr ?args? The mmeennuubbaarr method provides access to the menubar. Invoked withno arguments it returns the pathname of the menubar. With argu-
ments, 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 mmoouusseebbaarr ?args? The mmoouusseebbaarr 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 mmssggdd ?args? The mmssggdd method provides access to the messagedialog contained in the mainwindow. Invoked with no arguments it returns thepathname of the messagedialog. With arguments, they are evalu-
ated 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 mes-
sagedialog. pathName ttoooollbbaarr ?args? The ttoooollbbaarr method provides access to the toolbar. Invoked withno arguments it returns the pathname of the toolbar. With argu-
ments, 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. CCOOMMPPOONNEENNTTSS Name: hheellpp Class: LLaabbeell The help component provides a location for displaying any help strings provided in the menubar, toolbar, or mousebar. See the "label" widget manual entry for details on the help component item. Name: mmeennuubbaarr Class: MMeennuubbaarr The menubar component is the menubar located at the top of the window. See the "menubar" widget manual entry for details on the menubar component item. Name: mmoouusseebbaarr Class: TToooollbbaarr The mousebar component is the vertical toolbar located on the right side of the window. See the "toolbar" widget manual entry for details on the mousebar component item. Name: mmssggdd Class: MMeessssaaggeeddiiaalloogg The msgd component is a messagedialog which may be reconfigured as needed and used repeatedly throughout the application. Seethe "messagedialog" widget manual entry for details on the mes-
sagedialog component item. Name: ssttaattuuss Class: LLaabbeellThe status component provides a location for displaying applica-
tion status information. See the "label" widget manual entry for details on the status component item. Name: ttoooollbbaarr Class: TToooollbbaarr The toolbar component is the horizontal toolbar located on the top of the window. See the "toolbar" widget manual entry for details on the toolbar component item. EEXXAAMMPPLLEE package require Iwidgets 4.0 iwidgets::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 sep1command close -label "Close" -underline 0 \
-helpstr "Close the file"
separator sep2command exit -label "Exit" -underline 1 \
-helpstr "Exit this application"
}#
# Install a scrolledtext widget in the childsite.
#
iwidgets::scrolledtext [.mw childsite].stpack [.mw childsite].st -fill both -expand yes
#
# Activate the main window.
#
.mw activate AUTHOR Mark L. Ulferts John A. Tucker KKEEYYWWOORRDDSS mainwindow, shell, widget Tk iwidgets::mainwindow(1)