This document discusses how to create and add various common GUI widgets to a Tkinter application in Python. It covers labels, buttons, text entry boxes, drop-down menus, checkboxes, radio buttons, text areas, message boxes, spin boxes, progress bars, file selection dialogs, menus, tabs, and padding/spacing of widgets. The document provides code examples for initializing and configuring many of these widgets.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
35 views2 pages
Toro
This document discusses how to create and add various common GUI widgets to a Tkinter application in Python. It covers labels, buttons, text entry boxes, drop-down menus, checkboxes, radio buttons, text areas, message boxes, spin boxes, progress bars, file selection dialogs, menus, tabs, and padding/spacing of widgets. The document provides code examples for initializing and configuring many of these widgets.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2
jhgjhgjhgjhg
Dfljsdgsdglkasdl
asfasf
wegsdgsdgsdfg
sdgsdgsdg
Table of Contents [hide]
1 Create your first GUI application 2 Create a label widget o 2.1 Set label font size o 2.2 Setting window size 3 Adding a button widget o 3.1 Change button foreground and background colors o 3.2 Handle button click event 4 Get input using Entry class (Tkinter textbox) o 4.1 Set focus to entry widget o 4.2 Disable entry widget 5 Add a combobox widget 6 Add a Checkbutton widget (Tkinter checkbox) o 6.1 Set check state of a Checkbutton 7 Add radio buttons widgets o 7.1 Get radio button value (selected radio button) 8 Add a ScrolledText widget (Tkinter textarea) o 8.1 Set scrolledtext content o 8.2 Delete/Clear scrolledtext content 9 Create a MessageBox o 9.1 Show warning and error messages o 9.2 Show askquestion dialogs 10 Add a SpinBox (numbers widget) o 10.1 Set default value for Spinbox 11 Add a Progressbar widget o 11.1 Change Progressbar color 12 Add a filedialog (file & directory chooser) o 12.1 Specify file types (filter file extensions) 13 Add a Menu bar 14 Add a Notebook widget (tab control) o 14.1 Add widgets to Notebooks 15 Add spacing for widgets (padding)
se the progressbar class like this:
1 from tkinter.ttk import Progressbar
2 3 bar = Progressbar(window, length=200) You can set the progress bar value like this:
bar['value'] = 70 You can set this value based on any process you want like downloading a file or completing a task.