Tkinter adding combobox selection and text widget value and displaying the sum in a Label

preview_player
Показать описание
00:27 Layout design by adding components
03:30 Click event of the button to trigger the my_upd() function
04:12 Function my_upd() coding
07:04 Adding trace method to trigger my_upd()

We can read the value of selection or as entered by user in one Combobox. This value we can then add to Text widget entry value and display the sum in a Label by using config() method.

Combobox value is collected by using one IntVar() and similarly we will collect user entered data of a text widget.

Inside a function my_upd() we will read the values of these two widgets and generate the sum of two values.
Before adding the values we will convert the text widget value to integer and then add.
By using config() method of Label we will update the text value to reflect the sum of this two inputs.

Download the source code from here

#sumofComboboxText #TkinterSumCombobox #TkinterConfig #addingInputs #plus2net #python
Рекомендации по теме
Комментарии
Автор

Hi sir, I've doubt in this combo box.. could you explain this?.. (my project is calculation of concrete), I've the option like (m10, m15, m20, m25) this are my options, if i selected any one of this option, it will run my code and show in output of screen, how could command this?

lifes