Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ttk::notebook: scrolling of tabs?

855 views
Skip to first unread message

Ralf Fassel

unread,
Jul 1, 2011, 11:27:43 AM7/1/11
to
When many tabs or tabs with very long labels are displayed in a
ttk::notebook, tabs vanish at the right edge of the window.

Are there any plans to implement tab-scrolling in any form as part of
the widget? I did not find any TIP relating to ttk::notebook.

http://wiki.tcl.tk/20057 has a sample-code for adding tab-scrolling
'externally', but IMHO this should be part of the widget interface
itself.

R'

Donal K. Fellows

unread,
Jul 2, 2011, 6:15:40 AM7/2/11
to
On Jul 1, 4:27 pm, Ralf Fassel <ralf...@gmx.de> wrote:
> Are there any plans to implement tab-scrolling in any form as part of
> the widget?  I did not find any TIP relating to ttk::notebook.

The issue has been that Joe English things (with good reason IMO) that
having too many tabs - more than will fit across the top without
scrolling - is an indication of a poor interface. There's also the
issue of whether the tabs should be scrolled or stacked; I've seen
both and neither is all that great. (Datapoint: Safari on OSX Leopard
uses a variation, putting a menu on to allow the selection of tabs
when there's more than will fit. I just try to keep the number of tabs
down.)

Given all that, it's a surprisingly awkward topic.

Donal.

Ralf Fassel

unread,
Jul 2, 2011, 12:25:53 PM7/2/11
to
* "Donal K. Fellows" <donal.k...@manchester.ac.uk>

| On Jul 1, 4:27 pm, Ralf Fassel <ralf...@gmx.de> wrote:
| > Are there any plans to implement tab-scrolling in any form as part of
| > the widget?  I did not find any TIP relating to ttk::notebook.
>
| The issue has been that Joe English things (with good reason IMO) that
| having too many tabs - more than will fit across the top without
| scrolling - is an indication of a poor interface.

In our case it's not too many labels but too wide tab titles (text set
by the user).

I see that ttk::notebook implements a smarter strategy to fit all tabs
on the page regardless of the tab text:

Compare

package require Ttk
wm geometry . {600x400}
pack [ttk::notebook .nb] -fill both -expand yes
for {set i 1} {$i <= 5} {incr i} {
.nb add [frame .nb.p$i] -text "$i Some long label text on a tab"
}

package require Tix
pack [tixNoteBook .tnb] -fill both -expand yes
.tnb subwidget nbframe configure -font {Helvetica 10}
for {set i 1} {$i <= 5} {incr i} {
.tnb add p$i -label "$i Some long label text on a tab"
}

So I guess it's a first step to change to ttk::notebook instead if tix
or iwidgets.

Thanks
R'

MSEdit

unread,
Jul 4, 2011, 3:34:10 AM7/4/11
to
On Jul 2, 6:25 pm, Ralf Fassel <ralf...@gmx.de> wrote:
> * "Donal K. Fellows" <donal.k.fell...@manchester.ac.uk>

Unfortunately telling your users that they are only allowed 5 tabs or
that their names are too long is not sufficient, they are used to
having programs like firefox which work with many tabs and long names,
so I have to stick to a patched BWidget to scroll the tabs and adjust
colours if the user changes themes.
I agree that multiple tier tabs are not the solution but scrunching
the tabs up until you can no longer read anything is a very ugly
solution, possibly even worse.

Martyn

George Petasis

unread,
Jul 4, 2011, 4:56:20 AM7/4/11
to

I don't agree with the whole issue of bad GUI design. In my application
I have notebooks with many tabs. The tabs at the end contain rarely used
functionality, but its good to be there for the few times the user is
going to need it.

There is a reason that all other toolkits have scrollable tabs...

George

Thomas MENEZ

unread,
Jul 4, 2011, 6:11:51 AM7/4/11
to

Hi all !

I also believe having scrollable tabs would be very handful for my Tk
GUIs.

Thomas

MSEdit

unread,
Jul 4, 2011, 8:39:28 AM7/4/11
to

As I said above Bwidget handles scrolling tabs by default when there
are too many it adds a couple of arrow buttons the code is very clear
and I simply added a new element to my mouse wheel focusing code to do
a

NoteBook::_xview $::Gui(NoteBook) $step

where step is 1 or -1, it even stops scrolling at the end.

Martyn

Harald Oehlmann

unread,
Jul 5, 2011, 3:14:44 AM7/5/11
to
I also want to raise my hand (again) for tab scrolling.
-Harald
0 new messages