1iwidgets::mainwindow − Create and manipulate a mainwindow widget
3gets::Shell <‐ iwidgets::Mainwindow
6See the "options" manual entry for details on the standard op‐
7tions.
10See the "toolbar" manual entry for details on the above associat‐
11ed options.
13See the "Toplevel" manual entry for details on the above inherit‐
14ed options.
17See the "shell" manual entry for details on the above inherited
18options.
19
20Name: helpLine
21Class: HelpLine
22Command‐Line Switch: ‐helpline
23Specifies whether or not to display the help line. The value may
24be given in any of the forms acceptable to Tk_GetBoolean. The
25default is yes.
26Name: menuBarBackground
27Class: Background
28Command‐Line Switch: ‐menubarbackground
29Specifies the normal background color for the menubar.
30Name: menuBarFont
31Class: Font
32Command‐Line Switch: ‐menubarfont
33Specifies the font to use when drawing text inside the menubar.
34Name: menuBarForeround
35Class: Foreground
36Command‐Line Switch: ‐menubarforeground
37Specifies the normal foreground color for the menubar.
38Name: statusLine
39Class: StatusLine
40Command‐Line Switch: ‐statusline
41Specifies whether or not to display the status line. The value
42may be given in any of the forms acceptable to Tk_GetBoolean.
43The default is yes.
44Name: toolBarBackground
45Class: Background
46Command‐Line Switch: ‐toolbarbackground
47Specifies the normal background color for the toolbar.
48Name: toolBarFont
49Class: Font
50Command‐Line Switch: ‐toolbarfont
51Specifies the font to use when drawing text inside the toolbar.
52Name: toolBarForeround
53Class: Foreground
54Command‐Line Switch: ‐toolbarforeground
55Specifies the normal foreground color for the toolbar.
56
57The iwidgets::mainwindow command creates a mainwindow shell which
58contains a menubar, toolbar, mousebar, childsite, status line,
59and help line. Each item may be filled and configured to suit
60individual needs.
61
62The iwidgets::mainwindow command create a new Tcl command whose
63name is pathName. This command may be used to invoke various op‐
64erations on the widget. It has the following general form: path‐
66act behavior of the command. The following commands are possible
67for mainwindow widgets:
69See the "shell" manual entry for details on the above inherited
70methods. pathName cget option Returns the current value of the
71configuration option given by option. Option may have any of the
72values accepted by the iwidgets::mainwindow command. pathName
75the configuration options of the widget. If no option is speci‐
76fied, returns a list describing all of the available options for
78this list). If option is specified with no value, then the com‐
79mand returns a list describing the one named option (this list
80will be identical to the corresponding sublist of the value re‐
81turned if no option is specified). If one or more option−value
82pairs are specified, then the command modifies the given widget
83option(s) to have the given value(s); in this case the command
84returns an empty string. Option may have any of the values ac‐
85cepted by the iwidgets::mainwindow command. pathName menubar
86?args? The menubar method provides access to the menubar. In‐
87voked with no arguments it returns the pathname of the menubar.
88With arguments, they are evaluated against the menubar which in
89effect provides access to the entire API of the menubar. See the
90"menubar" manual entry for details on the commands available in
91the menubar. pathName mousebar ?args? The mousebar method pro‐
92vides access to the mousebar which is a vertical toolbar. In‐
93voked with no arguments it returns the pathname of the mousebar.
94With arguments, they are evaluated against the mousebar which in
95effect provides access to the entire API of the underlying tool‐
96bar. See the "toolbar" manual entry for details on the commands
97available in the mousebar. pathName msgd ?args? The msgd method
98provides access to the messagedialog contained in the mainwindow.
99Invoked with no arguments it returns the pathname of the message‐
100dialog. With arguments, they are evaluated against the message‐
101dialog which in effect provides access to the entire API of the
102messagedialog. See the "messagedialog" manual entry for details
103on the commands available in the messagedialog. pathName toolbar
104?args? The toolbar method provides access to the toolbar. In‐
105voked with no arguments it returns the pathname of the toolbar.
106With arguments, they are evaluated against the toolbar which in
107effect provides access to the entire API of the toolbar. See the
108"toolbar" manual entry for details on the commands available in
109the toolbar.
110
111Name: help
112Class: Label
113The help component provides a location for displaying any help
114strings provided in the menubar, toolbar, or mousebar. See the
115"label" widget manual entry for details on the help component
116item.
117Name: menubar
118Class: Menubar
119The menubar component is the menubar located at the top of the
120window. See the "menubar" widget manual entry for details on the
121menubar component item.
122Name: mousebar
123Class: Toolbar
124The mousebar component is the vertical toolbar located on the
125right side of the window. See the "toolbar" widget manual entry
126for details on the mousebar component item.
127Name: msgd
128Class: Messagedialog
129The msgd component is a messagedialog which may be reconfigured
130as needed and used repeatedly throughout the application. See
131the "messagedialog" widget manual entry for details on the mes‐
132sagedialog component item.
133Name: status
134Class: Label
135The status component provides a location for displaying applica‐
136tion status information. See the "label" widget manual entry for
137details on the status component item.
138Name: toolbar
139Class: Toolbar
140The toolbar component is the horizontal toolbar located on the
141top of the window. See the "toolbar" widget manual entry for de‐
142tails on the toolbar component item.
143
144 package require Iwidgets 4.0
145 iwidgets::mainwindow .mw
146
147 #
148 # Add a File menubutton
149 #
150 .mw menubar add menubutton file ‐text "File" ‐underline 0 ‐padx
1518 ‐pady 2 \
152 ‐menu {options ‐tearoff no command new
153‐label "New" ‐underline 0 \ ‐helpstr "Cre‐
154ate a new file" command open ‐label "Open ..."
155‐underline 0 \ ‐helpstr "Open an existing
156file" command save ‐label "Save" ‐underline 0
157\ ‐helpstr "Save the current file"
158 command saveas ‐label "Save As ..." ‐underline
1595 \ ‐helpstr "Save the file as a differnet
160name" command print ‐label "Print" ‐underline
1610 \ ‐helpstr "Print the file"
162 separator sep1 command close ‐label
163"Close" ‐underline 0 \ ‐helpstr "Close the
164file" separator sep2 com‐
165mand exit ‐label "Exit" ‐underline 1 \
166‐helpstr "Exit this application"
167 }
168
169 #
170 # Install a scrolledtext widget in the childsite.
171 #
172 iwidgets::scrolledtext [.mw childsite].st
173 pack [.mw childsite].st ‐fill both ‐expand yes
174
175 #
176 # Activate the main window.
177 #
178 .mw activate Mark L. Ulferts John A. Tucker mainwindow, shell,
179widget
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198