Menu

Workshops

Projects

Blogs

Careers

Hire from us


For Business / Universities

Corporate Training

Academic Up-skilling


All Courses

Choose a category

Loading...

All Courses / undefined

All Courses / undefined / undefined

logo

Loading...

FOR BUSINESSES

Corporate Upskilling

FOR Universities

Academic Training

More

CSE

Uploaded on

11 Jul 2022

Extra GUI tools in TCL

logo

Skill-Lync

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 -fileFIlepath” -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.

 

 

 


Author

author

Navin Baskar


Author

blogdetails

Skill-Lync

img

Continue Reading

Related Blogs

Christmas Time is Near, Time for Joy and Time for Cheer.

Premium Master’s Program can do so at a discount of 20%. But, Christmas is time for sharing, therefore if you and your friend were to join any Skill-Lync Master’s Program together, both of you will get a discount of 30% on the course fee of your Premium Master’s Program

CSE

24 Dec 2021


Career Prospects For Software Engineers

Increase your career opportunities by becoming a software engineer and make the world a better place. Enroll in upskilling courses and practice the skills you learn.

CSE

27 Dec 2021


Suggested Career Path For A Software Developer

Software development is rated as the best job in the industry. Individuals with the right software development skills, good communication, and an open mind to adapt, learn, and evolve can find success in the field.

CSE

28 Dec 2021


7 best Java Project Ideas To Showcase Your Programming Skills

If you aspire for a career in the software development space, upskilling yourself with the knowledge and practical application of programming languages is mandatory.

CSE

29 Dec 2021


Why choose a career in computer science?

The most fascinating thing about the chosen ways of completing tasks on computers is that we only choose them because we do not have a simpler way yet.

CSE

30 Dec 2021



Author

blogdetails

Skill-Lync

img

Continue Reading

Related Blogs

Christmas Time is Near, Time for Joy and Time for Cheer.

Premium Master’s Program can do so at a discount of 20%. But, Christmas is time for sharing, therefore if you and your friend were to join any Skill-Lync Master’s Program together, both of you will get a discount of 30% on the course fee of your Premium Master’s Program

CSE

24 Dec 2021


Career Prospects For Software Engineers

Increase your career opportunities by becoming a software engineer and make the world a better place. Enroll in upskilling courses and practice the skills you learn.

CSE

27 Dec 2021


Suggested Career Path For A Software Developer

Software development is rated as the best job in the industry. Individuals with the right software development skills, good communication, and an open mind to adapt, learn, and evolve can find success in the field.

CSE

28 Dec 2021


7 best Java Project Ideas To Showcase Your Programming Skills

If you aspire for a career in the software development space, upskilling yourself with the knowledge and practical application of programming languages is mandatory.

CSE

29 Dec 2021


Why choose a career in computer science?

The most fascinating thing about the chosen ways of completing tasks on computers is that we only choose them because we do not have a simpler way yet.

CSE

30 Dec 2021


Related Courses

https://d28ljev2bhqcfz.cloudfront.net/maincourse/thumb/computational-combustion-python-cantera_1636553291.png
Computational Combustion using Python and Cantera
4.9
9 Hours of content
Cfd Domain
Know more
Showing 1 of 4 courses
Try our top engineering courses, projects & workshops today!Book a FREE Demo