Extra GUI tools in TCL
Tool Command Language (Tcl) is a robust scripting language with programming elements. It is accessible on the Windows, Mac OS, and Unix operating systems.
Extra GUI tools in TCL
Tool Command Language (Tcl) is a robust scripting language with programming elements. It is accessible on the Windows, Mac OS, and Unix operating systems. Tcl is used for scripting applications, graphical user interfaces (GUI), networking, administration, testing, and web applications. There are a few other extra options available in the TCL. We will discuss all the extra options such as adding the image, creating the combo box, and creating the new window in the hypermesh GUI in this article.
1. How to Create a Combo Box in the Tcl
Combo box :
It is a type of entry box where the user has to select predefined values that are set by the developer. For example, while selecting the card image in the property, we have only predefined values such as PShell, PBar, etc.

Fig.1 combo box
In the above image, we can see the pre-defined values kg,g, and Mg after clicking the entry box.
Syntax :
combobox Window Variable -textvariable variablename -values list extra parameters

Fig.2 combo box code
As the combo box should be created inside the window, we need to write a code for the window creation. Next, we should use the Combobox command as I mentioned above,
- Window variable: We used to save the window name in a variable so you have to mention that variable with a number. In fig 2, the window name is got1 so we used the same variable with a number in the Combobox line.
- Variable name: In this variable, the selection will be saved. If we change the selection frequently, that will be updated here.
- List: It takes only a list not an array. Either we can declare the list next to the values or we can save the list in a variable and can use the variable name here
Difference between the list and array in Tcl :
- List - set a [list 1 2 3 4]
- Array - set a {1,2,3,4}
- Extra parameter: It is nothing but adding the background color to the text, adding justify to the text, changing the font size, etc
Note: It also needs the place command like the other button
2. Adding an Image in the Window

Fig.3 code snippet
In this section, we will see how to add the image to the button or label.
The syntax for image creation in Tcl:
Set variable_name [image create imgobj -file “FIlepath” -width size -height size]
- Filepath: It is the path of the image that we want to add to the button. Width size and height size depend on the window size. By using this value, the image will be resized in tcl. The file path should be with a forward slash C:/Users/Skill-Lync/Downloads/photo.
In the button, instead of the text, we can use the image that will be displayed on the button.
3. How to create a user-defined tab in Hypermesh by using the Tcl command

Fig 4. Code for new window
- hm_framework removetab “Roof” - which is used to delete the existing tab with that name.
- In the second line, We saved the window name in a variable
- hm_framework addtab “Roof” [frame $top] - which is used to create a new tab with the name that we mentioned.
- We can also add the button,label,entry etc in the new tab also by using the existing commands that we know.