Re: [Tkinter-discuss] ttk.Notebook: autohide

2019-05-29 Thread Michael Lange
Hi,

On Wed, 29 May 2019 13:01:16 +
Vasilis Vlachoudis  wrote:

> Hi all
>
> I am using the ttk.Notebook for an editor like application and I want
> to implement something like autohide functionality for the tabheadings
> when there is only one tab, and to reappear when there are more than
> one.
>
> Is there some function to set the height to 0 for the headings of
> "pack_forget" equivalent in the style?

it seems you can show or hide the tabs with something like:

s=ttk.Style()
# store default layout options
tablayout = s.layout('TNotebook.Tab')
# hide tabs
s.layout('TNotebook.Tab', [])
# show tabs again
s.layout('TNotebook.Tab',tablayout)

Idea borrowed from:
https://stackoverflow.com/questions/26923010/how-do-i-hide-the-entire-tab-bar-in-a-tkinter-ttk-notebook-widget

Best regards

Michael

.-.. .. ...- .   .-.. --- -. --.   .- -. -..   .--. .-. --- ... .--. . .-.

There is an old custom among my people.  When a woman saves a man's
life, he is grateful.
-- Nona, the Kanuto witch woman, "A Private Little War",
   stardate 4211.8.
___
Tkinter-discuss mailing list
Tkinter-discuss@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss


[Tkinter-discuss] ttk.Notebook: autohide

2019-05-29 Thread Vasilis Vlachoudis
Hi all

I am using the ttk.Notebook for an editor like application and I want to 
implement
something like autohide functionality for the tabheadings when there is only 
one tab,
and to reappear when there are more than one.

Is there some function to set the height to 0 for the headings of "pack_forget" 
equivalent
in the style?

Thanks in advance
Vasilis
___
Tkinter-discuss mailing list
Tkinter-discuss@python.org
https://mail.python.org/mailman/listinfo/tkinter-discuss