📄 tabnotebook
字号:
# ----------------------------------------------------------------------# DEMO: tabnotebook in [incr Widgets]# ----------------------------------------------------------------------package require Iwidgets 4.0option add *textBackground seashelloption add *Tabnotebook.backdrop DimGrayoption add *Scale.width 8. configure -background whiteiwidgets::tabnotebook .tnb -width 5i -height 3ipack .tnb -padx 4 -pady 4 # Page #1# ----------------------------------------------------------------------set page [.tnb add -label "Personal Info"]iwidgets::entryfield $page.name -labeltext "Name:" -labelpos nwpack $page.nameiwidgets::entryfield $page.addr -labeltext "Address:" -labelpos nwpack $page.addriwidgets::entryfield $page.addr2 -labeltext "City, State:" -labelpos nwpack $page.addr2iwidgets::entryfield $page.email -labeltext "E-mail:" -labelpos nwpack $page.email# Page #2# ----------------------------------------------------------------------set page [.tnb add -label "Favorite Color"]frame $page.sample -width 20 -height 20 \ -borderwidth 2 -relief raisedpack $page.sample -fill both -pady 4scale $page.r -label "Red" -orient horizontal \ -from 0 -to 255 -command "set_color $page"pack $page.r -fill xscale $page.g -label "Green" -orient horizontal \ -from 0 -to 255 -command "set_color $page"pack $page.g -fill xscale $page.b -label "Blue" -orient horizontal \ -from 0 -to 255 -command "set_color $page"pack $page.b -fill xproc 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 [.tnb add -label "Blank Page"]label $page.title -text "(put your widgets here)" \ -background black -foreground white \ -width 25 -height 3pack $page.title -expand yes -fill bothiwidgets::optionmenu .orient -labeltext "Tabs:" -command { .tnb configure -tabpos [.orient get]}pack .orient -padx 4 -pady 4.orient insert end n s e w.tnb view "Personal Info".tnb configure -tabpos [.orient get]
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -