HM-8010: Add a Button
In this exercise, you will create a button on the User page that will launch the lighting.tcl dialog from the HyperMesh installation.
Command files and Tcl/Tk scripts can be added to the userpage.mac file. When HyperMesh starts, it first looks for the userpage.mac file in the directory from which it launches, and then in the installation directory. Unix users also have the option of putting the userpage.mac file in their home directory.
*createbutton(page, name, row,
column, width, COLOR, helpString, macroName [ , arg1 … ])
Item | Description |
---|---|
page | The page number on which the button is to appear. For the User page, this value is 5. |
name | The text to display on the button, enclosed in quotes: " ". |
row | The row in which to place the button. The number of visible rows depends on your monitor’s graphics resolution. A positive value indicates an absolute row number. A 0 indicates the next highest available row. A negative value indicates the number of rows to skip. Rows begin at the bottom of the menu. |
column | The column where the button starts (0-10). Columns begin to the right of the menu. |
width | The width of the button (max = 10). |
COLOR | The color of the button. The available button colors are: RED, BLUE, GREEN, CYAN, MAGENTA, YELLOW, GRAY, and BUTTON (background). The color name must appear in capital letters. |
helpString | The string to be displayed in the menu bar when the middle mouse button is pressed and the button is clicked, enclosed in quotes: " ". |
macroName | The command to run when the button is pressed, enclosed in quotes: " ". |
arg1... | A list of optional arguments passed to the script. |
Create the File
In this step you will create a file called userpage.mac.
When HyperMesh starts, it first looks for the userpage.mac file in the directory from which it launches and then in the installation directory. On Windows, the default launch directory is in the My Documents folder. Unix users also have the option of putting the userpage.mac file in their home directory. It is not recommended to modify the userpage.mac file in the installation directory.
Add the Command to Create a Button
In this step you will add the command to create a button.
Load the Updated File
In this step you will load the updated userpage.mac file.