package require Tk
proc ::TabOrientation {{pos ""}} {
lassign [split [wm geometry .] x+] w h x y
ttk::style configure TNotebook -tabposition $pos
incr w 1
wm geometry . ${w}x${h}+${x}+${y}
update
incr w -1
wm geometry . ${w}x${h}+${x}+${y}
update
}
ttk::notebook .nb -width 200 -height 100
ttk::frame .nb.f1; # first page
ttk::frame .nb.f2; # second page
.nb add .nb.f1 -text "One"
.nb add .nb.f2 -text "Two"
pack .nb -fill both -expand 1
button .tn -text "Tabs to North" -command {::TabOrientation n}
pack .tn
button .ts -text "Tabs to South" -command {::TabOrientation s}
pack .ts
button .td -text "Default position" -command ::TabOrientation
pack .td