::AddToolbarIcon
This command will create a new toolbar and add an icon to the toolbar.
Syntax
::model::AddToolbarIcon toolbarname iconImagePath tcl_source_file [procname] [tip_text]
Application
MotionView Tcl
Description
This command will create a new toolbar in MotionView and will add an icon into it. The icon needs to be associated with a Tcl source file and optionally a procedure command within the source file. A tip text can also be optionally specified.
More than one icon can be added to a toolbar by using this command with the same toolbarname previously created.
Icons cannot be added to standard toolbars available in MotionView by default.
Inputs
- toolbarname
- Name for the toolbar to which the icon will be added.
- iconImagePath
- File path location of the image file.
- source_file
- Tcl file that would be associated with the icon.
- procname
- Procedure name within the source_file to be called when the icon is clicked.
- tip_text
- Optional text for the tooltip.
Example
::model::ToolbarIcon “Custom Panels” “C:/Training/script/images/panel1.png” “C:/Training/script/mypanel.tcl” showPanel “Panel1”
# Adds a toolbar named “Custom Panels” with an icon.
Clicking the icon sources the tcl file mypanel.tcl and executes showPanel1 procedure within the tcl
::model::ToolbarIcon “Custom Panels” “C:/Training/script/images/panel2.png” “C:/user/Training/script/mypanel.tcl” showPane2 “Panel2”
# This command when used subsequent to the above example would add another icon to “Custom Panels” toolbar.
Errors
None.