Many thanks The first solution works ok for me without any flickering
I think you are right it is a bug in tk, probably they forget to invalidate the window Vasilis ________________________________________ From: Tkinter-discuss [tkinter-discuss-bounces+vasilis.vlachoudis=cern...@python.org] on behalf of Michael Lange [klappn...@web.de] Sent: Friday, May 31, 2019 00:33 To: tkinter-discuss@python.org Subject: Re: [Tkinter-discuss] ttk.Notebook: autohide Hi, On Thu, 30 May 2019 19:49:33 +0000 Vasilis Vlachoudis <vasilis.vlachou...@cern.ch> wrote: > Many thanks Michael. > The recipe works the tab bar disappears (and reappears), but the space > of the tabs is not reclaimed. the child-window is not resized to get > the extra space. If I resize the toplevel window with the mouse then it > works. oh, I see. This "works" also vice versa here, the tab only reappears after resizing the window with the mouse. Too bad, looks like a bug to me. > > Is there a way to force the layout manager to recalculate all widgets? > I am not sure how to do this, except with an ugly hack like: def hidetabs(ev): s.layout('TNotebook.Tab', []) nb.pack(expand=0) nb.update_idletasks() nb.pack(fill='both', expand=1) But that looks rather stupid and besides causes an annoying "flickering" effect. The flickering seems to be a bit better with a "minimally invasive" re-packing, as in def hidetabs(ev): s.layout('TNotebook.Tab', []) info = nb.pack_info() px = info['padx'] del info['padx'] nb.pack(padx=px + 1, **info) nb.update_idletasks() nb.pack(padx=px, **info) but this looks somehow even more stupid. But maybe I just miss something obvious? Best regards Michael .-.. .. ...- . .-.. --- -. --. .- -. -.. .--. .-. --- ... .--. . .-. "Can you imagine how life could be improved if we could do away with jealousy, greed, hate ..." "It can also be improved by eliminating love, tenderness, sentiment -- the other side of the coin" -- Dr. Roger Corby and Kirk, "What are Little Girls Made Of?", stardate 2712.4 _______________________________________________ Tkinter-discuss mailing list Tkinter-discuss@python.org https://mail.python.org/mailman/listinfo/tkinter-discuss _______________________________________________ Tkinter-discuss mailing list Tkinter-discuss@python.org https://mail.python.org/mailman/listinfo/tkinter-discuss