MCS 260 Fall 2020
Emily Dumas
Idle is a graphical code development environment (or integrated development environment, IDE) for Python.
It is the officially-supported IDE for Python.
Continue working on the GUI for the letter rotation code we developed in Lecture 36 & Lecture 38.
So far: Built GUI controls, set up one callback.
Remaining: More callbacks to make slider display and slider work.
tkinter
has its own variable classes (StringVar
, IntVar
, DoubleVar
) with .get()
, .set(...)
.
Widgets support these, e.g. with Label
widget's textvariable
constructor argument.
Can ask to call a function of three arguments when a variable is changed:
varobj.trace_add("write",func_to_call)
tkinter.Tk
has a method .title(s)
which sets the window title to s
.
The window title is usually shown in the window's top bar, and possibly in a dock/taskbar as well.
This widget's constructor accepts many args, including:
from_
— minimum valueto
— maximum valuevariable
— variable in which to store slider valuecommand
— function to call on changeA big topic we didn't discuss is adding menus to tkinter applications.
TkDocs has a nice discussion and tutorial.