diff options
author | Keith Seitz <keiths@redhat.com> | 2002-09-24 23:50:31 +0000 |
---|---|---|
committer | Keith Seitz <keiths@redhat.com> | 2002-09-24 23:50:31 +0000 |
commit | 43375e54d64ecea0b356c82d72b29fd95dd54cc9 (patch) | |
tree | 7582d7bb623964e848d993dde740802e40a748b0 /iwidgets/demos/notebook | |
parent | 5a88d945c95d8c15e31bf74fc9850b8c01fdeaec (diff) | |
download | gdb-tcltk840-20020924-branchpoint.tar.gz |
import iwidgets 4.0.1tcltk840-20020924-branchpoint
Diffstat (limited to 'iwidgets/demos/notebook')
-rw-r--r-- | iwidgets/demos/notebook | 71 |
1 files changed, 71 insertions, 0 deletions
diff --git a/iwidgets/demos/notebook b/iwidgets/demos/notebook new file mode 100644 index 00000000000..0a749daab71 --- /dev/null +++ b/iwidgets/demos/notebook @@ -0,0 +1,71 @@ +# ---------------------------------------------------------------------- +# DEMO: notebook in [incr Widgets] +# ---------------------------------------------------------------------- +package require Iwidgets 4.0 + +option add *textBackground seashell +option add *Scale.width 8 +. configure -background white + +iwidgets::optionmenu .pages -labeltext "Page:" -command { + .nb view [.pages get] +} +pack .pages -padx 4 -pady 4 +.pages insert end "Personal Info" "Favorite Color" "Blank Page" + + +iwidgets::notebook .nb -width 3i -height 2.6i +pack .nb -padx 4 -pady 4 + +# Page #1 +# ---------------------------------------------------------------------- +set page [.nb add -label "Personal Info"] + +iwidgets::entryfield $page.name -labeltext "Name:" -labelpos nw +pack $page.name +iwidgets::entryfield $page.addr -labeltext "Address:" -labelpos nw +pack $page.addr +iwidgets::entryfield $page.addr2 -labeltext "City, State:" -labelpos nw +pack $page.addr2 +iwidgets::entryfield $page.email -labeltext "E-mail:" -labelpos nw +pack $page.email + + +# Page #2 +# ---------------------------------------------------------------------- +set page [.nb add -label "Favorite Color"] + +frame $page.sample -width 20 -height 20 \ + -borderwidth 2 -relief raised +pack $page.sample -fill both -pady 4 +scale $page.r -label "Red" -orient horizontal \ + -from 0 -to 255 -command "set_color $page" +pack $page.r -fill x +scale $page.g -label "Green" -orient horizontal \ + -from 0 -to 255 -command "set_color $page" +pack $page.g -fill x +scale $page.b -label "Blue" -orient horizontal \ + -from 0 -to 255 -command "set_color $page" +pack $page.b -fill x + +proc set_color {page {val 0}} { + set r [$page.r get] + set g [$page.g get] + set b [$page.b get] + set color [format "#%.2x%.2x%.2x" $r $g $b] + $page.sample configure -background $color +} +set_color $page + + +# Page #3 +# ---------------------------------------------------------------------- +set page [.nb add -label "Blank Page"] + +label $page.title -text "(put your widgets here)" \ + -background black -foreground white \ + -width 25 -height 3 +pack $page.title -expand yes -fill both + + +.nb view "Personal Info" |