[Tutor] Please Critque Tkinter Class for Newbie

Sheila King sheila@thinkspot.net
Thu, 12 Jul 2001 12:41:58 -0700


On Thu, 12 Jul 2001 08:20:18 -0400 (EDT), "Michael P. Reilly"
<arcege@dsl092-074-184.bos1.dsl.speakeasy.net>  wrote about Re: [Tutor]
Please Critque Tkinter Class for Newbie:

:Sheila King wrote
:> :Just two comments.  A widget should not pack itself as your Palette does.
:> :That should be the application's choice.  If there are some "adjustments"
:> :you want, then override the method to modify the parameters.
:> 
:> Oops. That was just plain dumb. I probably had that statement in there
:> from very early in my writing/testing phase and forgot to take it out.
:> It is now gone, and the class works just as I want it to. As a matter of
:> fact, I'm surprised, that since the class (as I originally posted it)
:> packed itself, and then my __main__ function packed it again, that this
:> didn't create some kind of error.
:
:Tkinter will allow a widget to be repacked.  The issue is that you
:cannot mix geometry managers.  So if you want to use the Place or Grid
:managers, then this will be a problem (need to call pack_forget first).
:Wouldn't be an error, but you get interesting results if you try:

OK, but if one has a class derived from the Tkinter Frame Widget that
has several other types of widgets on it (such as a button and a label
and so forth), and those items are placed on the Frame subclass with the
pack manager, then won't this incompatibility still exist? (i.e. someone
will not then be able to place the Frame subclass on another widget
unless they use the place geometry manager???). Or maybe not. OK, I will
experiment with this. (I haven't tried using grid(), yet...)

:but I just had a MRI this morning, so it
:giving me a worse headache.  I'll have to address your other question
:later today.)

Oh, sorry to hear that. Please, take care of yourself and rest. No hurry
on this stuff, although I really DO appreciate your assistance so far.

--
Sheila King
http://www.thinkspot.net/sheila/
http://www.k12groups.org/