activeBackground activeForeground background borderWidth |
command font relief takeFocus |
See the "options" manual entry for details on the standard options.
Name: backDrop
Class: BackDrop
Command-Line Switch: -backdrop
Name: clientRelief
Class: ClientRelief
Command-Line Switch: -clientrelief
Name: inactiveBackground
Class: InactiveBackground
Command-Line Switch: -inactivebackground
Name: inactiveForeground
Class: InactiveForeground
Command-Line Switch: -inactiveforeground
Name: minheight
Class: Height
Command-Line Switch: -minheight
Name: minwidth
Class: Width
Command-Line Switch: -minwidth
The mdiframe command creates a widget which is a framed area that manages
multiple sub windows. MDI stands for Multiple Document Interface. Each
subwindow, or client, is created by calling the client method. This
method returns the pathname to a childsite within the window. The user
can then install any widget within the childsite; typically this is a scrolled
textwidget. The mdiframe will manage the windows much like the window manager
does on your desktop. Currently the mdiclient
command creates a decorating frame that is similar to Windows 9x windows,
however, it should be possible to derive a new class from Mdiclient that provides a different decoration.
This work is derived from the Mysund_MDI
implementation written by Jesper
Svensson.
The mdiframe command creates 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 button widgets:
Make client window name the activate window.
Returns the current value of the configuration option given by option. Option may have any of the values accepted by the mdiframe command.
- Returns the pathame of the childsite within the client window name.
- This method creates a new client window name. A number of options may be specified. These options are passed to the mdiclient command used to construct the client window. Optionally, the option "-class clientclass" may be specified. This will cause the client method to use the command clientclass in place of mdiclient to construct the client. The class clientclass must be derived from mdiclient. This can be done to provide different decorations or behavior for the client windows. This method returns the pathname to the client's childsite (not the client itself), unless the -class option is specified in which case the pathname the client window is returned.
- This method will close and destroy the client window name.
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 mdiframe command.pathName geometry name ?args...?
This method will return the geometry of the client window name, or if an optional geometry is specified, will set the client window name to the given geometry.pathName getcurrent
This method will return the name of the currently active client window. If no client is currently active, an empty string will be returned.pathName lastcurrent
This method will return the name of the currently active client window. If no client is currently active, it will return the name of the last client window that was active. If there are no client windows, then an empty string is returned.pathName layout what
This method will rearrange all the client windows according to the what argument, where what may be one of cascade, horizontal, or vertical. If the current client window is maximized, it will first be returned to a normal state before performing the layout.pathName maxclient name
This method will maximize the client window. A maximized window will take over the area of the mdiframe as if it is the sole window.pathName minclient name
This method will minimize the client window. The window is reduced to a simple fixed size title bar.pathName normclient name
This method will return a client window to its original size an location from either the maximized or minimized state.pathName setcurrent name
This method will make the client window name the currently active window.pathName status name
This method will return the current state of client window name, which is one of normal, minimized, or maximized.pathName makeResizeCorner cornerPathname client
This method is used by the mdiclient widget to build a small box widget which is typically placed in the lower right corner of the client window. This widget allows easier resize and move operations of the client window. The client cannot do this internally since the mdiframe handles these operations.
Name: client Class: Mdiclient
package require Mtiwidgets
mtiwidgets::mdiframe .mdi -borderwidth 2 -relief sunken
pack .mdi -side top -fill both -expand 1
.mdi client 0 -title "Example Code"
set cs [.mdi childsite 0]
iwidgets::scrolledtext $cs.st -hscrollmode dynamic -vscrollmode dynamic -wrap none
pack $cs.st -side top -expand 1 -fill both
set f1 [open [file join ${::mtiwidgets::library} demos mdiframe]]
$cs.st insert insert [read $f1]
close $f1
.mdi client 1 -title "MDI Source Code"
set cs [.mdi childsite 1]
iwidgets::scrolledtext $cs.st -hscrollmode dynamic -vscrollmode dynamic -wrap none
pack $cs.st -side top -expand 1 -fill both
set f1 [open [file join ${::mtiwidgets::library} scripts mdi.itk]]
$cs.st insert insert [read $f1]
close $f1