[Tutor] grid manager question

Phil phillor9 at gmail.com
Mon Feb 13 20:45:29 EST 2023


On 14/2/23 08:54, David wrote:

> Another suggestion that might help to declutter your
> code and your mind: don't use this pointless App() class.
>
> You don't need it. And it's not required, it's something
> you created in your code.
>
> Removing it will provide the benefit of clarifying your
> code by removing the clutter of useless 'self.' references
> to a class that is only ever instantiated once.
>
> See the demo example I showed in the other thread,
> which has no App() class.

I recently asked a question about the correct way to use Tkinter and ttk 
because there are a dozen ways to achieve the same result. That question 
was answered and is in agreement with an e-book that I bought a week 
ago: OOP being the preferred style although the e-book only contains one 
OOP example. To that end I have a number code templates, that I tweak 
when I find something better, that I use because I keep forgetting (it's 
an age thing) the correct syntax. I agree with you that it's a bit 
cluttered but isn't that the way the big boys programme?

I have played with your demo example and does exactly what I'd ask for. 
What I have in mind is a bit more complex than a button and a circle but 
it's a very good starting point.

-- 

Regards,
Phil



More information about the Tutor mailing list