Tkinter scrolling canvas questions

Richard Kuhns rjkuhns at geetel.net
Wed Nov 27 10:53:31 EST 2002


I'd appreciate any comments or suggestions on the best way to proceed with
a problem.  I'm fairly new to GUI programming, and I'd appreciate some
pointers.

I have a list of lists of (name, variable) tuples I'd like to display.  In
addition, I want to allow the variable's value to be changed/editted.  It
looks something like:

li = [
      [("a", a), ("b", b), "c", c)],
      [("d", d), ("e", e), "f", f)]
    ]

There's no limit on how many elements li can have, but each element will
be the same size.

What I have in mind right now is to create a Frame for each element of the
toplevel list.  Each Frame would contain Label and Entry widgets for each
tuple in that element.  After each Frame is created I would then append it
to the end of a vertically scrollable Canvas.

Does this sound reasonable?  If so, is there a good way to determine a
good size for the canvas?  Each frame in the canvas will be a single line;
how do I query the Label and Entry widgets to determine the size of the
font being used?  I've been studying the Tkinter section of Programming
Python 2E but I haven't been able to track down what I need.  The word
"font" doesn't even appear in the index :(.  Are there any other "gotchas"
I should watch out for?

Thanks...
	- Dick

-- 
Richard Kuhns			rjkkuhns at geetel.net




More information about the Python-list mailing list