Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python/Tkinter: pack equivalent of grid_remove(), eg. pack_remove()?

Is there a pack equivalent of the grid_remove() method where a widget's original pack() settings are restored on a re-pack()?

Use case: When I show a packed widget that has been hidden via pack_forget(), I would like to have the widget re-packed with its original pack settings when I issue the widget.pack() show request.

like image 969
Malcolm Avatar asked Sep 07 '25 22:09

Malcolm


1 Answers

No, there is no equivalent. There is only pack_forget which doesn't remember where the widget was when you restore it. If I need this sort of feature I just use the grid geometry manager.

like image 131
Bryan Oakley Avatar answered Sep 09 '25 12:09

Bryan Oakley