![]() |
ActiveTcl User Guide
|
![]() |
iwidgets::mainwindow - Create and manipulate a mainwindow widget
iwidgets::mainwindow pathName ?options?
itk::Toplevel <- iwidgets::Shell <- iwidgets::Mainwindow
background cursor disabledForeground font foreground highlightBackground highlightColor highlightThickness
options.
ated options.
title
ited options.
height master modality padX
options.
be given in any of the forms acceptable to Tk_GetBoolean. The
default is yes.
may be given in any of the forms acceptable to Tk_GetBoolean.
_________________________________________________________________
contains a menubar, toolbar, mousebar, childsite, status line, and help line. Each item may be filled and configured to suit individual needs.
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 ...?
activate center deactivate
methods.
pathName cget option
option. Option may have any of the values accepted
by the iwid- gets::mainwindow command.
pathName childsite
pathName configure ?option? ?value option value ...?
option is specified, returns a list describing all of the
avail- able 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 iwidgets::mainwindow command.
pathName menubar ?args?
no 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 mousebar ?args?
vertical toolbar. Invoked with no arguments it returns the path-
name 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 mainwindow. Invoked with no arguments it returns the path-
name 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?
no 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 «tool- bar» manual entry for details on the commands available in the toolbar.
strings provided in the menubar, toolbar, or mousebar. See the
«label» widget manual entry for details on the help
component item.
window. See the «menubar» widget manual entry for
details on the menubar component item.
right side of the window. See the «toolbar» widget
manual entry for details on the mousebar component item.
as needed and used repeatedly throughout the application. See
the «messagedialog» widget manual entry for details on
the mes- sagedialog component item.
tion status information. See the «label» widget
manual entry for details on the status component item.
top of the window. See the «toolbar» widget manual entry for details on the toolbar component item.
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 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. #
iwidgets::scrolledtext [.mw childsite].st
pack [.mw childsite].st -fill both -expand yes
#
# Activate the main window.
#
.mw activate
mainwindow, shell, widget