3
require 'tkextlib/iwidgets'
5
# Create the tabnotebook widget and pack it.
6
nb = Tk::Iwidgets::Notebook.new(:width=>100, :height=>100)
7
nb.pack(:anchor=>:nw, :fill=>:both, :expand=>true,
8
:side=>:top, :padx=>10, :pady=>0)
10
# Add two pages to the tabnotebook,
11
# labelled "Page One" and "Page Two"
12
nb.add(:label=>'Page One')
13
nb.add(:label=>'Page Two')
15
# Get the child site frames of these two pages.
16
page1CS = nb.child_site(0)
17
page2CS = nb.child_site('Page Two')
19
# Create buttons on each page of the tabnotebook.
20
TkButton.new(page1CS, :text=>'Button One').pack
21
TkButton.new(page2CS, :text=>'Button Two').pack
23
# Select the first page of the tabnotebook.
26
# Create the scrollbar and associate teh scrollbar
27
# and the notebook together, then pack the scrollbar
28
nb.xscrollbar(TkScrollbar.new).pack(:fill=>:x, :expand=>true, :padx=>10)