Tk

Table Of Contents

Introduction

Tkinter is a thin object-oriented layer on top of Tcl/Tk. It has the advantage of being included with the Python standard library, making it the most convenient and compatible toolkit to program with.

Tk comes with 17 widgets, eleven of which exists in tkinter: Button, Checkbutton, Entry, Frame, Label, LableFrame, Menubutton, PanedWindow, Radiobutton, Scale and Scrollbar. The other six are new: Combobox, Notebook, Progressbar, Separator, Sizegrip and treeview. All of the are subclasses of Widget.

Note: Tkinter is part of the core when Python is installed. You don't need to install it separately.

Some Useful Tk Definitions

What Version Of Tk Am I Using?

On the command line enter:

echo 'puts $tcl_version;exit 0' | tclsh

To get the exact version of Tcl/Tk enter: (run Python in interactive mode)

python3
>>>import tkinter
>>>tkinter.Tcl().eval('info patchlevel')

Project #1

Create a color chart of the named colors

Project #2

Display examples of fonts

Project #3

Create a GUI that will execute system commands

Project #4

Fix a simple calculator GUI

Project #5

Create a simple dashboard

Project #6

Create simple card games

Tk Program Template

Tk Program Template

Tk Development Demo

If possible the instructor should demonstrate the development process described here.

Tk Development Demo

Links, etc.

Links, etc.

Notes

1. Python2 has tkFont - Python 3 has tkinter.font.