1<TITLE>mainwindow - Create and manipulate a mainwindow widget</TITLE> 2<H1>mainwindow - Create and manipulate a mainwindow widget</H1> 3 4</pre><H2>SYNOPSIS</H2> 5<B>mainwindow<I> <I>pathName </I>?<I>options</I>? 6</pre><H2>INHERITANCE</H2> 7itk::Toplevel <- shell <- mainwindow 8</pre><H2>STANDARD OPTIONS</H2> 9<P> 10<table cellpadding=5> 11<td valign=top> 12<B>background</B><br> 13<B>foreground</B><br> 14</td> 15<td valign=top> 16<B>cursor</B><br> 17<B>highlightBackground</B><br> 18</td> 19<td valign=top> 20<B>disabledForeground</B><br> 21<B>highlightColor</B><br> 22</td> 23<td valign=top> 24<B>font</B><br> 25<B>highlightThickness</B><br> 26</td> 27</table> 28<P> 29See the <A HREF="http://www.sco.com/Technology/tcl/man/tk_man/options.n.html"> "options" </A> manual entry for details on the standard options. 30</pre><H2>ASSOCIATED OPTIONS</H2> 31<P> 32<table cellpadding=5> 33<td valign=top> 34<B>balloonBackground</B><br> 35<B>balloonForeground</B><br> 36</td> 37<td valign=top> 38<B>balloonDelay1</B><br> 39</td> 40<td valign=top> 41<B>balloonDelay2</B><br> 42</td> 43<td valign=top> 44<B>ballonFont</B><br> 45</td> 46</table> 47<P> 48See the "toolbar" manual entry for details on the above associated options. 49</pre><H2>INHERITED OPTIONS</H2> 50<P> 51<table cellpadding=5> 52<td valign=top> 53<B>title</B><br> 54</td> 55<td valign=top> 56</td> 57<td valign=top> 58</td> 59<td valign=top> 60</td> 61</table> 62<P> 63See the "Toplevel" manual entry for details on the above inherited options. 64<P> 65<table cellpadding=5> 66<td valign=top> 67<B>height</B><br> 68<B>padY</B><br> 69</td> 70<td valign=top> 71<B>master</B><br> 72<B>width</B><br> 73</td> 74<td valign=top> 75<B>modality</B><br> 76</td> 77<td valign=top> 78<B>padX</B><br> 79</td> 80</table> 81<P> 82See the "shell" manual entry for details on the above inherited options. 83 84</pre><H2>WIDGET-SPECIFIC OPTIONS</H2> 85<P> 86<pre> 87Name: <B>helpLine</B> 88Class: <B>HelpLine</B> 89Command-Line Switch: <B>-helpline</B> 90</pre> 91<UL> 92Specifies whether or not to display the help line. The value 93may be given in any of the forms acceptable to Tk_GetBoolean. 94The default is yes. 95</UL> 96<P> 97<pre> 98Name: <B>menuBarBackground</B> 99Class: <B>Background</B> 100Command-Line Switch: <B>-menubarbackground</B> 101</pre> 102<UL> 103Specifies the normal background color for the menubar. 104</UL> 105<P> 106<pre> 107Name: <B>menuBarFont</B> 108Class: <B>Font</B> 109Command-Line Switch: <B>-menubarfont</B> 110</pre> 111<UL> 112Specifies the font to use when drawing text inside the menubar. 113</UL> 114<P> 115<pre> 116Name: <B>menuBarForeround</B> 117Class: <B>Foreground</B> 118Command-Line Switch: <B>-menubarforeground</B> 119</pre> 120<UL> 121Specifies the normal foreground color for the menubar. 122</UL> 123<P> 124<pre> 125Name: <B>statusLine</B> 126Class: <B>StatusLine</B> 127Command-Line Switch: <B>-statusline</B> 128</pre> 129<UL> 130Specifies whether or not to display the status line. The value 131may be given in any of the forms acceptable to Tk_GetBoolean. 132The default is yes. 133</UL> 134<P> 135<pre> 136Name: <B>toolBarBackground</B> 137Class: <B>Background</B> 138Command-Line Switch: <B>-toolbarbackground</B> 139</pre> 140<UL> 141Specifies the normal background color for the toolbar. 142</UL> 143<P> 144<pre> 145Name: <B>toolBarFont</B> 146Class: <B>Font</B> 147Command-Line Switch: <B>-toolbarfont</B> 148</pre> 149<UL> 150Specifies the font to use when drawing text inside the toolbar. 151</UL> 152<P> 153<pre> 154Name: <B>toolBarForeround</B> 155Class: <B>Foreground</B> 156Command-Line Switch: <B>-toolbarforeground</B> 157</pre> 158<UL> 159Specifies the normal foreground color for the toolbar. 160</UL> 161</pre><HR> 162 163</pre><H2>DESCRIPTION</H2> 164<P> 165The <B>mainwindow</B> command creates a mainwindow shell which contains 166a menubar, toolbar, mousebar, childsite, status line, and help line. 167Each item may be filled and configured to suit individual needs. 168 169</pre><H2>METHODS</H2> 170<P> 171The <B>mainwindow</B> command create a new Tcl command whose 172name is <I>pathName</I>. This command may be used to invoke various 173operations on the widget. It has the following general form: 174<pre> 175<I>pathName option </I>?<I>arg arg ...</I>? 176</pre> 177<I>Option</I> and the <I>arg</I>s 178determine the exact behavior of the command. The following 179commands are possible for mainwindow widgets: 180</pre><H2>INHERITED METHODS</H2> 181<P> 182<table cellpadding=5> 183<td valign=top> 184<B>activate</B><br> 185</td> 186<td valign=top> 187<B>center</B><br> 188</td> 189<td valign=top> 190<B>deactivate</B><br> 191</td> 192<td valign=top> 193</td> 194</table> 195<P> 196See the "shell" manual entry for details on the above inherited methods. 197</pre><H2>WIDGET-SPECIFIC METHODS</H2> 198<DL> 199<DT> <I>pathName <B>cget</B> <I>option</I> 200</I></B> 201<DD> Returns the current value of the configuration option given 202by <I>option</I>. 203<I>Option</I> may have any of the values accepted by the <B>mainwindow</B> 204command. 205</DL> 206<DL> 207<DT> <I>pathName <B>childsite</B> 208</I></B> 209<DD> Returns the pathname of the child site widget. 210</DL> 211<DL> 212<DT> <I>pathName</I> <B>configure</B> ?<I>option</I>? ?<I>value option value ...</I>? 213</I></B> 214<DD> Query or modify the configuration options of the widget. 215If no <I>option</I> is specified, returns a list describing all of 216the available options for <I>pathName</I> (see <B>Tk_ConfigureInfo</B> for 217information on the format of this list). If <I>option</I> is specified 218with no <I>value</I>, then the command returns a list describing the 219one named option (this list will be identical to the corresponding 220sublist of the value returned if no <I>option</I> is specified). If 221one or more <I>option-value</I> pairs are specified, then the command 222modifies the given widget option(s) to have the given value(s); in 223this case the command returns an empty string. 224<I>Option</I> may have any of the values accepted by the <B>mainwindow</B> 225command. 226</DL> 227<DL> 228<DT> <I>pathName <B>menubar</B> ?<I>args</I>? 229</I></B> 230<DD> The <B>menubar</B> method provides access to the menubar. Invoked with 231no arguments it returns the pathname of the menubar. With arguments, 232they are evaluated against the menubar which in effect provides 233access to the entire API of the menubar. See the "menubar" manual 234entry for details on the commands available in the menubar. 235</DL> 236<DL> 237<DT> <I>pathName <B>mousebar</B> ?<I>args</I>? 238</I></B> 239<DD> The <B>mousebar</B> method provides access to the mousebar which is a 240vertical toolbar. Invoked with no arguments it returns the pathname 241of the mousebar. With arguments, they are evaluated against the mousebar 242which in effect provides access to the entire API of the underlying 243toolbar. See the "toolbar" manual entry for details on the commands 244available in the mousebar. 245</DL> 246<DL> 247<DT> <I>pathName <B>msgd</B> ?<I>args</I>? 248</I></B> 249<DD> The <B>msgd</B> method provides access to the messagedialog contained 250in the mainwindow. Invoked with no arguments it returns the pathname 251of the messagedialog. With arguments, they are evaluated against the 252messagedialog which in effect provides access to the entire API of the 253messagedialog. See the "messagedialog" manual 254entry for details on the commands available in the messagedialog. 255</DL> 256<DL> 257<DT> <I>pathName <B>toolbar</B> ?<I>args</I>? 258</I></B> 259<DD> The <B>toolbar</B> method provides access to the toolbar. Invoked with 260no arguments it returns the pathname of the toolbar. With arguments, 261they are evaluated against the toolbar which in effect provides 262access to the entire API of the toolbar. See the "toolbar" manual 263entry for details on the commands available in the toolbar. 264 265</DL> 266</pre><H2>COMPONENTS</H2> 267<P> 268<pre> 269Name: <B>help</B> 270Class: <B>Label</B> 271</pre> 272<UL> 273The help component provides a location for displaying any help 274strings provided in the menubar, toolbar, or mousebar. See the "label" 275widget manual entry for details on the help component item. 276</UL> 277<P> 278<pre> 279Name: <B>menubar</B> 280Class: <B>Menubar</B> 281</pre> 282<UL> 283The menubar component is the menubar located at the top of the window. 284See the "menubar" widget manual entry for details on the menubar 285component item. 286</UL> 287<P> 288<pre> 289Name: <B>mousebar</B> 290Class: <B>Toolbar</B> 291</pre> 292<UL> 293The mousebar component is the vertical toolbar located on the right side 294of the window. See the "toolbar" widget manual entry for details on 295the mousebar component item. 296</UL> 297<P> 298<pre> 299Name: <B>msgd</B> 300Class: <B>Messagedialog</B> 301</pre> 302<UL> 303The msgd component is a messagedialog which may be reconfigured as needed 304and used repeatedly throughout the application. See the "messagedialog" 305widget manual entry for details on the messagedialog component item. 306</UL> 307<P> 308<pre> 309Name: <B>status</B> 310Class: <B>Label</B> 311</pre> 312<UL> 313The status component provides a location for displaying application 314status information. See the "label" widget manual entry for details 315on the status component item. 316</UL> 317<P> 318<pre> 319Name: <B>toolbar</B> 320Class: <B>Toolbar</B> 321</pre> 322<UL> 323The toolbar component is the horizontal toolbar located on the top 324of the window. See the "toolbar" widget manual entry for details on 325the toolbar component item. 326</UL> 327</table> 328 329</pre><H2>EXAMPLE</H2> 330<pre> 331 mainwindow .mw 332 333 # 334 # Add a File menubutton 335 # 336 .mw menubar add menubutton file -text "File" -underline 0 -padx 8 -pady 2 \\ 337 -menu {options -tearoff no 338 command new -label "New" -underline 0 \\ 339 -helpstr "Create a new file" 340 command open -label "Open ..." -underline 0 \\ 341 -helpstr "Open an existing file" 342 command save -label "Save" -underline 0 \\ 343 -helpstr "Save the current file" 344 command saveas -label "Save As ..." -underline 5 \\ 345 -helpstr "Save the file as a differnet name" 346 command print -label "Print" -underline 0 \\ 347 -helpstr "Print the file" 348 separator sep1 349 command close -label "Close" -underline 0 \\ 350 -helpstr "Close the file" 351 separator sep2 352 command exit -label "Exit" -underline 1 \\ 353 -helpstr "Exit this application" 354 } 355 356 # 357 # Install a scrolledtext widget in the childsite. 358 # 359 scrolledtext [.mw childsite].st 360 pack [.mw childsite].st -fill both -expand yes 361 362 # 363 # Activate the main window. 364 # 365 .mw activate 366</pre> 367</pre><H2>AUTHORS</H2> 368Mark L. Ulferts 369<P> 370John A. Tucker 371<P> 372</pre><H2>KEYWORDS</H2> 373mainwindow, shell, widget 374