osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tkinter] question about correct use of validation


>> Il 17/01/19 14:08, Peter Otten ha scritto:
> Alternatives:
> 
> - If you know that you'll always just call pack() you can change the
> make_entry() method accordingly
> 
> def make_entry(...):
>      ...
>      entry.pack()
>      return entry
> 
> 
> - Write a helper function
> 
> def pack(widget):
>      widget.pack()
>      return widget
> 
> and then use it
> 
> self.id1_entry = pack(self.make_entry(...))  # create and layout widget
> 
> 

it's true! they are important things that make the difference and help 
in understanding.

Thanks a lot of support ;-)