CS22 OOP2 Module 9
CS22 OOP2 Module 9
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.
Page 1 of 3
CS22-OOP2(Object Oriented Programming 2)
College of Computer Studies
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