| Itcl  | Itk  | Itcl @ Wiki  | Itcl @ SF  | Tcl  | Tcl @ Wiki |
  home || iwidgets || man pages cross ref distribution docs faq  
buttonbox
calendar
canvasprintbox
canvasprintdialog
checkbox
combobox
dateentry
datefield
dialog
dialogshell
disjointlistbox
entryfield
extbutton
extfileselectionbox
extfileselectiondialog
feedback
fileselectionbox
fileselectiondialog
finddialog
hierarchy
hyperhelp
labeledframe
labeledwidget
mainwindow
menubar
messagebox
messagedialog
notebook
optionmenu
panedwindow
promptdialog
pushbutton
radiobox
regexpfield
scrolledcanvas
scrolledframe
scrolledhtml
scrolledlistbox
scrolledtext
scrolledwidget
selectionbox
selectiondialog
shell
spindate
spinint
spinner
spintime
tabnotebook
tabset
timeentry
timefield
toolbar
watch

man page | options | methods

Tabnotebook

The tabnotebook iwidget displays a set of tabbed pages. It displays one page from the set as the selected page. A tab displays the label for the page to which it is attached and serves as a page selector. When a page's tab is selected, the page's contents are displayed in the page area. The selected tab has a three-dimensional effect to make it appear to float above the other tabs. The tabs are displayed as a group along either the left, top, right, or bottom edge. When first created a tabnotebook has no pages. Pages may be added or deleted using widget commands.

Each page in a tabnotebook contains a single child site frame. The page's child site frame serves as a geometry container for applications to pack widgets into. Tabs appear along the edge of the notebook area. Tabs are drawn to appear attached to their associated page. When a tab is clicked on, the associated page is selected and the tab is drawn as raised above all other tabs and as a seamless part of its notebook page. Tabs can be controlled in their location along the edges, the angle tab sides are drawn with, gap between tabs, starting margin of tabs, internal padding around text labels in a tab, the font, and its label.

Tabs may be oriented along either the north, south, east, or west sides of the notebook. North and south tabs may appear as angled, square, or bevelled. West and east tabs may appear as square or bevelled. By changing tab gaps, tab angles, bevelling, orientations, colors, fonts, start locations, and margins; tabs may appear in a wide variety of styles. For example, it is possible to implement Microsoft-style tabs, Borland property tab styles, or Borland Delphi style tabs all with the same tabnotebook. For further information, see the Tabnotebook manpage

Components: canvas hull notebook tabset

				

wm title . "Tabnotebook Example"

##=========================================================
##	Create a tabnotebook iwidget
##=========================================================
##
iwidgets::tabnotebook .tn \
	-tabpos n \
	-width 350 \
	-height 250 \
	-angle 0 \
	-background #336699 \
	-tabbackground white \
	-foreground white \
	-bevelamount 4 \
	-gap 3 \
	-margin 6 \
	-tabborders 0 \
	-backdrop #666666


##
##	Add some tabs
##
foreach t {one two three four} {

	set tb($t) [.tn add -label "Tab [string totitle $t]"]
	frame $tb($t).f \
		-bd 2

	label $tb($t).f.l \
		-text "This is tab $t" \
		-background #336699 \
		-foreground white \
		-font {Helvetica 16 bold}

	pack $tb($t).f.l $tb($t).f \
		-expand 1 \
		-fill both
}

pack .tn

.tn delete 1

##
##	select the second tab (zero based)
##
.tn select 1

Download this sample code
man page | options | methods
 
  home || iwidgets || man pages cross ref distribution docs faq  
Copyright | Contributions | Development Team | Credits
Bugs/Comments/Suggestions about this web site