Hi

I've created an iwidgets tabnotebook, with a large number of tabs,
and attached a scrollbar.

Moving the scroll bar successfully moves back and forth amongst pages,
but the subset of tabs displayed does not change.

e.g say you have 20 tabs, and there is room for 1..6 to be displayed.

As you scroll from tab #6 to tab #7, the tabs shown should change
from  1..6 to 2..7

Using notebook.select or notebook.view also has this behaviour.

Am I doing something wrong?

Cheers
Karl

#!/usr/bin/env ruby
require 'tk'
require 'tkextlib/iwidgets'

# Create the tabnotebook widget and pack it.
tn = Tk::Iwidgets::Tabnotebook.new(:width=>300, :height=>100)
tn.pack(:anchor=>:nw, :fill=>:both, :expand=>true,
        :side=>:top, :padx=>10, :pady=>0)

# Add twenty pages to the tabnotebook
1.upto(20) { |t|
    txt = 'Page ' + t.to_s
    tn.add(:label => txt)
}

# Add a button on page 1 to change to tab 20
button = TkButton.new(tn.child_site(0),:text =>'Go to Page 20').pack
button.command {
    tn.select(19)       # tn.view etc have the same problem
}

# Select the first page of the tabnotebook.
tn.select(0)

# Create the scrollbar
# and the notebook together, then pack the scrollbar
tn.xscrollbar(TkScrollbar.new).pack(:fill=>:x,
                                    :expand=>true, :padx=>10)

Tk.mainloop
-- 
Posted via http://www.ruby-forum.com/.