Python 3 tkinter Spinbox GUI Program Example

By | March 24, 2020

Topic: Python 3 tkinter Spinbox GUI Program Example

This Python GUI program using tkinter GUI package, shows the use of Spinbox widget. As the proggram is in execution state, its GUI main window will wait for user input. If the user will change the spinbox value by increasing or decreasing, the font size of label control’s text will also change accordingly.

The value in Spinbox widget is directly linked to font size. If the value in spinbox widget is 20, then fontsize of label widget will also be 20 and so on.

Python 3 tkinter Spinbox GUI Program Example

Python 3 tkinter Spinbox GUI Program Example


# Python 3 GUI program
# using Spinbox and Label
# widgets to increase font size
# of label by Spinbox change

from tkinter import*

def main():
    main_window = Tk()
    main_window.resizable(0, 0) 

    main_window.title('tkinter SpinBox Example')

    label1 = Label(main_window, text="Spin Box Example")

    label1.config(bg='green', fg='white', font=('verdana', 10))                  

   , y=50)

    def change_fontsize():
        font_size = int(spinbox1.get())
    label2 = Label(text="Increase / Decrease Font Size with Spinbox"),y=225)
    spinbox1 = Spinbox(main_window, from_=10, to=20,

    label2 = Label(text="",


Leave a Reply

Your email address will not be published. Required fields are marked *