tkinter destroy()

max(01)* max2 at fisso.casa
Thu Mar 31 11:06:34 EST 2005


stewart.midwinter at gmail.com wrote:
> Your app seems to give the right state values only if you select 'Freni
> a posto'.   But I see you recognize that with your 'FIXME' note.
> 
> also the app seems to have too many variables and widgets defined as
> self objects.  That isn't necessary unless they will be used outside
> the method they were created in (which labels and buttons usually
> aren't), so all you are doing is using up more memory than necessary.
> 

very good advice. i'll try to follow it (i am a newbie, you see...)

> 
> Reading the code with Italian names adds a little difficulty in
> understanding your code (non parlo italiano ma si parlo espagnol),

i am trying to write an introductory article for an italian audience, 
you see... next time i'll try to translate the names (i was a bit in a 
hurry, sorry ;-)

> but
> I'm left feeling that your app is more complicated than it needs to be
> - unless I'm missing something.  What you are doing is just showing how
> you can capture the state of the checkbuttons for use elsewhere, right?
> And also, that the state in the 2nd window should be live, so that it
> updates with the change in value in the 1st window? 

precisely.

>  And just a matter
> of personal taste, but splitting up widget configuration over many
> lines for me impedes readiblity and makes the code look like java or
> c++ : surely not what we want?

right... :-)

> 
> I also think you could get away with no frames in your initial window,
> at least if you use grid() instead of pack().  

as a matter of personal taste i prefer pack(), unless special reasons 
for doing differently. i like better to give general structure 
(hyerarchically) to the gui than hardcoding the appearance.

> Also your three state
> variables could be members of a list, so you don't have to have
> separate constructors for each of them.
> 

ok...

> Anyway here's a version of your app that makes use of a 'for' statement
> to draw the labels and checkbuttons, so it's only half as long as your
> original app.  It also does the right thing - the key pont you were
> missing was to use a 'textvariable' argument in defining your label
> widgets in the 2nd window.
> 
> cheers
> Stewart in Calgary

i am going to study it thoroughly. thanks a lot.

bye

macs



More information about the Python-list mailing list