0% found this document useful (0 votes)
3 views3 pages

TKinter PDF For Python Class

The document provides an overview of Tkinter layout managers and widgets, detailing how each layout manager (pack, grid, place) functions and their best use cases. It also lists various widgets categorized into display, input, selection, actions, containers, graphics, and menus, along with simple explanations and examples for each. Additionally, a summary table highlights the most important widgets in each category.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views3 pages

TKinter PDF For Python Class

The document provides an overview of Tkinter layout managers and widgets, detailing how each layout manager (pack, grid, place) functions and their best use cases. It also lists various widgets categorized into display, input, selection, actions, containers, graphics, and menus, along with simple explanations and examples for each. Additionally, a summary table highlights the most important widgets in each category.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

TKINTER LAYOUT MANAGERS

Layout Meaning How It Works Best For Example

Places widgets in
Automatic
pack() top/bottom/left/right Simple UIs [Link](side="top")
layout
order

Forms, login
Table Places widgets in rows & [Link](row=0,
grid() screens,
layout columns column=1)
calculators

Exact Games, [Link](x=100,


place() Use x, y coordinates
position custom UI y=50)

TKINTER WIDGETS

Display Widgets

Widget What It Does Simple Explanation Example

Shows text or
Label Like a title or message Label(root, text="Hello")
image

Auto-wrapping Like Label but better for long Message(root, text="Long


Message
text text text")

Input Widgets

Widget What It Does Simple Explanation Example

For name, email, number,


Entry One-line input Entry(root)
etc.

Multi-line
Text Like a mini notepad Text(root)
input

Number Up/down arrows to choose


Spinbox Spinbox(root, from_=1, to=10)
selector value
Widget What It Does Simple Explanation Example

Drag left-right or up-down


Scale Slider control Scale(root, from_=0, to=100)
for value

Checkbutton(root,
Checkbutton Checkbox ON/OFF option
text="Accept")

Radiobutton(root, text="Male",
Radiobutton Single choice Select only one from many
value=1)

Listbox List of items Click to choose items Listbox(root)

Combobox
Dropdown list Click to open a list of choices [Link](root, values=[...])
(ttk)

Button Widgets

Widget What It Does Simple Explanation Example

Button Clickable button Runs a function when clicked Button(root, text="Click Me")

Container Widgets

Widget What It Does Simple Explanation Example

Frame Groups widgets A box that holds other widgets Frame(root)

LabelFrame(root,
LabelFrame Frame with a title Same as Frame but with heading
text="Options")

Toplevel New window Opens a popup window Toplevel(root)

Menu Widgets

Widget What It Does Simple Explanation Example

Menu Menu bar File / Edit / View menu Menu(root)


Graphics Widgets

Widget What It Does Simple Explanation Example

For drawing, custom UI, Canvas(root, width=300,


Canvas Draw shapes or images
animations height=300)

Extra (ttk)

Widget What It Does Simple Explanation Example

Notebook Tabs Like browser tabs [Link](root)

SUPER QUICK SUMMARY TABLE

Category Most Important Widgets

Display Label

Input Entry, Text, Combobox

Selection Checkbutton, Radiobutton, Listbox

Actions Button

Containers Frame, Toplevel

Layouts pack(), grid(), place()

Graphics Canvas

Menus Menu

You might also like