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

CS22 OOP2 Module 9

This document is a lesson plan for a course on Object Oriented Programming, focusing on Tkinter, the standard GUI toolkit for Python. It outlines key concepts such as widgets, geometry management methods (pack, grid, place), and provides descriptions of various Tkinter widgets. The lesson aims to help students understand and create graphical user interfaces using Tkinter.

Uploaded by

Xander Pardico
Copyright
© © All Rights Reserved
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% found this document useful (0 votes)
5 views3 pages

CS22 OOP2 Module 9

This document is a lesson plan for a course on Object Oriented Programming, focusing on Tkinter, the standard GUI toolkit for Python. It outlines key concepts such as widgets, geometry management methods (pack, grid, place), and provides descriptions of various Tkinter widgets. The lesson aims to help students understand and create graphical user interfaces using Tkinter.

Uploaded by

Xander Pardico
Copyright
© © All Rights Reserved
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/ 3

CS22-OOP2(Object Oriented Programming 2)

College of Computer Studies

I. INTRODUCTION
In this lesson.

II. OBJECTIVES
1. Define and understand key GUI concepts such
Module 9 as widgets, frames, and event-driven
programming. Explain the advantages of
using a GUI for application development.
TKINTER AND BASIC 2. Understand the basics of Tkinter, the
standard GUI toolkit for Python.
WIDGETS 3. Understand how to use pack, grid, and place
geometry managers to organize widgets
within a GUI. Create and customize simple
widgets.

III. PRELIMINARY ACTIVITIES


Recap on previous topic and identify its relation with the next lesson.

IV. LESSON PROPER


PYTHON GUI’S (GRAPHICAL USERS INTERFACES)
TKINTER WIDGETS
Tkinter is Python’s standard GUI (Graphical User Interface) package. tkinter
provides us with a variety of common GUI elements which we can use to build out
interface – such as buttons, menus and various kind of entry fields and display areas. We
call these elements Widgets.
In general, Widget is an element of Graphical User Interface (GUI) that
displays/illustrates information or gives a way for the user to interact with the OS. In
Tkinter, Widgets are objects; instances of classes that represent buttons, frames, and so
on.

Page 1 of 3
CS22-OOP2(Object Oriented Programming 2)
College of Computer Studies

Tkinter supports the below mentioned core widgets –


Widgets Description
Label It is used to display text or image on the screen
Button It is used to add buttons to your application
Canvas It is used to draw pictures and others layouts like texts, graphics etc.
ComboBox It contains a down arrow to select from list of available options
It displays a number of options to the user as toggle buttons from which
CheckButton
user can select any number of options.
It is used to implement one-of-many selection as it allows only one
Radio Button
option to be selected
Entry It is used to input single line text entry from user
Frame It is used as container to hold and organize the widgets
It works same as that of label and refers to multi-line and non-editable
Message
text
It is used to provide a graphical slider which allows to select any value
Scale
from that scale
Scrollbar It is used to scroll down the contents. It provides a slide controller.
SpinBox It is allowing user to select from given set of values
It allows user to edit multiline text and format the way it has to be
Text
displayed
Menu It is used to create all kinds of menu used by an application

Page 2 of 3
CS22-OOP2(Object Oriented Programming 2)
College of Computer Studies

Geometry Management -
Creating a new widget doesn’t mean that it will appear on the screen. To display
it, we need to call a special method: either grid, pack (example above), or place.

Method Description
pack() The Pack geometry manager packs widgets in rows or columns.
The Grid geometry manager puts the widgets in a 2-dimensional table.
grid() The master widget is split into a number of rows and columns, and each
“cell” in the resulting table can hold a widget.
The Place geometry manager is the simplest of the three general
geometry managers provided in Tkinter.
place()
It allows you explicitly set the position and size of a window, either in
absolute terms, or relative to another window.

V. PRACTICE EXERCISES/ACTIVITIES
VI. ADDITIONAL RESOURCES
VII. ASSESSMENT
VIII. REFERENCES
o Allen B. Downey, ``Think Python: How to Think Like a Computer Scientist‘‘, 2nd edition,
Updated for Python 3, Shroff/O‘Reilly Publishers, 2016
https://www.stat.berkeley.edu/~spector/python.pdf

o https://www.geeksforgeeks.org/what-are-widgets-in-tkinter/

Page 3 of 3

You might also like