[Tutor] learning Tkinter

mikalzet@libero.it mikalzet@libero.it
Sat, 23 Mar 2002 14:47:52 +0100 (CET)


So, every couple of weeks or so I find an odd hour for python and I keep
on imagining how my python-shift program could be.

Lately I've been trying to face tkinter, but I'm finding it far harder
than anything else, probably not because it is complicated in itself but
because I'm not finding the type of documentation I'd like.
In fact, seems like tkinter is almost a different language.
On line references pore for pages and pages over dozens of options for
each possible widget ... which is something I would like to face after
having understood how these tie in with the rest of a program.
Being a complete beginner I would like a tutorial to explain WHY things
have to be written in a certain way.
In fact the only useful type of thing I've found so far is Alan Gauld's
chapters on event driven programming and GUI programming with tkinter.
Even he is still too obscure for REAL beginners with GENUINE brick heads
like me; for instance he has this code:

class KeysApp(Frame):
# all right, I create a new class which inherits from class Frame
	def __init__(self):
# why not just def __init__(): or def __init__(other): ?
	self.txtBox=Text(self)
# I create an instance of Text widget which I call txtBox
# 'self' again appears twice - I could memorize this and accept it
# as an article of faith but I would really prefer to understand what
# it means
	self.txtBox.bind("<space>", self.doQuitEvent)
# bind is a method which takes two parameters ? I suppose documentation on
# bind will explain this somewhere - but if the example explained it would
# be easier
	etc. etc.

Anybody know of any resource like 'explaining tkinter to elementary school
children' ?

-- 
Michele Alzetta