Tornado API Reference : GUI Tcl Library (WINDOWS)
UITcl Library [win32] - UITcl Library
systemColorsEnumerate - enumerates pre-defined system colors
helpLaunch - start winhelp using a specified file, ID, mode, and so forth
applicationTitleSet - sets the title of the application
applicationReturnCodeSet - sets the return code for the application
applicationRegistryPathSet - sets the path where the persistent state of this application should be saved
averageCharSizeGet - retrieves the average character size of a window
dialogUnitsToPixels - conversion routine
pixelsToDialogUnits - conversion routine
mainWindowCreate - Creates a main window for the application
dialogCreate - Creates a dialog
toolbarCreate - create a toolbar on a window
windowCreate - creates a child window
fileDialogCreate - create a standard file browser dialog
dirBrowseDialogCreate - create a standard directory browser dialog
windowClientSizeGet - retrieves the size of the client area of a dialog or window
windowSizeSet - sets the size of a dialog or window
windowPositionSet - sets the position of a dialog or window
windowSizeGet - retrieves the size of a dialog or window
windowPositionGet - retrieves the position of a dialog or window
windowSizeCallbackSet - sets the Tcl script to be called when a dialog or window has been resized
windowSizeCallbackGet - returns the script called when the user or system resizes the dialog or window
windowActivateCallbackSet - sets the Tcl script to be called when a dialog or window is activated
windowActivateCallbackGet - returns the script called when the window or dialog is activated
windowInitCallbackSet - sets the Tcl script called when a dialog or window is initialized
windowInitCallbackGet - returns the script called when the dialog or window is initialized
windowShowCallbackSet - sets the Tcl script called when a dialog or window is displayed
windowShowCallbackGet - returns the script called when the dialog or window is displayed
windowExitCallbackSet - sets the Tcl script called when a dialog or window is exited
windowExitCallbackGet - returns the script called when the user or system exits the dialog or window
windowQueryCloseCallbackSet - sets the Tcl script to be called when closing a dialog or window
windowQueryCloseCallbackGet - returns the script called to determine whether the dialog or window can be closed safely
windowHidden - determines whether a particular UITcl window or dialog is hidden
windowVisible - determines whether a particular UITcl window or dialog is visible on the screen
windowHide - hides or shows a Tcl window, dialog, or toolbar
windowShow - shows or hides a Tcl window, dialog, or toolbar
windowActiveGet - gets the name of the currently active Tcl window, dialog, or toolbar
windowActiveSet - sets the named Tcl window as the active window
windowTitleSet - sets the title of a dialog or window
windowTitleGet - gets the title of a dialog or window
windowHandleGet - gets the internal Windows handle of a dialog or window
windowEventGet - returns the most recent event that has occured in a dialog or window
windowHelpFileSet - sets the help file to be used for the named dialog or window
windowHelpFileGet - gets the path of help file.
windowHelpIDSet - sets the help ID and (optionally) the help file to be used for named dialog or window
windowHelpIDGet - gets the help ID of the window
windowPropertySet - sets the value of a property
autoTimerCallbackSet - see windowTimerCallbackSet
windowTimerCallbackSet - sets or removes the timer script for the given dialog or window
autoTimerCallbackGet - see windowTimerCallbackGet
windowTimerCallbackGet - returns the timer script for the given dialog or window
windowClose - closes a dialog or window
allControlsDestroy - destroys all the controls in a dialog or window
windowExists - determines whether a particular window exists
controlEventGet - returns the most recent event that has occured on a control
controlHandleGet - returns the handle of a tcl control
controlPositionSet - sets the position of a control in a dialog or window
controlPositionGet - retrieves the position of a control
controlSizeSet - sets the size of a control in a dialog or window
controlSizeGet - retrieves the size of a control in a dialog or window
controlHelpIDSet - sets the help ID to be used for the named control in a dialog or window
controlHide - hides or shows a control in a dialog or window
controlHidden - retrieves the hidden state of a control in a dialog or window
controlEnable - enables or disables a control in a dialog or window
controlEnabled - retrieves the enabled state of a control in a dialog or window
controlExists - determines whether a particular control exists in a dialog or window
controlFocusSet - sets focus to a control in a dialog or window
controlCallbackSet - sets a Tcl script to process events for a control in a dialog or window
controlCallbackGet - retrieves the Tcl script (if any) established to process events for a control
controlContextMenuShow - show the specified context menu.
controlLockUpdate - locks the updating of the control.
controlUnlockUpdate - Unlocks all the updates on the control.
controlParentSet - sets the specifed window as the parent of the control.
controlValuesSet - sets the data or text of a control
controlValuesGet - retrieves values of controls
controlStructureSet - sets the structure of a hierarchy (tree) control
controlPropertySet - allows to configure the control properties
controlPropertyGet - returns the value of the specified property of a control.
controlCheckSet - checks a control in a window or dialog
controlChecked - retrieves the check state of a control in a window or dialog
controlSelectionSet - sets the selection in a control in a dialog or window
controlSelectionGet - gets the selection in a control in a dialog or window
controlExpandingItemGet - gets information about the currently expanding item of a treelist control.
controlItemDelete - delete the specified item in a control.
controlItemInsert - inserts the provided item into the control.
controlTabsAdd - add the strings as new tabs in a tab control.
controlItemPropertySet - sets the value of the specified property.
controlItemPropertyGet - gets the property of an item in a control
controlTextInsert - inserts the text into a text control.
controlCreate - creates a control in a Tcl window, dialog, or toolbar
controlDestroy - destroys a control in a dialog or window
UITcl API library
systemColorsEnumerate - enumerates pre-defined system colors
Tcl Windows GUI
systemColorsEnumerate
This function lists the pre-defined colors available for use in in controlColorsSet.
N/A
A list containing all the system colors.
N/A
helpLaunch - start winhelp using a specified file, ID, mode, and so forth
Tcl Windows GUI
helpLaunch mode helpfile context [2ndaryWindowName]
This function displays the topic associated with context in the specified help file. It is displayed in either the specified help window, the main help window, or a popup help window. context is interpreted according to mode.
mode defines how context is interpreted. It can have the following values:
- context
- interprets context as an ID to identify the topic
- contextpopup
- interprets context as an ID to identify the topic and displays it in a popup window; 2ndaryWindowName is not used.
- keyword
- interprets context as a keyword identifying the topic; 2ndaryWindowName is not used.
- index
- provides a help index. context must be an empty string.
- search
- provides partial keyword search (search for help on...). context is a keyword, or an empty string to show the user a list of keywords.
helpfile specifies the fully qualified path to the help file.
context can be a numeric, a keyword, or an empty string depending on the value of mode.
2ndaryWindowName is the name of a secondary window specified in the WINDOWS section of the help file project. It is only used when mode is context and it places the topic in this window instead of main.
applicationTitleSet - sets the title of the application
Tcl Windows GUI
applicationTitleSet title
This function sets the title of the application that will be subsequently used
as the title for message boxes, etc.
- title
- specifies the caption string.
N/A
applicationReturnCodeSet - sets the return code for the application
Tcl Windows GUI
applicationReturnCodeSet returnCode
This function sets the return code that the application returns when it exits.
- returnCode
- specifies the integer return code.
N/A
applicationRegistryPathSet - sets the path where the persistent state of this application should be saved
Tcl Windows GUI
applicationRegistryPathSet registryPath
sets the path where the persistent state of the objects in the application will be used. This needs to be set before any windows are created so that their persistent state can be retrived. The registry key is usually the name of a company. It is stored in a key of the following form:
<company name>\<app name>\<sec name>\<value name>.
- registryPath
- specifies the registry path
N/A
averageCharSizeGet - retrieves the average character size of a window
Tcl Windows GUI
averageCharSizeGet [-title] windowName
This function returns the width and height of the window, typically useful in calculating the sizes of controls that reside on the window client area. The width and height returned are in dialog units, the units that are device independent.
- windowName
- specifies the name or title of the window
- -title
- causes windowName to be interpreted as the title of the window.
the width and height of a character as a list.
- unable to locate window window
UITcl Library, dialogUnitsToPixels, pixelsToDialogUnits
dialogUnitsToPixels - conversion routine
Tcl Windows GUI
averageCharSizeGet [-title] windowName
This function converts the given point (or size) from dialog units to pixels. Dialog Units are used to represent the size and position of a window if those positions need to be device independent.
- -title
- causes windowName to be interpreted as the title of the window.
- windowName
- specifies the name or title of the window
- -size
- causes points to be interpreted as a size and not as a position
the converted units.
- unable to locate window window
UITcl Library, averageCharSize, pixelsToDialogUnits
pixelsToDialogUnits - conversion routine
Tcl Windows GUI
averageCharSizeGet [-title] windowName
This function converts the given point (or size) from pixels to dialog units. Dialog Units are used to represent the size and position of a window if those positions need to be device independent.
- -title
- causes windowName to be interpreted as the title of the window.
- windowName
- specifies the name or title of the window
- -size
- causes points to be interpreted as a size and not as a position
the converted units.
- unable to locate window window
UITcl Library, averageCharSize, dialogUnitsToPixels
mainWindowCreate - Creates a main window for the application
Tcl Windows GUI
Use this function to create an MSDI or an MDI main window. Every non-dialog based application should have a main window. Depending on whether -msdi flag is used, any windows subsequently created stay inside main window's client area or can stay outside of the main window's client area. Also all the child windows created after the main window are closed when the main window is closed.
mainWindowCreate [-callback callbackProcedureOrScript] [-exec procedureOrScript] [-exit exitProcedureOrScript] [-h|eight integer] [-helpfile helpFilePath] [-helpID uniqueIntegerID] [-icon iconFilePath] [-init initProcedureOrScript] [-maximize] [-menu] [-minimize] [-msdi] [-name uniqueName] [-statusbar] [-title captionString] [-toolbar] [-w|idth integer] [-x|pos integer] [-y|pos integer]
- -callback callbackProcedureOrScript
- specifies that the Tcl script callback procedure or script should be called whenever an event occurs on this window such as sizing, initialization, etc. If this flag is used, -init, -exit or -exec are ignored.
- -exec procedureOrScript
- specifies procedure or script to be evaluated after the main window is created and initialized.
- -exit exitProcedureOrScript
- specifies that the Tcl script exitProcedureOrScript should be called when the window is exiting, after it is erased from the screen. Use it to free any resources.
- -helpfile helpFilePath
- provides a separate help file for the window's help. If not provided, the application's help file is used for context-sensitive help.
- -helpID uniqueIntegerID
- provides an ID associated with the window for context-sensitive help. It references a topic in helpFilePath or the application's help file if -helpfile isn't specified.
- -icon iconFilePath
- icon used to display when this main window is minimized.
- -init initProcedureOrScript
- specifies that the Tcl script initProcedureOrScript is called when the window is initialized, after the controls are instantiated but before the window is drawn for the user. For information on the specification of controls, see controlCreate and Introduction: DIALOGS, WINDOWS AND CONTROLS.
- -maximize
- if this flag is specified, the window is created as a maximized window. A maximized window occupies the whole desktop area.
- -menu
- if this flag is not specified, no default menu is created as part of window creation. A menu can be associated with this window at a later time by using windowMenuSet.
- -minimize
- if this flag is specified, the window is created as a minimized window. A minimized window is the same size as an icon. Windows displays a minimized main window at the bottom of the screen.
- -msdi
- specifies that the window should be an msdi main window. An MSDI main window can have controls in its client area. Any windows created using windowCreate stay outside the client area of the main window unlike the non-MSDI window or an MDI main window.
- -name uniqueName
- uses uniqueName as the name of the window for future reference. Most of the UITcl API require a window name when a property of the window needs to be changed or queried about.
- -statusbar
- if this flag is not specified, no default toolbar is created as part of window creation
- -title captionString
- specifies the title for the window.
- -toolbar
- if this flag is not specified, no default toolbar is created as part of window creation. A toolbar can be associated with this window at a later time by using toolbarCreate.
- -x|pos integer, -y|pos integer, -w|idth integer, and -h|eight integer
- specify the position and size for the new window in dialog units. If omitted, they are given default values.
UITcl Library, DIALOGS, WINDOWS, AND CONTROLS Tcl Windows GUI
dialogCreate - Creates a dialog
Tcl Windows GUI
The named dialog is created and displayed. Both modal and modeless dialogs can be created using this command. A modal dialog does not allow access to its parent window but allows access to its child windows. A modeless dialog stays on top of all windows but does allow access to its parent.
dialogCreate [-callback callbackProcedureOrScript] [-c|ontrols listOfControls] [-exit exitProcedureOrScript] [-h|eight integer] [-helpfile helpFilePath] [-helpID uniqueIntegerID] [-icon filePath] [-init initProcedureOrScript] [-keepontop] [-maxibox] [-minibox] [-modeless] [-name uniqueName] [-nocontexthelp] [-noframe] [-notitle] [-parent] [-sizingframe] [-thickframe] [-thinframe] [-title captionString] [-titleframe] [-w|idth integer] [-x|pos integer] [-y|pos integer]
- -callback callbackProcedureOrScript
- specifies that the Tcl script callback procedure or script should be called whenever an event occurs on this window such as sizing, initialization, etc. If this flag is used, -init and -exit are ignored.
- -c|ontrols controlsDefinition
- specifies a list of controls that is instantiated before the dialog is shown.
- -exit exitProcedureOrScript
- specifies that the Tcl script exitProcedureOrScript should be called when the dialog is exiting, after it is erased from the screen. Use it to free any resources.
- -helpfile helpFilePath
- provides a separate help file for the window's help. If not provided, the application's help file is used for context-sensitive help.
- -helpID uniqueIntegerID
- provides an ID associated with the dialog for context-sensitive help. It references a topic in helpFilePath or the application's help file if -helpfile isn't specified.
- -icon iconFilePath
- icon used to display when this main window is minimized.
- -init initProcedureOrScript
- specifies that the Tcl script initProcedureOrScript is called when the dialog is initialized, after the controls are instantiated but before the window is drawn for the user. For information on the specification of controls, see controlCreate and Introduction: DIALOGS, WINDOWS AND CONTROLS.
- -keepontop
- keeps the dialog on top of all other dialogs. Every dialog that uses this option is drawn on the top over the other top windows. So, the dialog that uses this option last remains as top window.
- -maxibox
- draws a button on top right corner of the window that allows the dialog to be maximized (occupies the whole desktop area).
- -minibox
- draws a button on top right corner of the window that allows the dialog to be iconized.
- -modeless
- creates a modeless dialog box. A modeless dialog allows access to other windows in the application.
- -name uniqueName
- uses uniqueName as the name of the dialog for future reference. Most of the UITcl API require a window name when a property of the window needs to be changed or queried about.
- -nocontexthelp
- does not draw the ? on the top right corner that can be used to get context help.
- -noframe
- does not draw a frame around the dialog's disply area.
- -notitle
- draws a frame around the dialog's display area without the caption bar.
- -parent tclWindow
- uses specified tclWindow as the parent window of the dialog box
- -sizingframe
- draws a thick frame around the dialog's display area with a title on the top. It also allows the dialog to be resized.s
- -thinframe
- draws a thin frame around the dialog's display area.
- -thickframe
- draws a thick frame around the dialog's display area.
- -title captionString
- specifies the title for the dialog.
- -titleframe
- draws a frame around the dialog's display area with a title on the top.
- -x|pos integer, -y|pos integer, -w|idth integer, and -h|eight integer
- specify the position and size for the new dialog in dialog units. If omitted, they are given default values.
N/A
- unable to create dialog
UITcl Library, windowTitleSet, windowClose, controlCreate
The Tornado target server management dialog looks something like this:
dialogCreate -name targetServerManage -title "Manage Target Servers" \ -w 218 -height 235 -init targetServerManageInit \ -controls { \ {label -title "&Targets:" -name lbl1 -x 9 -y 9 -w 32 -h 9} \ {combo -name targetManage_targets -callback on_tm_targets \ -x 40 -y 7 -w 148 -h 67} \ {label -name lbl2 -title "Target &Information" -x 9 -y 25 \ -w 72 -h 9} \ {text -fixed -readonly -vscroll -multiline \ -name targetManage_tsInfo -x 9 -y 38 -w 200 -h 150} \ {label -title "Select &Action:" -name lbl1 \ -x 30 -y 197 -w 49 -h 9} \ {combo -name targetManage_combo_action \ -callback on_targetManage_combo_action \ -x 80 -y 195 -w 100 -h 67} \ {button -default -callback on_targetManage_apply \ -title "Apply" -name applyButton \ -x 7 -y 215 -w 50 -h 14} \ {button -callback on_targetManage_close -title "Close" \ -name tm_closeButton \ -x 64 -y 215 -w 50 -h 14} \ {button -callback on_targetManage_help -title "&Help" \ -helpbutton -name tm_helpButtom \ -x 160 -y 215 -w 50 -h 14} \ {button -callback on_targetManage_refresh -title "!" \ -name tm_bangRefresh -x 193 -y 6 -w 16 -h 14} \ }
toolbarCreate - create a toolbar on a window
Tcl Windows GUI
This function creates a toolbar and associates it with parentWindowName. Dialogs cannot have toolbars associated with them. A toolbar can be docked to any of the four sides of the parent frame. Use controlCreate to add tool items.
toolbarCreate parentWindowName [-any] [-bottom] [-callback callbackProcedureOrScript] [-helpfile helpFilePath] [-helpID uniqueIntegerID] [-left] [-name toolbarName] [-right] [-title captionString] [-top]
- parentWindowName
- specifies the name of the parent window for the toolbar.
- -any
- attaches the toolbar to any of the sides of the window. This flag overrides all the above flags.
- -bottom
- attaches the toolbar to the bottom of the window only.
- -callback callbackProcedureOrScript
- specifies that the Tcl script callback procedure or script should be called whenever an event occurs on this toolbar such as sizing, initialization, etc.
- -helpfile helpFilePath
- provides a separate help file for the toolbar's help. If not provided, the application's help file is used for context-sensitive help.
- -helpID uniqueIntegerID
- provides an ID associated with the toolbar for context-sensitive help. It references a topic in helpFilePath or the application's help file if -helpfile isn't specified.
- -left
- attaches the toolbar to the left of the window only.
- -name toolbarName
- specifies the name for the toolbar; later, you may use this name in conjunction with a control name for accessing controls.
- -right
- attaches the toolbar to the right of the window only.
- -top
- attaches the toolbar to the top of the window only.
N/A
- missing required window name
- unable to locate window name window
UITcl Library, controlDestroy, controlCreate, windowCreate
toolbarCreate Browser -name browserTB controlCreate browserTB \ "combo -callback selectNewBrowserPage -name cmb1 \ -tooltip {Browser Action List} \ -x 5 -y 100 -w 72 -h 50"
windowCreate - creates a child window
Tcl Windows GUI
windowCreate [-callback callbackProcedureOrScript] [-c|ontrols listOfControls] [-exec execProc] [-exit exitCallback] [-height height] [-helpfile helpFilePath] [-helpID F1HelpID] [-icon iconFileName] [-init initCallback] [-name windowName] [-nonewinterpreter] [-title windowTitleCaption] [-width width] [-xpos xposition] [-ypos yposition]
This function creates a child window that either stays in the client area of the mainframe window or outside depending the flag -msdi.
- -callback callbackProcedureOrScript
- specifies that the Tcl script callback procedure or script should be called whenever an event occurs on this window such as sizing, initialization, etc. If this flag is used, -init and -exit are ignored.
- -c|ontrols controlsDefinition
- specifies a list of controls that is instantiated before the dialog is shown.
- -exec
- calls the script execProc after the new interpreter is established. For example, the following parameter can be used to source a Tcl file after the window is created:
-exec {source tclSourceFileName}
- -exit exitProcedureOrScript
- specifies that the Tcl script exitProcedureOrScript should be called when the dialog is exiting, after it is erased from the screen. Use it to free any resources.
- -helpfile helpFilePath
- provides a separate help file for the window's help. If not provided, the application's help file is used for context-sensitive help.
- -helpID uniqueIntegerID
- provides an ID associated with the dialog for context-sensitive help. It references a topic in helpFilePath or the application's help file if -helpfile isn't specified.
- -icon iconFilePath
- icon used to display when this main window is minimized.
- -init initProcedureOrScript
- specifies that the Tcl script initProcedureOrScript is called when the dialog is initialized, after the controls are instantiated but before the window is drawn for the user. For information on the specification of controls, see controlCreate and Introduction: DIALOGS, WINDOWS AND CONTROLS.
- -name uniqueName
- uses uniqueName as the name of the dialog for future reference. Most of the UITcl API require a window name when a property of the window needs to be changed or queried about.
- -nonewinterpreter
- unless this option is provided, a newinterpreter is created to process commands for this window. Any commands that needs to be created for this window can be created in the exec using the -exec option. Procedures created in the scope of other interpreters will not be valid.
- -title captionString
- specifies the title for the dialog.
- -x|pos integer, -y|pos integer, -w|idth integer, and -h|eight integer
- specify the position and size for the new dialog in dialog units. If omitted, they are given default values.
N/A
- unable to create Tcl window
- unrecognized option ...
UITcl Library, windowClose, allControlsDestroy, dialogCreate
fileDialogCreate - create a standard file browser dialog
Tcl Windows GUI
fileDialogCreate [-createprompt] [-defaultfilter defaultfilter] [-filefilters filefilters] [-filemustexist] [-init initProcOrScript] [-multiselect] [-name aUniqueName] [-nochangedir] [-nonetworkbutton] [-nolongnames] [-noreadonlyreturn] [-okbuttontitle titleString] [-overwriteprompt] [-pathmustexist] [-readonly] [-readonlypref varName] [-savefile] [-showreadonly] [-title windowTitleCaption]
Creates a standard Windows file selection dialog enabling the user to select or specify file(s) for reading or writing.
- -createprompt
- warns the user if the file doesn't exist.
- `-filefilters
- a list of | delimited filters to be applied to the contents of the current directory before displaying it in the file listbox; the displayed result is the conjunction of filter selection sets. An example filter (including the required || terminator at the end of the list) is:
"Chart Files (*.xlc) | *.xlc | Worksheet Files (*.xls) | *.xls \ | Data Files (*.xlc;*.xls) | *.xlc; *.xls | All Files (*.*) | *.* ||"
- -filemustexist
- allows the user to select an existing file only.
- -multiselect
- allows the user to select more than one file. (-multiselect cannot be used with -savefile.)
- -nochangedir
- prevents the user from changing to a new directory.
- -nolongnames
- screens the user's entry of a new file name for DOS 8+3 convention; a bad match is refused.
- -nonetworkbutton
- hides the network button, preventing the user from browsing the network.
- -noreadonlyreturn
- returns only files that do not have the Read Only Check Box checked and are not in a write-protected directory.
- -okbuttontitle
- sets the OK button's title to titleString.
- -overwriteprompt
- warns the user if the file already exists (for save operations).
- -pathmustexist
- validates the filename and path for the user's entry; refuses invalid ones.
- -readonly
- checks AND displays the read-only checkbox; enables the display of readonly files.
- -readonlypref
- saves the final state of the Read Only Check Box to the Tcl variable varName.
- -savefile
- specifies file save mode (rather than file select).
- -showreadonly
- displays a read-only checkbox, allowing the user to enable the display of read-only files.
- -title
- sets the dialog's title to windowTitleCaption.
A file name or list of file names selected by the user.
N/A
UITcl Library, dialogCreate, dirBrowseDialogCreate
proc on_tgtsvr_bkEndLogFileBrowse {args} { global tsCfg_backendLogFileName set pathName [join [fileDialogCreate \ -filefilters "All Files (*.*)|*.*||" -title "Log File" \ -okbuttontitle "OK" -savefile -overwriteprompt]] if {$pathName != ""} { set tsCfg_backendLogFileName $pathName controlValuesSet tsCfgDlg.tgtsvr_backend_logfile_text \ $tsCfg_backendLogFileName } }
dirBrowseDialogCreate - create a standard directory browser dialog
Tcl Windows GUI
dirBrowseDialogCreate [-file fileToSearch] [-initialdir initialDirectoryToStart] [-okbuttontitle titleString] [-title windowTitleCaption]
Creates a standard Windows directory-browse dialog enabling the user to select or specify a directory.
- -file fileToSearch
- specifies the file name to search for.
- -initialdir initialDirectoryToStart
- specifies the first directory to search.
- -okbuttontitle titleString
- sets the OK button's title to titleString.
- -title titleString
- sets the dialog's title to windowTitleCaption.
N/A
N/A
UITcl Library, dialogCreate, fileDialogCreate
windowClientSizeGet - retrieves the size of the client area of a dialog or window
Tcl Windows GUI
windowClientSizeGet [-pixels] windowName
This function obtains the size of the client area in dialog units or pixels if specified.
- -pixels
- specifies whether the width and height need to be in pixels.
- windowName
- specifies the name of the window.
A list containing { width height } in dialog units.
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, controlSizeGet, windowSizeGet, windowSizeSet
windowSizeSet - sets the size of a dialog or window
Tcl Windows GUI
windowSizeSet windowName [-pixels] width height
This function sets the width and height of a dialog or window.
- windowName
- specifies the name of the window.
- -pixels
- specifies whether the width and height are in pixels.
- width and height
- specify these parameters in dialog units or pixels
N/A
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, windowSizeSet, windowClientSizeGet, windowPositionSet
windowPositionSet - sets the position of a dialog or window
Tcl Windows GUI
windowPositionSet windowName [-pixels] xpos ypos
This function sets the position of a dialog or window.
- windowName
- specifies the name of the window whose position is to be set.
- -pixels
- specifies whether the xpos and ypos are in pixels.
- xpos and ypos
- specifies the x and y coordinates of the window in dialog units.
N/A
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, windowPositionGet, windowSizeSet, windowSizeGet
windowSizeGet - retrieves the size of a dialog or window
Tcl Windows GUI
windowSizeGet windowName [-pixels]
This function obtains the size of a dialog or window in dialog units or pixels.
- windowName
- specifies the name of the window.
- -pixels
- specifies whether the width and height need to be in pixels.
A list containing { width height } in dialog units.
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, windowSizeSet, windowClientSizeGet, windowPositionGet
windowPositionGet - retrieves the position of a dialog or window
Tcl Windows GUI
windowPositionGet windowName [-pixels]
This function obtains the position of the dialog or window in dialog units or pixels
- windowName
- specifies the name of the window.
- -pixels
- specifies whether the xpos and ypos are in pixels.
A list containing { x y } in dialog units or pixels
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, windowPositionSet, windowSizeGet, windowSizeSet
windowSizeCallbackSet - sets the Tcl script to be called when a dialog or window has been resized
Tcl Windows GUI
windowSizeCallbackSet windowName callbackScript
This function sets the Tcl script to be called when the user or system resizes the dialog or window.
- windowName
- specifies the name of the window.
- callbackScript
- specifies the script to be executed when the window is resized.
N/A
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, windowActivateCallbackSet, windowInitCallbackSet, windowExitCallbackSet, windowQueryCloseCallbackSet
windowSizeCallbackGet - returns the script called when the user or system resizes the dialog or window
Tcl Windows GUI
windowSizeCallbackGet windowName
This function returns the Tcl script or proc name that the system calls on behalf of the window when it is resized.
- windowName
- specifies the name of the window for which callback information is desired.
The Tcl script called when the window is resized or an empty string if no script exists.
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, windowSizeCallbackSet
windowActivateCallbackSet - sets the Tcl script to be called when a dialog or window is activated
Tcl Windows GUI
windowActivateCallbackSet windowName callbackScript
This function sets the Tcl script to be called when Windows activates the dialog or window.
- windowName
- specifies the name of the window.
- callbackScript
- specifies the script to be evaluated when the window is activated. This script expects one parameter, either "activate" or "deactivate", indicating which action is being taken.
N/A
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, windowSizeCallback, windowInitCallbackSet, windowExitCallbackSet, windowQueryCloseCallbackSet
windowActivateCallbackGet - returns the script called when the window or dialog is activated
Tcl Windows GUI
windowActivateCallbackGet windowName
This function returns the Tcl script or proc name that the system calls on behalf of the window when it is activated.
- windowName
- specifies the name of the window for which callback information is desired.
The Tcl script called when the window is activated or an empty string if no script exists.
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, windowActivateCallbackSet
windowInitCallbackSet - sets the Tcl script called when a dialog or window is initialized
Tcl Windows GUI
windowInitCallbackSet windowName callbackScript
This function sets the Tcl script to be called when the dialog or window is initialized.
- windowName
- specifies the name of the window.
- callbackScript
- specifies the script to be executed when the window is initialized.
N/A
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, windowSizeCallback, windowActivateCallbackSet, windowExitCallbackSet, windowQueryCloseCallbackSet
windowInitCallbackGet - returns the script called when the dialog or window is initialized
Tcl Windows GUI
windowInitCallbackGet windowName
This function returns the Tcl script or proc name that the system calls on behalf of the window at initialization time.
- windowName
- specifies the name of the window for which callback information is desired.
The Tcl script called when the window is initialized or an empty string if no script exists.
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, windowInitCallbackSet
windowShowCallbackSet - sets the Tcl script called when a dialog or window is displayed
Tcl Windows GUI
windowShowCallbackSet windowName callbackScript
This function sets the Tcl script called when the dialog or window is displayed.
- windowName
- specifies the name of the window.
- callbackScript
- specifies the script to be executed when the window is shown.
N/A
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, windowShowCallbackGet, windowSizeCallback, windowActivateCallbackSet, windowExitCallbackSet, windowQueryCloseCallbackSet
windowShowCallbackGet - returns the script called when the dialog or window is displayed
Tcl Windows GUI
windowShowCallbackGet windowName
This function returns the Tcl script or proc name that the system calls on behalf of the window when displaying it.
- windowName
- specifies the name of the window for which callback information is desired.
The Tcl script called when the window is shown or an empty string if no script exists.
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, windowShowCallbackSet
windowExitCallbackSet - sets the Tcl script called when a dialog or window is exited
Tcl Windows GUI
windowExitCallbackSet windowName callbackScript
This function sets a Tcl script to be called when the window exits. The script is called after all controls have been destroyed by the system.
- windowName
- specifies the name of the window.
- callbackScript
- specifies the script to be executed when the window exits.
N/A
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, windowSizeCallback, windowActivateCallbackSet, windowInitCallbackSet, windowQueryCloseCallbackSet
Functions requiring a Tcl script callback accept either an inline script or the name of a Tcl proc:
windowExitCallbackSet supportView { menuItemEnable {&Tools Su&pport...} 1 }-Or-
proc supportViewOnExit {} { #... } windowExitCallbackSet supportView supportViewOnExit
windowExitCallbackGet - returns the script called when the user or system exits the dialog or window
Tcl Windows GUI
windowExitCallbackGet windowName
This function returns the Tcl script or proc name that the system calls on behalf of the window when it is about to exit.
- windowName
- specifies the name of the window for which callback information is desired.
The Tcl script called when the window is about to exit or an empty string if no script exists.
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, windowExitCallbackSet
windowQueryCloseCallbackSet - sets the Tcl script to be called when closing a dialog or window
Tcl Windows GUI
windowQueryCloseCallbackSet windowName callbackScript
This function sets the Tcl script to be called when the user or system has requested that the window be closed. In situations where the closure would otherwise occur automatically, the callback tells the system whether or not the window is ready to be closed safely.
The callback shuld return 1 if the window can safely be closed, 0 if not.
- windowName
- specifies the name of the window.
- callbackScript
- specifies the Tcl script to be called when the window or dialog is about to be closed.
N/A
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, windowSizeCallback, windowActivateCallbackSet, windowExitCallbackSet, windowQueryCloseCallbackSet
windowQueryCloseCallbackGet - returns the script called to determine whether the dialog or window can be closed safely
Tcl Windows GUI
windowQueryCloseCallbackGet windowName
This function returns the Tcl script or proc name that determines whether the dialog or window can be closed safely.
- windowName
- specifies the name of the window for which callback information is desired.
The Tcl script called when the window is closed or an empty string if no script exists.
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, windowQueryCloseCallbackSet
windowHidden - determines whether a particular UITcl window or dialog is hidden
Tcl Windows GUI
windowHidden windowName
This function determines whether a particular window is hidden.
- windowName
- specifies the name of the window for which information is desired.
1 if the window is hidden, 0 otherwise.
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, windowCreate, dialogCreate, controlExists
windowVisible - determines whether a particular UITcl window or dialog is visible on the screen
Tcl Windows GUI
windowVisible windowName
This function determines whether a particular window is visible.
- windowName
- specifies the name of the window for which information is desired.
1 if the window is visible, 0 if not.
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, windowCreate, dialogCreate, controlExists
windowHide - hides or shows a Tcl window, dialog, or toolbar
Tcl Windows GUI
windowHide windowName state
This function hides or shows a window, a dialog, or a toolbar.
- windowName
- specifies the name of the window.
- state
- can have 1 or 0 for hide or show respectively.
N/A
- unable to locate window name window
windowShow - shows or hides a Tcl window, dialog, or toolbar
Tcl Windows GUI
windowShow windowName [-maximize|-minimize|-restore] state
This function shows or hides a window, a dialog, or a toolbar.
- windowName
- specifies the name of the window.
- -maximize
- shows the window in a maximized state
- -minimize
- shows the window in a minimized state
- -restore
- shows the window in a restored state
- state
- can have 0 or 1 for hide or show respectively.
N/A
- unable to locate window name window
windowActiveGet - gets the name of the currently active Tcl window, dialog, or toolbar
Tcl Windows GUI
windowActiveGet
This function retrieves the active window, dialog, or toolbar.
N/A
The name of the currently active Tcl window, dialog, or toolbar or blank if no active window or if the active window is not a Tcl window, dialog,* or toolbar.
windowActiveSet - sets the named Tcl window as the active window
Tcl Windows GUI
windowActiveSet windowName
This function activates a child window in an MDI frame.
- windowName
- specifies the name of the window.
N/A
- unable to locate window name window
windowTitleSet - sets the title of a dialog or window
Tcl Windows GUI
windowTitleSet windowName title
This function sets the title caption of a dialog or window.
- windowName
- specifies the name of the window.
- title
- specifies the caption string.
N/A
- unable to locate window name window
windowTitleGet - gets the title of a dialog or window
Tcl Windows GUI
windowTitleGet windowName
This function gets the title caption of a dialog or window.
- windowName
- specifies the name of the window.
the title as a string.
- unable to locate window name window
windowHandleGet - gets the internal Windows handle of a dialog or window
Tcl Windows GUI
windowHandleGet windowName
This function returns the handle of the window so that it can be used for advanced features of UITcl.
- windowName
- specifies the name of the window.
the unique handle of the window if the window is found, 0 if not.
- unable to locate window name window
windowEventGet - returns the most recent event that has occured in a dialog or window
Tcl Windows GUI
windowEventGet windowName
This function returns the last event that occurred in the window. Events can occur due an action taken by the user such as change the size of the window which triggers windowsize event, closing a window causes a windowqueryclose event. These event can be handled furhter using this command.
- windowName
- specifies the name of the window.
A string containing the name of the event.
<event>
- unable to locate window name window
UITcl Library, windowCallbackSet, EVENT HANDLING section of the Introduction to the Tcl Windows GUI help
proc onEvent {} { set eventType [windowEventGet myWindow] if {$eventType == "windowsize"} { #... } elseif {$eventType == "windowshow"} { #... } }
windowHelpFileSet - sets the help file to be used for the named dialog or window
Tcl Windows GUI
windowHelpFileSet windowName helpFilePath
This function registers the fully qualified name of the WIN32 help file containing topics corresponding to help IDs relevant to this dialog or window. This facilitates context-sensitive help.
- windowName
- specifies the name of the window.
- helpFilePath
- specifies the fully qualified name of the new help file.
N/A
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, windowHelpIDSet, controlHelpIDSet
windowHelpFileGet - gets the path of help file.
Tcl Windows GUI
windowHelpFileGet windowName
Gets the path of help file currently being used to facilitate help for this window or dialog.
- windowName
- specifies the name of the window.
help file path as a string or a blank string.
- unable to locate window name window
UITcl Library, windowHelpIDSet, controlHelpIDSet
windowHelpIDSet - sets the help ID and (optionally) the help file to be used for named dialog or window
Tcl Windows GUI
windowHelpIDSet windowName [helpFilePath] helpID
This function sets the ID of the help topic that WinHelp displays when the user invokes context-sensitive help. If helpFilePath is specified, the help file is also set (see helpFileSet).
- windowName
- specifies the name of the window.
- helpFilePath
- specifies the fully qualified file name for the relevant help file.
- helpID
- specifies the ID of the relevant help topic.
N/A
- missing required control name in routine
- unable to locate window name window
UITcl Library, windowHelpFileSet, controlHelpIDSet
windowHelpIDGet - gets the help ID of the window
Tcl Windows GUI
windowHelpIDGet windowName
This function gets the ID of the help topic that is associated with the window.
- windowName
- specifies the name of the window.
a valid integer help id or 0
- unable to locate window name window
UITcl Library, windowHelpFileSet, controlHelpIDSet
windowPropertySet - sets the value of a property
Tcl Windows GUI
windowPropertySet windowName [-horizontalscrollbar <0|1>] [-verticalscrollbar <0|1>]
This function sets a property of a window. Not all windows or dialogs support all properties. See below to set a certain property on a particular type of window.
- windowName
- specifies the name of the window.
- -horizontalscrollbar 0|1
- specifies that the horizontal scrollbar of a window should be shown whenever the client area of the window is not enough to show all the controls in that that window. This property is valid only for windows that are created using windowCreate command.
- -verticalscrollbar 0|1
- specifies that the verticalscrollbar of a window should be shown whenever the client area of the window is not enough to show all the controls in that that window. This property is valid only for windows that are created using windowCreate command.
N/A
- unable to locate window name window
UITcl Library, windowCreate, dialogCreate
autoTimerCallbackSet - see windowTimerCallbackSet
windowTimerCallbackSet - sets or removes the timer script for the given dialog or window
Tcl Windows GUI
windowTimerCallbackSet windowName [-milliseconds] timerInterval [callbackScript]
If callbackScript is specified, this function creates a timer that will evaluate callbackScript periodically at the specified interval. If callbackScript is given as an empty string or timerInterval is 0, this function removes any timer set for this dialog or window.
- windowName
- specifies the name of the window whose timer callback will be manipulated.
- -milliseconds
- specifies that timer interval is to be interpreted as milliseconds instead of seconds.
- timeSec
- the timer interval in seconds (or milliseconds if -milliseconds is specified).
- callbackScript
- is a Tcl script or proc to be evaluated each time an interval of timeSec elapses.
N/A
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
This function uses the WIN32 timer mechanism, a non-real-time timer. The actual period between timer events is indeterminant, but is guaranteed to be greater than or equal to timeSec.
Only one timer callback can exist for a window.
UITcl Library, windowTimerCallbackGet
autoTimerCallbackGet - see windowTimerCallbackGet
windowTimerCallbackGet - returns the timer script for the given dialog or window
Tcl Windows GUI
windowTimerCallbackGet windowName
This function returns the Tcl script or proc name that the system calls at each interval on behalf of the dialog or window.
- windowName
- specifies the name of the window for which timer callback information is desired.
The Tcl script called at each timer interval or an empty string if no script exists.
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
Only one timer callback can exist for a window.
UITcl Library, windowTimerCallbackSet
windowClose - closes a dialog or window
Tcl Windows GUI
windowClose windowName [exitCode]
Use this function to close a dialog or window. Any callback script registered with the -exitCallback flag in dialogCreate or windowCreate is evaluated.
- windowName
- specifies the name of the window.
- exitCode
- returns this exit code to the caller (only applicable for modal dialogs).
N/A
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, windowCreate, dialogCreate
Do not call this function from within an exit callback function set with the -exit flag in dialogCreate or windowCreate or from a function set using windowExitCallbackSet.
allControlsDestroy - destroys all the controls in a dialog or window
Tcl Windows GUI
allControlsDestroy windowName
This function destroys all controls associated with a particular dialog or window.
- windowName
- specifies the window whose controls are to be destroyed.
N/A
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, controlDestroy, windowClose, controlCreate, dialogCreate, windowCreate, toolbarCreate
windowExists - determines whether a particular window exists
Tcl Windows GUI
windowExists [-title] windowName
This function determines whether a particular window exists.
- windowName
- specifies the name of the window for which information is desired.
- -title
- causes windowName to be interpreted as the title of the window.
1 if the window exists, 0 if not.
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
`UITcl Library, windowCreate, dialogCreate, controlExists
controlEventGet - returns the most recent event that has occured on a control
Tcl Windows GUI
controlEventGet windowName.controlName
This function returns the last event that occurred on the control. Events can occur due an action taken by the user such as click on a pushbutton control which triggers buttonclk event or a list control can generate a selchange event when the user changed the selected item in the listbox.
- windowName
- specifies the name of the parent window.
- controlName
- specifies the name of the control.
A string containing the name of the event.
<event>
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, controlCallbackSet, EVENT HANDLING section of the Introduction to the Tcl Windows GUI help
proc onEvent {} { set eventType [controlEventGet myWindow.myCtrl] if {$eventType == "selchange"} { #... } elseif {$eventType == "dblclk"} { #... } }
controlHandleGet - returns the handle of a tcl control
Tcl Windows GUI
controlHandleGet windowName.controlName
This function returns the handle of a control from a tcl window or a dialog that can be used for advanced features of UITcl.
- windowName
- specifies the name of the parent window.
- controlName
- specifies the name of the control.
the unique handle of a control if the control is found, 0 if not.
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, windowHandleGet
controlPositionSet - sets the position of a control in a dialog or window
Tcl Windows GUI
controlPositionSet windowName.controlName xpos ypos
This function positions a control within its parent dialog or window. Coordinates must be specified in dialog units.
- windowName
- specifies the name of the parent window.
- controlName
- specifies the name of the control.
- xpos and ypos
- specify coordinates in dialog units.
N/A
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, controlPositionGet, controlSizeSet, controlSizeGet
controlPositionGet - retrieves the position of a control
Tcl Windows GUI
controlPositionGet windowName.controlName
This function returns the position of a control within a dialog or window in dialog units.
- windowName
- specifies the name of the parent window.
- controlName
- specifies the name of the control.
A list of the form { x y } containing the position of the control in dialog units.
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, controlPositionSet, controlSizeGet, controlSizeSet
controlSizeSet - sets the size of a control in a dialog or window
Tcl Windows GUI
controlSizeSet windowName.controlName width height
This function sets the size of a control in a dialog or window using dialog units.
- windowName
- specifies the name of the parent window.
- controlName
- specifies the name of the control.
- width and height
- specified in dialog units.
N/A
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, controlSizeGet, controlPositionSet, controlPositionGet
controlSizeGet - retrieves the size of a control in a dialog or window
Tcl Windows GUI
controlSizeGet windowName.controlName
This function retrieves the size of a control in a dialog or window in dialog units.
- windowName
- specifies the name of the parent window.
- controlName
- specifies the name of the control.
A list containing { width height } in dialog units.
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, controlSizeSet, controlPositionGet, controlPositionSet
controlHelpIDSet - sets the help ID to be used for the named control in a dialog or window
Tcl Windows GUI
controlHelpIDSet windowName.controlName helpID
This function sets the ID of the help topic that WinHelp displays when the user invokes context-sensitive help.
- windowName
- specifies the name of the window.
- controlName
- specifies the name of the control.
- helpID
- specifies the ID of the relevant help topic.
N/A
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, windowHelpIDSet, windowHelpFileSet
controlHide - hides or shows a control in a dialog or window
Tcl Windows GUI
controlHide windowName.controlName state
This function shows or hides a control in a dialog or window. It can be used to create virtual "layers" of controls by showing or hiding them as warranted by the context.
- windowName
- specifies the name of the parent window.
- controlName
- specifies the name of the control.
- state
- 0 to show the control, 1 to hide it.
N/A
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, controlHidden, controlEnable, controlEnabled
controlHidden - retrieves the hidden state of a control in a dialog or window
Tcl Windows GUI
controlHidden windowName.controlName
This function determines if the control is hidden or visible.
- windowName
- specifies the name of the parent window.
- controlName
- specifies the name of the control.
1 if the control is visible, 0 if the control is hidden.
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, controlHide, controlEnable, controlEnabled
controlEnable - enables or disables a control in a dialog or window
Tcl Windows GUI
controlEnable windowName.controlName state
This function enables or disables a control in a dialog or window, enabling or preventing reception of user input.
- windowName
- specifies the name of the parent window.
- controlName
- specifies the name of the control.
- state
- 1 to enable the control, 0 to disable it.
N/A
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, controlHidden, controlEnable, controlEnabled
controlEnabled - retrieves the enabled state of a control in a dialog or window
Tcl Windows GUI
controlEnabled windowName.controlName
This function determines whether a control's state is enabled or disabled.
- windowName
- specifies the name of the parent window.
- controlName
- specifies the name of the control.
1 if the control is enabled, 0 if it is disabled.
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, controlEnable, controlHide, controlHidden
controlExists - determines whether a particular control exists in a dialog or window
Tcl Windows GUI
controlExists windowName.controlName
This function determines whether a particular control exists within a specified dialog or window.
- windowName
- specifies the name of the parent window.
- controlName
- specifies the name of the control.
1 if the control exists, 0 if not.
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, controlCreate, controlDestroy
controlFocusSet - sets focus to a control in a dialog or window
Tcl Windows GUI
controlFocusSet windowName.controlName
This function sets the focus (active control) of a dialog or window to a particular control. Subsequent keyboard input is directed to that control.
- windowName
- specifies the name of the parent window.
- controlName
- specifies the name of the control.
N/A
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
controlCallbackSet - sets a Tcl script to process events for a control in a dialog or window
Tcl Windows GUI
controlCallbackSet windowName.controlName callbackScript
This function establishes a routine to handle events for a control in a dialog or window.
- windowName
- specifies the name of the parent window.
- controlName
- specifies the name of the control.
- callbackScript
- specifies the Tcl script to use to process events.
N/A
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
Use eventInfoGet to identify the event and the control receiving it.
UITcl Library, controlCallbackGet, `eventInfoGet, EVENT HANDLING section of the Introduction to the Tcl Windows GUI help
controlCallbackGet - retrieves the Tcl script (if any) established to process events for a control
Tcl Windows GUI
controlCallbackGet windowName.controlName
This function retrieves the Tcl script that handles events. It can also be used to determine if such a handler exists. To establish such a script, use controlCallbackSet or specify the -callback flag in controlCreate.
- windowName
- specifies the parent window.
- controlName
- specifies the name of the control.
The Tcl script or an empty string if no script was previously set.
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, controlCallbackSet, eventInfoGet
controlContextMenuShow - show the specified context menu.
Tcl Windows GUI
controlContextMenuShow windowName.controlName menuName
Associates the specified context menu created using menuCreate, and displays it for the user.
- windowName
- specifies the name of the parent window.
- controlName
- specifies the name of the control.
- menuName
- specifies the menu to be shown.
N/A
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, menuCreate, menuItemInsert, menuItemAppend
controlLockUpdate - locks the updating of the control.
Tcl Windows GUI
controlLockUpdate windowName.controlName
Locks any update events that were received for this control and ignores them. This is very useful to stop updating while inserting huge data into a control. This avoids flockering while the insertion is being done.
- windowName
- specifies the name of the parent window.
- controlName
- specifies the name of the control.
N/A
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, controlUnlockUpdate
controlUnlockUpdate - Unlocks all the updates on the control.
Tcl Windows GUI
controlUnlockUpdate windowName.controlName
Unlocks any updates for this control. This is very useful to stop update a control after inserting huge data.
- windowName
- specifies the name of the parent window.
- controlName
- specifies the name of the control.
N/A
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, controlLockUpdate
controlParentSet - sets the specifed window as the parent of the control.
Tcl Windows GUI
controlParentSet windowName.controlName newParentWindow
Sets the specified window the parent of a control.
- windowName
- specifies the name of the parent window.
- controlName
- specifies the name of the control.
- newParentWindow
- specifies the name of the new parent window.
N/A
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
controlValuesSet - sets the data or text of a control
Tcl Windows GUI
controlValuesSet windowName.controlName [-append] [-delete] [-edit] [-fadebmp filePath] [-insert insertBefore] [-string] data
This function sets the data or text of a control. Exact functionality depends on the control type; see the parameter descriptions below.
- windowName
- specifies the name of the parent window.
- controlName
- specifies the name of the control.
- -append
- adds a string to the end of the current list for lists and combos.
- -delete
- finds and deletes data from the list or combo.
- -edit
- inserts the data in the edit box area of a combo box. Note: This flag is valid only if the control is combo.
- -fadebmp filePath
- use filePath as the bitmap to fade the bitmap in the bitmap control.
- -insert
- inserts the new string before insertBefore for lists and combos.
- -string
- an exact match to be used when searching for insertBefore or deleting data in list and combo controls.
- data
- for lists and combos, a list of one or more strings or string indices;
- -
- for hierarchys, node values arranged in a structure matching the tree control;
- -
- for a progressmeters, data is the current value
- -
- for meters, data is interpreted as:
currentValue [minValue maxValue highWater]
N/A
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
For combo, list and checklist controls, use -append or -insert with insertBefore to specify an insertion position for data. insertBefore can be either an index or a string value. Use -delete to delete strings by position (if data is one or more indices) or by value (if data is a list of string values) from the list. Specify -string for an exact string match for either insert or delete. Omitting -insert, -delete, and -append empties the list or combo before adding the new strings.
Insert and delete operations cannot be performed together.
For hierarchy controls, this function changes the values of terminal nodes. data is a list of values for terminal nodes in a format matching the hierarchy's structure. Any nodes whose values change with this update are highlighted with the tree control's current highlight color. For more information on tree controls, see controlStructureSet.
For meter controls, use the following syntax:
controlValuesSet currentValue [minValue maxValue highWater]For boolean or choice controls, set data to 1 to check the button, 0 to uncheck it.For label or text controls, use this function to set the text string.
UITcl Library, controlValuesGet, controlCreate
controlValuesSet targetServerManage.targetManage_combo_action \ [list Reserve Unreserve Unregister Kill Reboot]
controlValuesGet - retrieves values of controls
Tcl Windows GUI
controlValuesGet windowName.controlName [-childrenonly] [-edit] [-itemcount]
This function returns relevant attributes for the following controls:
for lists: the text of the current list selection;
for combos: the text of current selection or of the edit;
for buttons: the text of the button.To determine the state of booleans and choices, use controlCheckGet.
- windowName
- specifies the name of the parent window.
- controlName
- specifies the name of the control.
- -childrenonly
- returns texts of all terminal nodes of a node. This is valid only in tree, hierarchy and treelist controls.
- -edit
- returns the text in the edit window of a combo.
- -itemcount
- returns the number of items in a list. combo or a checklist control.
The text of the current selection for lists, the text of the current selection or the edit window (if -edit flag is set) for combos, and the button's state for choices and booleans (1 indicates checked or pressed; 0 indicates not).
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, controlValuesSet, controlCreate
set listContents [controlValuesGet tsCfgDlg.tgtsvr_descr_list]
No return value yet for trees or meters.
controlStructureSet - sets the structure of a hierarchy (tree) control
Tcl Windows GUI
controlStructureSet windowName.hierarchyControlName [-collapsed] data
This function establishes the structure of an uninitialized hierarchy control. The list must be specified in the format described below. For a progressmeter control provide the current progress percent.
- windowName
- specifies the name of the parent window.
- controlName
- specifies the name of the hierarchy control.
- -collapsed
- initially creates the control collapsed. If the hierarchy is large, this will sharply improve performance.
- data
- see below
N/A
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
A "hierarchy" is represented as an n-way tree of nodes. Each node contains an array of children. Each node has a name. "Terminal" nodes, which are nodes without children, may also have a value. Tcl lists are used to instantiate hierarchies. The format is a list of items. Each item represents a node. If an item is itself a list of exactly two elements, the first element represents the name of the node, and the second element is a list of subnodes. For example, the instantiation "structure string":
A {B {b1 b2}} C D {E {{e1 {e11 e12 e13}} e2}} Frepresents this hierarchy:
A - B b1 b2 C D - E - e1 e11 e12 e13 e2 F(The - flags indicate that the node is considered "expandable", because it contains children).Internally, the root node of the hierarchy contains an array of children: the nodes A B C D E F. Node B also contains an array of children: b1 and b2.
There is a subtlety in the syntax of a hierarchy structure string: nodes that have two list elements represent nodes with children, while nodes with one or more than two elements represent single terminal nodes. Hence, the structure string
A {hi there} Crepresents the hierarchy
A - hi there CIf "hi there" is meant to be a simple node parallel with A and C, it must be written with either one or more than two elements, e.g.:
A {hi-there} CHence it is impossible to have a hierarchy node with a name of exactly two words, a syntactic deficiency of this implementation.Once a hierarchy has been instantiated, its structure cannot change; if a new structure is desired, the old hierarchy must be destroyed and a new one created.
The setTerminalValues method can be called at any time; it fills in the value strings of the terminal nodes with strings from the supplied value list. If the first hierarchy given above had its setTerminalValues method invoked with the following string,
1 {2 3} 4 5 {{6 7 8} 9} 10the values would be assigned as follows:
A = 1 - B b1 = 2 b2 = 3 C = 4 D = 5 - E - e1 e11 = 6 e12 = 7 e13 = 8 e2 = 9 F = 10Note that only terminal nodes can receive values, and that the list structure of the value string mirrors that of the structure string.
It is possible for a node to be marked as an "array node". In this case, the second element of the structure for the node uses the special name +. If the subnode is simply named +, the array is a simple array of terminal values. When values are assigned to array nodes, the number of items in the value list becomes the number of children of the array node. This number can grow or shrink. Given the structure string
A {B +}and the value string
v {w x y z}the resulting hierarchy is:
A = v - B 0 = w 1 = x 2 = y 3 = zChild nodes of B are automatically created and given names starting with "0". Supplying another value string "v {a b}" reduces the number of elements subordinate to B to 2.The array constuctor + can be nested as shown by the following structure/value pair:
{A {+ {+}}} {{1 2} {3 4} {5 6}}This pair results in the "two dimensional array" hierarchy:
- A - 0 0 = 1 1 = 2 - 1 0 = 3 1 = 4 - 2 0 = 5 1 = 6
Arrays can also have substructure. This is indicated by replacing + with a two-element list, where the first element is + and the second is a structure string representing the array substructure. For an array of structures, each having a member n and a substructure member coord, with members x and y, one could write the following strings for structure and value:
{Point {+ {n {coord {x y}}}}} {{1 {2 3}} {4 {5 6}}}These strings yield:
- Point - 0 n = 1 - coord x = 2 y = 3 - 1 n = 4 - coord x = 5 y = 6
UITcl Library, controlValuesSet, controlValuesGet
controlCreate tsCfgDlg { tree -name "myTree" -x 7 -y 5 -w 100 -h 9 } set controlStruct { { A { a b c } } B C } controlStructureSet myTree -collapsed $controlStruct set controlValues { { 1 { 2 3 4 } } 5 6 } controlValuesSet myWindow.myTree $controlValues
controlPropertySet - allows to configure the control properties
Tcl Windows GUI
controlPropertrySet windowName.controlName [-allownewinsertions <0|1>] [-background colorName] [-columnindex index] [-columnwidths|-columnheaders] [-defaultbutton] [-font fontInfo] [-foreground colorName] [-highlight colorName] [-imagelist imagesFilePath] [-playstate <0|1>] [-readonly state] data
This function sets the configuration of a control
- windowName
- specifies the name of the window.
- controlName
- specifies the name of the control.
- -allownewinsertions 0|1
- specifies that new insertions into the control can be allowed. Users can use the insert key or by double clicking the blank area at the end of all nodes in a treelist control.
- -background colorName
- specifies that colorName is the background color of the control. This flag is valid for hierarchy, label, meter and progressmeter only.
- -columnheaders
- specifies that data is a list of column headers in a table control.
- -columnindex index
- specifies that data is the columnwidth or columnheader of the column whose index is index.
- -columnwidths
- specifies that data is a list of column widths in a table control.
- -defaultbutton
- specifies that button should be made the default button for the parent dialog. Any Enter key press in the parent dialog translated as button press on this button.
- -font fontInfo
- specifies that fontInfo is a list of "name size style" of the font that is used to display text in a control. This is valid for all controls that draw some kind of text in their client area.
- -foreground colorName
- specifies that colorName is the foreground color of the control. This flag is valid for tree, hierarchy, label, meter and progressmeter only.
- -highlight colorName
- specifies that colorName is the highlight color of the control. This flag is valid for hierarchy only.
- -imagelist imagesFilePath
- specifies that imagesFilePath is the resource file to be used to extract images to associate and display for nodes of a tree control.
- -playstate 0|1
- specifies that the state being provided in the next argument is the playstate state of a animation control. 1 starts play and 0 stops it.
- -readonly 0|1
- specifies that the state being provided in the next argument is the readonly state of a text control.
- data
- depends on other options above used.
N/A
UITcl Library, controlChecked, controlHidden, controlEnable, controlEnabled
controlPropertyGet - returns the value of the specified property of a control.
Tcl Windows GUI
controlPropertryGet windowName.controlName [-background|-font|-foreground|-highlight|-readonly]
This function gets the value of the specified property of UITcl control
- windowName
- specifies the name of the window.
- controlName
- specifies the name of the control.
- -background
- returns the background color name of a hierarchy, label or meter control.
- -font
- returns the font information for a control.
- -foreground
- returns the foreground color name of the control.
- -highlight
- returns the highlight color name of a hierarchy control. Highlight color is used for highlighting items that have changed since a call to the last controlValuesSet.
- -readonly
- returns the readonly state of a text control.
Depends on the option passed
UITcl Library, controlPropertySet, controlChecked, controlHidden, controlEnable, controlEnabled
controlCheckSet - checks a control in a window or dialog
Tcl Windows GUI
controlCheckSet windowName.controlName state
This function marks a boolean control or sets a choice control.
- windowName
- specifies the name of the window.
- controlName
- specifies the name of the control.
- state
- 1 to check the control, 0 to uncheck it.
N/A
UITcl Library, controlChecked, controlHidden, controlEnable, controlEnabled
controlChecked - retrieves the check state of a control in a window or dialog
Tcl Windows GUI
controlChecked windowName.controlName
This function determines whether or not a boolean or choice control's state is checked.
- windowName
- specifies the name of the window.
- controlName
- specifies the name of the control.
1 if the control is checked, 0 if not.
UITcl Library, controlCheckSet, controlEnable, controlHide, controlHidden
controlSelectionSet - sets the selection in a control in a dialog or window
Tcl Windows GUI
controlSelectionSet windowName.controlName [-noevent] [-string] selection
This function sets the current selection for a control that supports a collection of items either as a list or a hierarchy such as list, combobox, checklist, tree, hierarchy, tab, treelist or a table control. For a text control pass the starting and ending character positions as a list. If -1 is specified, any selection is removed.
- windowName
- specifies the name of the parent window.
- controlName
- specifies the name of the control.
- -noevent
- prevents the control from sending its parent the relevant notification event (for example, selchange).
- -string
- if specified, selection is specified by value; otherwise, selection is assumed to be an index. -string only applies to list and combo controls.
- selection
- for text controls, selection is always a string. For list and combo controls, it can be either a string or an index (see -string). For tree, hierarchy or a treelist control it can be the itempath starting at the root node of the control.
N/A
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, controlSelectionGet
controlSelectionSet targetServerManage.targetManage_combo_action \ -noevent 0
controlSelectionGet - gets the selection in a control in a dialog or window
Tcl Windows GUI
controlSelectionGet windowName.controlName [-allcolumns] [-itemhandle] [-itemtext] [-string]
This function obtains the current selection for a control that supports a collection of items either as a list or a hierarchy such as list, combobox, checklist, tree, hierarchy, tab, treelist or a table control. For a text control it returns the starting and ending character positions of the selection as a list.
- windowName
- specifies the name of the parent window.
- controlName
- specifies the name of the control.
- -allcolumns
- returns all the columns of the selected item of a treelist control.
- -itemhandle
- returns the handle of the selected item of a treelist control.
- -itemtext
- returns the user data of the selected item of a treelist control.
- -string
- returns the current selection as a string; otherwise, it is returned as an index. -string is only applicable to list and combo controls.
An integer index is returned for list and combo controls unless -string is specified, in which case a string is returned. Edit controls always return a string containing the text of the current selection or an empty string if there is no current selection.
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, controlSelectionSet, controlFocusSet
controlExpandingItemGet - gets information about the currently expanding item of a treelist control.
Tcl Windows GUI
controlExpandingItemGet windowName.controlName [-allcolumns]
This function obtains text of currently expanding item in a treelist control. This event could be generated by the user clicking on the + of a expandable node or another part of the script is calling controlItemPropertySet to set the expand state of a node.
- windowName
- specifies the name of the parent window.
- controlName
- specifies the name of the control.
- -allcolumns
- returns all the columns of the selected item of a treelist control.
A string path of the item being expanded or all the strings of columns of the item if -allcolumns option is used.
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, controlSelectionGet
controlItemDelete - delete the specified item in a control.
Tcl Windows GUI
controlItemDelete windowName.controlName [-all] [-childrenonly] [-itemhandle handle] [-parent parentHandle] itemPath
This function deletes the specified item. This function is valid for tree and treelist controls. Provide the full path to the item or handle to the item. If the parent handle is provided usign -parent option, just provide the item string.
- windowName
- specifies the name of the parent window.
- controlName
- specifies the name of the control.
- -all
- deletes all the items in the control.
- -childrenonly
- specifies that only child nodes of the specified need to be deleted.
- -itemhandle handle
- specifies that handle is the handle of the item to be deleted.
- -parent handle
- specifies that handle is the handle to the parent node.
N/A
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, controlItemInsert
controlItemInsert - inserts the provided item into the control.
Tcl Windows GUI
controlItemInsert windowName.controlName [-before] [-itemtext userData] [-makesubtree] [-noautoupdate] [-noexpand] [-parent handle] [-sibling itemToSearch] [-top] newItemString
This function inserts the string newItemString into a treelist or a tree control. For inserting items into a table control, provide each row as a list of strings for each column in that row.
- windowName
- specifies the name of the parent window.
- controlName
- specifies the name of the control.
- -before
- specifies that the new item needs to be inserted before the provided sibling item. Otherwise it is inserted after the item.
- -itemtext userData
- specifies to make userData as user provided data for the new item that can later be queried for.
- -makesubtree
- specifies that the new item needs to be a expandable node. An expandable node can have its own children nodes.
- -noautoupdate
- specifies not to update the control as soon as the item is inserted. User can call controlRedraw to finally redraw the control. This is very usefuly when adding many nodes at once.
- -noexpand
- specifies not to expand the newly inserted item.
- -parent handle
- specifies that handle is the handle to the parent node.
- -sibling itemToSearch
- specifies that itemToSearch is the item to first search. If -after or -top is not used, the new item is inserted after this item.
- -top
- specifies that the new item needs to be inserted at the top of all child item of the parent.
N/A
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, controlItemDelete
controlTabsAdd - add the strings as new tabs in a tab control.
Tcl Windows GUI
controlTabsAdd windowName.controlName listOfTabString
This function adds each of the string from the list of strings provided to each of the tabs of a tab control.
- windowName
- specifies the name of the window.
- controlName
- specifies the name of the control.
- listOfTabStrings
- specifies that the list of strings being provided should be added as tabs of a tab control.
N/A
controlItemPropertySet - sets the value of the specified property.
Tcl Windows GUI
controlItemPropertySet windowName.controlName [-background colorName] [-bold <0|1>] [-checkstate <0|1>] [-columnindex integer] [-displaytext string] [-expand <0|1>] [-expandable <0|1>] [-foreground colorName] [-headertext string] [-imageno integer] [-index integer] [-italic <0|1>] [-itemhandle handle] [-itemtext userData] [-noautoupdate] [-parent handle] [-readonly <0|1>] [-rootitemseditable <0|1>] [-string] [-width integer] data
This function sets the value of the specified property of an item of a control
- windowName
- specifies the name of the parent window.
- controlName
- specifies the name of the control.
- -background colorName
- sets the background color of the text for the list item or node.
- -bold 0|1
- sets the font of the text for the node to bold type or normal. 1 makes it bold and 0 normal. This option is valid in treelist and tree controls only.
- -checkstate 0|1
- specifies whether to set the checkstate of the item specifed. 1 indicates to mark it checked and 0 otherwise. This option is valid only for a checklist control.
- -col integer
- indicates the index of the column for which the propery is to be set.
- -columnindex index
- specifies that property of the column provided in a treelist control is to be set.
- -displaytext string
- sets string as the display text for the item specified using data. This option is valid in a treelist, a table, or a checklist control.
- -expand 0|1
- sets the expand state to collapsed or expanded. 0 collapes a node and 1 expands it. This option is valid in treelist controls only.
- -expandable 0|1
- specifies if the item should be made an expandable node that can itself have child nodes in a treelist control.
- -foreground colorName
- sets the foreground color of the text for the list item or node.
- -headertext string
- specifies that the string provided should be used as header text for the column indicated using -columnindex option.
- -imageno integer
- specifies the index of the image to be associated with this item from the imagelist provided using controlPropertySet in a tree control.
- -index integer
- specifies the index of the item for which the specified property should be set. this option is valid in a list or checklist control only.
- -italic 0|1
- sets the font of the text for the node to italic type or normal. 1 makes it italic and 0 normal. This option is valid in treelist and tree controls only.
- -itemhandle handle
- specifies that handle should be used as the item's handle when searching for the item data is ignored.
- -itemtext userData
- makes userData as user provided string that can be queried using controlItemPropertyGet for the item specified by data in a treelist control.
- -noautoupdate
- specifies not to update the control as soon as the item is inserted. User can call controlRedraw to finally redraw the control. This is very usefuly when adding many nodes at once.
- -parent handle
- specifies that handle should be used as the parent's handle when searching for the item specified by data.
- -readonly 0|1
- specifies that the items in the column indicated using -columnindex option should be made readonly. 1 makes them readonly and 0 makes them editable.
- -rootitemseditable 0|1
- specifies if the first column of the root item in a treelist control editable. 1 makes them editable and 0 not.
- -row integer
- indicates the index of the row for which the propery is to be set.
- -string
- specifies that the item information being provided with data is a string to search for. Otherwise it is interpreter as am index. This option is valid only for checklist controls.
- -width integer
- specifies that the integer provided should be used as width of the column indicated using -columnindex option.
- data
- in a treelist control, its the path of the item to search.
N/A
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, controlItemPropertyGet
controlItemPropertyGet - gets the property of an item in a control
Tcl Windows GUI
controlItemPropertyGet windowName.controlName [-background] [-bold] [-columnindex index] [-displaytext] [-expand] [-expandable] [-foreground] [-index integer] [-italic] [-itemhandle] [-itemtext] [-parent handle] [-string] item
This function obtains the value of the property of an item in a control.
- windowName
- specifies the name of the parent window.
- controlName
- specifies the name of the control.
- -expand
- gets the current expanded state of the specified item.
- -background
- gets the current background color of the specified by item
- -foreground
- gets the current foreground color of the specified by item
- -bold
- gets whether the text of the item is using bold face or normal.
- -italic
- gets whether the text of the item is using italic face or normal.
- -itemtext
- gets the user data that was earlier set using controlItemPropertySet or controlItemInsert. This option is valid only in tree and treelist controls.
- -displaytext
- gets the display text for item specified. If -columnindex is used it indicates the column of which the display text is being queried for.
- -itemhandle
- gets the Windows handle of the item. It is a quick of accessing the item without going through searching the whole treelist control. This handle can be used for susequent calls to controlItemPropertySet on this item.
- -expandable
- gets whether the specified item is an expandable one. Expandable nodes can have children nodes. This option is valid in treelist controls only.
- -parent handle
- spcifies to use the handle of the parent when searching for the item. This is a quick way to start searching in a treelist control without starting from the beginning allover.
- -columnindex integer
- spcifies that the property being queried is for the column specifed by index. This option is valid in treelist controls only
- -index integer
- spcifies the index of the item whose property is being queried. This option is valid in list and checklist controls only.
- -checkstate
- gets the checkstate of the item. This option is valid only in checklist controls.
- -string
- spcifies the item contains a string to search for and not an index. This option is valid onyl in checklist controls.
- item
- it is either an itempath, a string or an index (see -string).
An integer value is returned for the check state of the item in a check list controls.
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, controlItemPropertySet, controlItemInsert, controlCreate
controlTextInsert - inserts the text into a text control.
Tcl Windows GUI
controlTextInsert windowName.controlName [-bottom] [-cursor] [-top] text
This function inserts the text into a text control at a given location.
- windowName
- specifies the name of the parent window.
- controlName
- specifies the name of the control.
- -bottom
- inserts the string at the bottom of all the text in the text control.
- -cursor
- inserts the string at the current cursor location moving any text.
- -top
- inserts the string at the top of all the text in the text control.
- text
- text to be inserted in the text control.
N/A
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control
UITcl Library, controlValuesSet, controlTextSet
controlCreate - creates a control in a Tcl window, dialog, or toolbar
Tcl Windows GUI
controlCreate windowName controlSpec itemType [-x xPos] [-y yPos] [-width width] [-height height] [-border] [-callback callBack] [-cmduicallback cmduiCallBack] [-disabled] [-fixed] [-helpid helpID] [-hidden] [-name ctrlName] [-title ctrlTitle] [-tooltip tooltipText]
Use this function to create a control with the specified characteristics in the specified window.
- windowName
- specifies the parent window.
- controlSpec
- is the control specification. See below.
- itemType
- Following are different types of controls that can be created:
animation An animation control is a rectangular window that displays a clip in AVI (Audio Video Interleaved) format-the standard Windows video/audio format. An AVI clip is a series of bitmap frames, like a movie. bitmap A bitmap control is similar to a label control but it can display bitmaps instead of text. boolean A checkbox that is similar to a button but has a check box on the left and text on the right. The check box can be turned on or off by clicking over it. button A pushbutton control provides the functionality of Windows button controls. A button control is a small, rectangular child window that can be clicked on and off. checklist A checklist control displays a list of items, such as filenames. Each item in the list has a check box next to it that the user can check or clear. choice A radio button is similar to a boolean control. choice controls can be grouped to have check only on any one of them at any given time. combobox A combobox consists of a list box combined with either a static non-editable text control or a regular editable text control. The list-box portion of the control may be displayed at all times or may only drop down when the user selects the drop-down arrow next to the control. The currently selected item (if any) in the list box is displayed in the static or text control. In addition, if the combobox has -editable option specified, the user can type the initial character of one of the items in the list, and the list box, if visible, will highlight the next item with that initial character. frame a hollow rectangle when colored border. hierarchy A hierarchy is same as a tree control. This has been provided for backward compatibility. group A group control is similar to a frame but has text associated with it. It can display the text at the top of the frame. A group is used to group controls and place them in its client area. label A label can display text to label other controls that can take input list A list control can display a list of items, such as filenames, that the user can view and select. In a single-selection list control, the user can select only one item. In a multiple-selection list control, a range of items can be selected. When the user selects an item, it is highlighted and the list control sends a notification event. meter A control is similar to a progressmeter. It can also display label at the bottomleft and bottomright corners specifying start and end of the measure. progressmeter A progressmeter control is a window that an application can use to indicate the progress of a lengthy operation. It consists of a rectangle that is gradually filled, from left to right, with the user defined colors as an operation progresses. rectangle a colored solid box tab A tab control is analogous to the dividers in a notebook or the labels in a file cabinet. By using a tab control, an application can define multiple pages for the same area of a window or dialog box. Each page consists of a set of information or a group of controls that the application displays when the user selects the corresponding tab. A special type of tab control displays tabs that look like buttons. Clicking a button should immediately perform a command instead of displaying a page. table A table control can display a collection of items each consisting of an icon and a label. Each item appears on its own line with information arranged in columns. The leftmost column contains the small icon and label, and subsequent columns contain subitems as specified by the application. Each of the columns can have their header by specifying the option -columnheader. text Text control provides the functionality of a Windows edit control. A text control is a rectangular child window in which the user can enter text. toolbarbutton A toolbarbutton is a special kind of button that can be displayed over a toolbar. Unlike regular push buttons, it can be of type toggle. tree A tree control is a window that displays a hierarchical list of items, such as the headings in a document, the entries in an index, or the files and directories on a disk. Each item consists of a label and an optional bitmapped image, and each item can have a list of subitems associated with it. By clicking an item, the user can expand and collapse the associated list of subitems. treelist A treelist control is a combination of a tree control and a table control. The leftmost column can display items in a hierarchy. Like the table control, treelist control can have multiple columns.
- -border
- specifies that the control should have a border. Some controls already have a border by default.
- -callback callBack
- provides a means to attach an action to a control.
- -cmduicallback cmduiCallBack
- specifies that cmduiCallBack should be used when the state of the control needs to be updated at idle time. This is useful especially for toolbar controls. Following is an example for a cmdui callback script.
- -disabled
- specifies that the control should be created as disabled. It can be enabled later using controlEnable command.
- -fixed
- specifies that the control should be created using the fixed pitch font.
- -helpid helpID
- helpID is used to search in the help file for help on the control.
- -name ctrlName
- a unique name for the control. This name can be used to manipulate the after its creation (for example, checking a button's state).
- -title
- the provided string is used as text or data for the control. This is the text that is displayed for a label, a group, a boolean or a button.
- -tooltip tooltipText
- specifies that tooltipText should be used when tooltip need to be displayed for the control.
- -x|pos integer, -y|pos integer, -w|idth integer, and -h|eight integer
- specify the position and size for the new control in dialog units. If omitted, they are given default values.
proc onCmdUICB_myCtrl {} { global enableflag ;# a global variable created before invoking this ;# script global checkflag ;# a global variable created before invoking this ;# script set enableflag 0 ;# disable the control, 1 to enable set checkflag 1 ;# lets set the toolbarbutton in depressed state. return $enableflag }
Following are other options that are specific to certain control.
- animation
-autoplay Specifies that the image should be automatically played when the control becomes visible. Otherwise use controlPropertySet with -playstate option to start or stop playing. -avifile filePath Specifies the path to the avi image file to play the animation. -center Specifies that the image provided should be centered in the place provided for the control -transparent Specifies that the background of the image should be ignored and parent window's background should be used instead when drawing the images.
- bitmap
-bitmap filePath or -title filePath Specifies to use the bitmap file as the image. -clip Specifies that the image should be clipped to fit the size of the control if the size of the control is smaller than the size of the image. -fade filePath Specifies to use the provided bitmap as the fading bitmap -stretch Specifies that the image should be stretched if the control size if larger than the image size to fit the size of the control.
- boolean
-auto Turns on or off automatically when the user clicks on the check box or radio button. If this option is not specified, the check box or radio button has to be checked or unchecked programatically. -newgroup Specifies the first control of a group of controls in which the user can move from one control to the next with the arrow keys. All boolean controls that do not specify this option after the first control belong to the same group. The next boolean control with the -newgroup option starts the next group (that is, one group ends where the next begins).
- button
-bitmap Specified that the button can display bitmaps for various state of the bitmap. The various state for which bitmap can be displayed are, enabled state, depressed state, when the button has focus, when the mouse focus is over the button, disabled state. The bitmaps can be specified using proper options. -defaultbutton Specifies that this button be made the default button in the parent dialog. Any key press on Enter key is redirected to this button by default. -disabledbmp filePath Specifies the path to the bitmap file that should be shown when the button is in disabled state. -downbmp filePath Specifies the path to the bitmap file that should be shown when the button is in depressed state. -focusbmp filePath Specifies the path to the bitmap file that should be shown when has the keyboard focus. -helpbutton Specifies that this button be made the help button. Pressing this button automatically brings help on the parent window. -menubutton Specifies that this button be made a menu button. A menu can be associate with this button that can be displayed when the button is clicked by the user. The the button is clicked, a global variable, gMenuToShow is made visible to the script to set. This variable should be set with the name of the menu to be shown when the script returns. Menu can be created using menuCreate command. -mousefocusbmp filePath Specifies the path to the bitmap file that should be shown when the button has mouse focus that is the mouse pointer is over the button -normalbmp filePath Specifies the bitmap that should be shown in a normal state.
- frame or rectangle
-gray or -white or -black Specifies the color of the border of the frame or the fill color of the rectangle.
- hierarchy
-initial Specifies the initial to use of the hierarchy control. See controlStructureSet for the format of the structure.
- label
-left, -center or -right Specifies the justification of the text for the label control. -title string Specifies the string to be displayed in the label control. -vcenter Specifies that the text be vertically centered if the height of the label control is larger than the text height.
- list and checklist
-customcolors Specifies that each of the items in the list box can have their own background and foreground colors. This option is not valid for checklist control. -expandtabs Specifies that any tab characters embedded in the strings should be expanded to spaces before being displayed. If this option is not used, tab characters are shown as non printable characters. This option is not valid for checklist control. -extendedsel Specifies that the user can select multiple items using the SHIFT key and the mouse or special key combinations. -multisel Specifies that list box string selection is toggled each time the user clicks or double-clicks the string. Any number of strings can be selected. -nointegralheight Specifies that the size of the list box is exactly the size specified by the application when it created the list box. Usually, Windows sizes a list box so that the list box does not display partial items. -orderable Specifies that the items in the list box are orderable by using mouse and dragging them around to change their appearance order. This option is not valid for checklist control. -sort Specifies that the strings in the list box are sorted alphabetically
- list
-autocompletion Specifies that the text be autocompleted from the items already in the list box. If this option is specified, the control automatically finds the string that matches the characters that are being typed by the user. -editable Specifies that the list box should not displayed unless the user selects an icon next to the text control that is editable. If this option is not used, the text in the text control is not editable. -lowercase Specifies that the text entered in the text control of the combobox be converted to lowercase. -noautoadd Specifies to not automatically add the strings when the user presses ENTER key after typing text in the text control. -nodrop Specifies that the list box is displayed at all times. The current selection in the list box is displayed in the edit control. -nointegralheight Specifies that the size of the combobox is exactly the size specified by the application when it created the combobox. Usually, Windows sizes a combobox so that the combobox does not display partial items. -sort Specifies that the strings in the combobox are sorted alphabetically -uppercase specifies that the text entered in the text control of the combobox be converted to uppercase.
- meter or progressmeter
-left, -center or -right Specifies the justification of the text for the meter control. -title string or -initial string Specifies the text to be displayed in the meter control.
- tab
-bottom Specifies that the tabs should appear at the bottom of the control -buttons Specifies that tabs appear as buttons and no border is drawn around the display area. -fixedwidth Secifies that all tabs are the same width. -hottrack Secifies that the items under the pointer are automatically highlighted. -multiline Specifies to display multiple rows of tabs, if necessary, so all tabs are visible at once. -singleline Specifies to displays only one row of tabs. The user can scroll to see more tabs, if necessary. -tabs Specifies that tabs appear as tabs and that a border is drawn around the display area. -tooltips Specifies that the tab control show tooltips automatically. -vertical Specifies that the tabs appear at the left side of the control, with tab text displayed vertically. This option is valid only when used with the -multiline option. To make tabs appear on the right side of the control, also use the -bottom option.
- table
-columns integer Specifies the number of columns for the table control. -columnheader Specifies that a column header is displayed otherwise no column header is displayed -initial initialList Specifies the text that should be displayed initially. It has to be in the form of list of lists. -multisel Specifies that it should allow multiple items to be selected at a time otherwise it allows only one item at a time to be selected -sortascending Specifies that items be sorted in ascending order based on item text. -sortdescending Specifies that items be sorted in descending order based on item text. -sortheader Specifies that column headers work like buttons. This option can be to used to specify that the control should sort the items if user clicks a column header.
- text
-autovscroll Specifies that the text should automatically scroll up one page when the user presses ENTER key. -initial string Specifies the text to be displayed initially when the control is visible. -hscroll Specifies that the control should display a horizontal scroll bar. This is useful when the lines in a multiline text control are longer than can be displayed. -multiline Specifies that the text control should show multiple-lines. If the -autovscroll option is specified, the text control shows as many lines as possible and scrolls vertically when the user presses the ENTER key. If -autovscroll option is not given, the text control shows as many lines as possible and beeps if ENTER is pressed when no more lines can be displayed. The text control automatically scrolls horizontally when the caret goes past the right edge of the control. To start a new line, the user must press ENTER. The control automatically wraps words to the beginning of the next line when necessary; a new line is also started if ENTER is pressed. The position of the wordwrap is determined by the control size. If the control size changes, the wordwrap position changes and the text is redisplayed. -noautohscroll Specifies that the text should not automatically scroll to the right when the user types a character at the end of the line. -password Specifies that all characters should be displayed as asterisks (*) as they are typed into the text control. -readonly Specifies that it should prevent the user from entering or editing text in the text control. -textlimit integer Specifies the limit on number of characters that can be displayed in the control. -vscroll Specifies that the control should display a vertical scroll bar. This is useful when the number of lines in a multiline text control is more than can be displayed. -wantenter Specifies that a carriage return be inserted when the user presses the ENTER key while entering text into a multiple-line text control in a dialog box. Without this option, pressing the ENTER key has the same effect as pressing the dialog box's default pushbutton. This option has no effect on a single-line text control.
- toolbarbutton
-bitmap filePath Specifies the width of the button in dialog units. -pressed Specifies that the button have initial state of pressed. This is valid only if the button was created using -toggle. -separator Specifies that the button actually be a separator between two buttons. Separators are spaces between two buttons. They generate no events and their state cannot be changed. -toggle Specifies that the button be a toggle button. -width integer Specifies the width of the button in dialog units.
- tree
-editable Makes the nodes in-place editable. -initial treeNodesList Specifies the hierarchy of the nodes to be inserted when the control is first created. controlItemInsert can be used to insert more nodes.
- treelist
-columns Specifies the number of columns in the treelist control.
UITcl Library, dialogCreate, windowCreate, allControlsDestroy
controlDestroy - destroys a control in a dialog or window
Tcl Windows GUI
controlDestroy windowName.controlName
This function destroys the specified control in a dialog or window, freeing any associated internal resources.
- windowName
- specifies the name of the parent window.
- controlName
- specifies the name of the control.
N/A
- missing required control name in routine
- unable to locate window name window
- unable to locate control name control