Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | * ../../examples/tablelist/*.tcl: Bumped the version number to 6.10; made all demo-scripts fully scaling-aware. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
ff3ff82069120bf5868c5214363234dc |
User & Date: | csaba 2020-06-23 09:25:01 |
Context
2020-06-23
| ||
09:32 | * ../../examples/tablelist/*.gif: Removed checked.gif, unchecked.gif, and open.gif; added (checked|unchecked|openAction)100.gif, (checked|unchecked|openAction)125.gif, ..., (checked|unchecked|openAction)200.gif. check-in: 6125334d6d user: csaba tags: trunk | |
09:25 | * ../../examples/tablelist/*.tcl: Bumped the version number to 6.10; made all demo-scripts fully scaling-aware. check-in: ff3ff82069 user: csaba tags: trunk | |
09:23 | * doc/browse.png: Updated screenshots. * doc/browseTree.png: * doc/bwidget.png: * doc/config.png: * doc/dirViewer.png: * doc/embeddedWindows.png: * doc/embeddedWindows_tile.png: * doc/plain200.png: * doc/styles.png: * doc/tileWidgets.png: check-in: 0d4946b2e4 user: csaba tags: trunk | |
Changes
Changes to examples/tablelist/browse.tcl.
1 2 3 4 5 6 7 | #============================================================================== # Demonstrates how to use a tablelist widget for displaying information about # the children of an arbitrary widget. # # Copyright (c) 2000-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== | | | > | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | #============================================================================== # Demonstrates how to use a tablelist widget for displaying information about # the children of an arbitrary widget. # # Copyright (c) 2000-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== package require tablelist 6.10 namespace eval demo { variable dir [file dirname [info script]] # # Create two images corresponding to the display's DPI scaling level # set pct $::tablelist::scalingpct variable compImg [image create bitmap -file [file join $dir comp$pct.xbm] \ -background yellow -foreground gray50] variable leafImg [image create bitmap -file [file join $dir leaf$pct.xbm] \ -background coral -foreground gray50] } source [file join $demo::dir config.tcl] #------------------------------------------------------------------------------ # demo::displayChildren # |
︙ | ︙ | |||
124 125 126 127 128 129 130 | grid $vsb -row 0 -rowspan 2 -column 1 -sticky ns } else { grid [$tbl cornerpath] -row 0 -column 1 -sticky ew grid $vsb -row 1 -column 1 -sticky ns } grid rowconfigure $tf 1 -weight 1 grid columnconfigure $tf 0 -weight 1 | | | 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 | grid $vsb -row 0 -rowspan 2 -column 1 -sticky ns } else { grid [$tbl cornerpath] -row 0 -column 1 -sticky ew grid $vsb -row 1 -column 1 -sticky ns } grid rowconfigure $tf 1 -weight 1 grid columnconfigure $tf 0 -weight 1 pack $b1 $b2 $b3 -side left -expand yes -pady 7p pack $bf -side bottom -fill x pack $tf -side top -expand yes -fill both # # Populate the tablelist with the data of the given widget's children # putChildren $w $tbl |
︙ | ︙ |
Changes to examples/tablelist/browseTree.tcl.
1 2 3 4 5 6 7 8 | #============================================================================== # Demonstrates how to use a tablelist widget for displaying information about # the children of an arbitrary widget. # # Copyright (c) 2010-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== package require Tk 8.3 | | | > | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | #============================================================================== # Demonstrates how to use a tablelist widget for displaying information about # the children of an arbitrary widget. # # Copyright (c) 2010-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== package require Tk 8.3 package require tablelist 6.10 namespace eval demo { variable dir [file dirname [info script]] # # Create two images corresponding to the display's DPI scaling level # set pct $::tablelist::scalingpct variable compImg [image create bitmap -file [file join $dir comp$pct.xbm] \ -background yellow -foreground gray50] variable leafImg [image create bitmap -file [file join $dir leaf$pct.xbm] \ -background coral -foreground gray50] } source [file join $demo::dir config.tcl] #------------------------------------------------------------------------------ # demo::displayChildren # |
︙ | ︙ | |||
73 74 75 76 77 78 79 80 81 82 83 84 85 86 | $tbl columnconfigure $col -sortmode integer } foreach col {6 7} { $tbl columnconfigure $col -formatcommand demo::formatBoolean } scrollbar $vsb -orient vertical -command [list $tbl yview] # # When displaying the information about the children of any # ancestor of the label widgets, the widths of some of the # labels and thus also the widths and x coordinates of some # children may change. For this reason, make sure the items # will be updated after any change in the sizes of the labels # | > > > > > > > > > | 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | $tbl columnconfigure $col -sortmode integer } foreach col {6 7} { $tbl columnconfigure $col -formatcommand demo::formatBoolean } scrollbar $vsb -orient vertical -command [list $tbl yview] # # On X11 configure the tablelist according # to the display's DPI scaling level # variable winSys ;# see config.tcl if {[string compare $winSys "x11"] == 0} { $tbl configure -treestyle bicolor$::tablelist::scalingpct } # # When displaying the information about the children of any # ancestor of the label widgets, the widths of some of the # labels and thus also the widths and x coordinates of some # children may change. For this reason, make sure the items # will be updated after any change in the sizes of the labels # |
︙ | ︙ | |||
126 127 128 129 130 131 132 | grid $vsb -row 0 -rowspan 2 -column 1 -sticky ns } else { grid [$tbl cornerpath] -row 0 -column 1 -sticky ew grid $vsb -row 1 -column 1 -sticky ns } grid rowconfigure $tf 1 -weight 1 grid columnconfigure $tf 0 -weight 1 | | | 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 | grid $vsb -row 0 -rowspan 2 -column 1 -sticky ns } else { grid [$tbl cornerpath] -row 0 -column 1 -sticky ew grid $vsb -row 1 -column 1 -sticky ns } grid rowconfigure $tf 1 -weight 1 grid columnconfigure $tf 0 -weight 1 pack $b1 $b2 $b3 -side left -expand yes -pady 7p pack $bf -side bottom -fill x pack $tf -side top -expand yes -fill both # # Populate the tablelist with the data of the given widget's children # putChildren $w $tbl root |
︙ | ︙ |
Changes to examples/tablelist/browseTree_tile.tcl.
1 2 3 4 5 6 7 | #============================================================================== # Demonstrates how to use a tablelist widget for displaying information about # the children of an arbitrary widget. # # Copyright (c) 2010-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== | | | > | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | #============================================================================== # Demonstrates how to use a tablelist widget for displaying information about # the children of an arbitrary widget. # # Copyright (c) 2010-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== package require tablelist_tile 6.10 namespace eval demo { variable dir [file dirname [info script]] # # Create two images corresponding to the display's DPI scaling level # set pct $::tablelist::scalingpct variable compImg [image create bitmap -file [file join $dir comp$pct.xbm] \ -background yellow -foreground gray50] variable leafImg [image create bitmap -file [file join $dir leaf$pct.xbm] \ -background coral -foreground gray50] } source [file join $demo::dir config_tile.tcl] # # Work around the improper appearance of the tile scrollbars in the aqua theme # |
︙ | ︙ | |||
80 81 82 83 84 85 86 87 88 89 90 91 92 93 | $tbl columnconfigure $col -sortmode integer } foreach col {6 7} { $tbl columnconfigure $col -formatcommand demo::formatBoolean } ttk::scrollbar $vsb -orient vertical -command [list $tbl yview] # # When displaying the information about the children of any # ancestor of the label widgets, the widths of some of the # labels and thus also the widths and x coordinates of some # children may change. For this reason, make sure the items # will be updated after any change in the sizes of the labels # | > > > > > > > > | 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | $tbl columnconfigure $col -sortmode integer } foreach col {6 7} { $tbl columnconfigure $col -formatcommand demo::formatBoolean } ttk::scrollbar $vsb -orient vertical -command [list $tbl yview] # # On X11 configure the tablelist according # to the display's DPI scaling level # if {[tk windowingsystem] eq "x11"} { $tbl configure -treestyle bicolor$::tablelist::scalingpct } # # When displaying the information about the children of any # ancestor of the label widgets, the widths of some of the # labels and thus also the widths and x coordinates of some # children may change. For this reason, make sure the items # will be updated after any change in the sizes of the labels # |
︙ | ︙ | |||
132 133 134 135 136 137 138 | grid $vsb -row 0 -rowspan 2 -column 1 -sticky ns } else { grid [$tbl cornerpath] -row 0 -column 1 -sticky ew grid $vsb -row 1 -column 1 -sticky ns } grid rowconfigure $tf 1 -weight 1 grid columnconfigure $tf 0 -weight 1 | | | 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 | grid $vsb -row 0 -rowspan 2 -column 1 -sticky ns } else { grid [$tbl cornerpath] -row 0 -column 1 -sticky ew grid $vsb -row 1 -column 1 -sticky ns } grid rowconfigure $tf 1 -weight 1 grid columnconfigure $tf 0 -weight 1 pack $b1 $b2 $b3 -side left -expand yes -pady 7p pack $bf -side bottom -fill x pack $tf -side top -expand yes -fill both # # Populate the tablelist with the data of the given widget's children # putChildren $w $tbl root |
︙ | ︙ |
Changes to examples/tablelist/browse_tile.tcl.
1 2 3 4 5 6 7 | #============================================================================== # Demonstrates how to use a tablelist widget for displaying information about # children of an arbitrary widget. # # Copyright (c) 2000-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== | | | > | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | #============================================================================== # Demonstrates how to use a tablelist widget for displaying information about # children of an arbitrary widget. # # Copyright (c) 2000-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== package require tablelist_tile 6.10 namespace eval demo { variable dir [file dirname [info script]] # # Create two images corresponding to the display's DPI scaling level # set pct $::tablelist::scalingpct variable compImg [image create bitmap -file [file join $dir comp$pct.xbm] \ -background yellow -foreground gray50] variable leafImg [image create bitmap -file [file join $dir leaf$pct.xbm] \ -background coral -foreground gray50] } source [file join $demo::dir config_tile.tcl] # # Work around the improper appearance of the tile scrollbars in the aqua theme # |
︙ | ︙ | |||
131 132 133 134 135 136 137 | grid $vsb -row 0 -rowspan 2 -column 1 -sticky ns } else { grid [$tbl cornerpath] -row 0 -column 1 -sticky ew grid $vsb -row 1 -column 1 -sticky ns } grid rowconfigure $tf 1 -weight 1 grid columnconfigure $tf 0 -weight 1 | | | 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 | grid $vsb -row 0 -rowspan 2 -column 1 -sticky ns } else { grid [$tbl cornerpath] -row 0 -column 1 -sticky ew grid $vsb -row 1 -column 1 -sticky ns } grid rowconfigure $tf 1 -weight 1 grid columnconfigure $tf 0 -weight 1 pack $b1 $b2 $b3 -side left -expand yes -pady 7p pack $bf -side bottom -fill x pack $tf -side top -expand yes -fill both # # Populate the tablelist with the data of the given widget's children # putChildren $w $tbl |
︙ | ︙ |
Changes to examples/tablelist/bwidget.tcl.
1 2 3 4 5 6 7 8 9 10 11 | #!/usr/bin/env wish #============================================================================== # Demonstrates the interactive tablelist cell editing with the aid of some # widgets from the BWidget package and of the Tk core checkbutton and # menubutton widgets. # # Copyright (c) 2004-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== package require Tk 8.4 ;# because of "-compound" | | > > > > > > < < < < < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 | #!/usr/bin/env wish #============================================================================== # Demonstrates the interactive tablelist cell editing with the aid of some # widgets from the BWidget package and of the Tk core checkbutton and # menubutton widgets. # # Copyright (c) 2004-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== package require Tk 8.4 ;# because of "-compound" package require tablelist 6.10 package require BWidget wm title . "Serial Line Configuration" # # Add some entries to the Tk option database # set dir [file dirname [info script]] source [file join $dir option.tcl] option add *Tablelist*Entry.background white # # Create the images "checkedImg" and "uncheckedImg", as well as 16 images of # names like "img#FF0000", displaying colors identified by names like "red" # source [file join $dir images.tcl] # # Register some widgets from the BWidget package for interactive cell editing # tablelist::addBWidgetEntry tablelist::addBWidgetSpinBox tablelist::addBWidgetComboBox # # Create a tablelist widget with editable columns (except the first one) # set tbl .tbl tablelist::tablelist $tbl \ -columns {0 "No." right 0 "Available" center |
︙ | ︙ | |||
92 93 94 95 96 97 98 | } set btn [button .btn -text "Close" -command exit] # # Manage the widgets # | | | 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 | } set btn [button .btn -text "Close" -command exit] # # Manage the widgets # pack $btn -side bottom -pady 7p pack $tbl -side top -expand yes -fill both #------------------------------------------------------------------------------ # editStartCmd # # Applies some configuration options to the edit window; if the latter is a # ComboBox, the procedure populates it. |
︙ | ︙ |
Changes to examples/tablelist/bwidget_tile.tcl.
1 2 3 4 5 6 7 8 9 10 | #!/usr/bin/env wish #============================================================================== # Demonstrates the interactive tablelist cell editing with the aid of some # widgets from the BWidget package and of the Tk core checkbutton and # menubutton widgets. # # Copyright (c) 2004-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== | | > > > > > > < < < < < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | #!/usr/bin/env wish #============================================================================== # Demonstrates the interactive tablelist cell editing with the aid of some # widgets from the BWidget package and of the Tk core checkbutton and # menubutton widgets. # # Copyright (c) 2004-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== package require tablelist_tile 6.10 package require BWidget wm title . "Serial Line Configuration" # # Add some entries to the Tk option database # set dir [file dirname [info script]] source [file join $dir option_tile.tcl] option add *Tablelist*Entry.background white # # Create the images "checkedImg" and "uncheckedImg", as well as 16 images of # names like "img#FF0000", displaying colors identified by names like "red" # source [file join $dir images.tcl] # # Register some widgets from the BWidget package for interactive cell editing # tablelist::addBWidgetEntry tablelist::addBWidgetSpinBox tablelist::addBWidgetComboBox # # Improve the window's appearance by using a tile # frame as a container for the other widgets # set f [ttk::frame .f] # |
︙ | ︙ | |||
97 98 99 100 101 102 103 | } set btn [ttk::button $f.btn -text "Close" -command exit] # # Manage the widgets # | | | 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 | } set btn [ttk::button $f.btn -text "Close" -command exit] # # Manage the widgets # pack $btn -side bottom -pady 7p pack $tbl -side top -expand yes -fill both pack $f -expand yes -fill both #------------------------------------------------------------------------------ # editStartCmd # # Applies some configuration options to the edit window; if the latter is a |
︙ | ︙ |
Changes to examples/tablelist/config.tcl.
1 2 3 4 5 6 7 | #============================================================================== # Demonstrates how to use a tablelist widget for displaying and editing the # configuration options of an arbitrary widget. # # Copyright (c) 2000-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | #============================================================================== # Demonstrates how to use a tablelist widget for displaying and editing the # configuration options of an arbitrary widget. # # Copyright (c) 2000-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== package require tablelist 6.10 namespace eval demo { # # Get the current windowing system ("x11", "win32", "classic", or "aqua") # and add some entries to the Tk option database for the following # widget hierarchy within a toplevel widget of the class DemoTop: # |
︙ | ︙ | |||
123 124 125 126 127 128 129 | } else { grid [$tbl cornerpath] -row 0 -column 1 -sticky ew grid $vsb -row 1 -column 1 -sticky ns } grid $hsb -row 2 -column 0 -sticky ew grid rowconfigure $tf 1 -weight 1 grid columnconfigure $tf 0 -weight 1 | | | 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | } else { grid [$tbl cornerpath] -row 0 -column 1 -sticky ew grid $vsb -row 1 -column 1 -sticky ns } grid $hsb -row 2 -column 0 -sticky ew grid rowconfigure $tf 1 -weight 1 grid columnconfigure $tf 0 -weight 1 pack $b1 $b2 $b3 -side left -expand yes -pady 7p pack $bf -side bottom -fill x pack $tf -side top -expand yes -fill both # # Populate the tablelist with the configuration options of the given widget # putConfig $w $tbl |
︙ | ︙ |
Changes to examples/tablelist/config_tile.tcl.
1 2 3 4 5 6 7 | #============================================================================== # Demonstrates how to use a tablelist widget for displaying and editing the # configuration options of an arbitrary widget. # # Copyright (c) 2000-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | #============================================================================== # Demonstrates how to use a tablelist widget for displaying and editing the # configuration options of an arbitrary widget. # # Copyright (c) 2000-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== package require tablelist_tile 6.10 namespace eval demo { # # Get the current windowing system ("x11", "win32", or "aqua") # and add some entries to the Tk option database for the following # widget hierarchy within a toplevel widget of the class DemoTop: # |
︙ | ︙ | |||
127 128 129 130 131 132 133 | } else { grid [$tbl cornerpath] -row 0 -column 1 -sticky ew grid $vsb -row 1 -column 1 -sticky ns } grid $hsb -row 2 -column 0 -sticky ew grid rowconfigure $tf 1 -weight 1 grid columnconfigure $tf 0 -weight 1 | | | 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 | } else { grid [$tbl cornerpath] -row 0 -column 1 -sticky ew grid $vsb -row 1 -column 1 -sticky ns } grid $hsb -row 2 -column 0 -sticky ew grid rowconfigure $tf 1 -weight 1 grid columnconfigure $tf 0 -weight 1 pack $b1 $b2 $b3 -side left -expand yes -pady 7p pack $bf -side bottom -fill x pack $tf -side top -expand yes -fill both # # Populate the tablelist with the configuration options of the given widget # putConfig $w $tbl |
︙ | ︙ |
Changes to examples/tablelist/dirViewer.tcl.
1 2 3 4 5 6 7 8 9 10 | #!/usr/bin/env wish #============================================================================== # Demonstrates how to use a tablelist widget for displaying the content of a # directory. # # Copyright (c) 2010-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== package require Tk 8.3 | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 | #!/usr/bin/env wish #============================================================================== # Demonstrates how to use a tablelist widget for displaying the content of a # directory. # # Copyright (c) 2010-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== package require Tk 8.3 package require tablelist 6.10 # # Add some entries to the Tk option database # set dir [file dirname [info script]] source [file join $dir option.tcl] |
︙ | ︙ | |||
52 53 54 55 56 57 58 | $tbl columnconfigure 0 -formatcommand formatString -sortmode dictionary $tbl columnconfigure 1 -formatcommand formatSize -sortmode integer $tbl columnconfigure 2 -formatcommand formatString scrollbar $vsb -orient vertical -command [list $tbl yview] scrollbar $hsb -orient horizontal -command [list $tbl xview] # | | | | < < < < < < < < < | 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | $tbl columnconfigure 0 -formatcommand formatString -sortmode dictionary $tbl columnconfigure 1 -formatcommand formatSize -sortmode integer $tbl columnconfigure 2 -formatcommand formatString scrollbar $vsb -orient vertical -command [list $tbl yview] scrollbar $hsb -orient horizontal -command [list $tbl xview] # # On X11 configure the tablelist according # to the display's DPI scaling level # global winSys ;# see option.tcl if {[string compare $winSys "x11"] == 0} { $tbl configure -treestyle bicolor$tablelist::scalingpct } # # Create a pop-up menu with one command entry; bind the script # associated with its entry to the <Double-1> event, too # set menu .menu |
︙ | ︙ | |||
108 109 110 111 112 113 114 | } else { grid [$tbl cornerpath] -row 0 -column 1 -sticky ew grid $vsb -row 1 -column 1 -sticky ns } grid $hsb -row 2 -column 0 -sticky ew grid rowconfigure $tf 1 -weight 1 grid columnconfigure $tf 0 -weight 1 | < | | 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | } else { grid [$tbl cornerpath] -row 0 -column 1 -sticky ew grid $vsb -row 1 -column 1 -sticky ns } grid $hsb -row 2 -column 0 -sticky ew grid rowconfigure $tf 1 -weight 1 grid columnconfigure $tf 0 -weight 1 pack $b1 $b2 $b3 -side left -expand yes -pady 7p pack $bf -side bottom -fill x pack $tf -side top -expand yes -fill both # # Populate the tablelist with the content of the given directory # $tbl sortbycolumn 0 |
︙ | ︙ |
Changes to examples/tablelist/dirViewer_tile.tcl.
1 2 3 4 5 6 7 8 9 | #!/usr/bin/env wish #============================================================================== # Demonstrates how to use a tablelist widget for displaying the content of a # directory. # # Copyright (c) 2010-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | #!/usr/bin/env wish #============================================================================== # Demonstrates how to use a tablelist widget for displaying the content of a # directory. # # Copyright (c) 2010-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== package require tablelist_tile 6.10 # # Add some entries to the Tk option database # set dir [file dirname [info script]] source [file join $dir option_tile.tcl] |
︙ | ︙ | |||
59 60 61 62 63 64 65 | $tbl columnconfigure 0 -formatcommand formatString -sortmode dictionary $tbl columnconfigure 1 -formatcommand formatSize -sortmode integer $tbl columnconfigure 2 -formatcommand formatString ttk::scrollbar $vsb -orient vertical -command [list $tbl yview] ttk::scrollbar $hsb -orient horizontal -command [list $tbl xview] # | | | | < < < < < < < < < < | 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 | $tbl columnconfigure 0 -formatcommand formatString -sortmode dictionary $tbl columnconfigure 1 -formatcommand formatSize -sortmode integer $tbl columnconfigure 2 -formatcommand formatString ttk::scrollbar $vsb -orient vertical -command [list $tbl yview] ttk::scrollbar $hsb -orient horizontal -command [list $tbl xview] # # On X11 configure the tablelist according # to the display's DPI scaling level # if {[tk windowingsystem] eq "x11"} { $tbl configure -treestyle bicolor$tablelist::scalingpct } # # Create a pop-up menu with one command entry; bind the script # associated with its entry to the <Double-1> event, too # set menu .menu |
︙ | ︙ | |||
115 116 117 118 119 120 121 | } else { grid [$tbl cornerpath] -row 0 -column 1 -sticky ew grid $vsb -row 1 -column 1 -sticky ns } grid $hsb -row 2 -column 0 -sticky ew grid rowconfigure $tf 1 -weight 1 grid columnconfigure $tf 0 -weight 1 | < | | 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 | } else { grid [$tbl cornerpath] -row 0 -column 1 -sticky ew grid $vsb -row 1 -column 1 -sticky ns } grid $hsb -row 2 -column 0 -sticky ew grid rowconfigure $tf 1 -weight 1 grid columnconfigure $tf 0 -weight 1 pack $b1 $b2 $b3 -side left -expand yes -pady 7p pack $bf -side bottom -fill x pack $tf -side top -expand yes -fill both # # Populate the tablelist with the content of the given directory # $tbl sortbycolumn 0 |
︙ | ︙ |
Changes to examples/tablelist/embeddedWindows.tcl.
1 2 3 4 5 6 7 8 | #!/usr/bin/env wish #============================================================================== # Demonstrates the use of embedded windows in tablelist widgets. # # Copyright (c) 2004-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== | | > | > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | #!/usr/bin/env wish #============================================================================== # Demonstrates the use of embedded windows in tablelist widgets. # # Copyright (c) 2004-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== package require tablelist 6.10 wm title . "Tk Library Scripts" # # Add some entries to the Tk option database # set dir [file dirname [info script]] source [file join $dir option.tcl] # # Create the font TkFixedFont if not yet present # catch {font create TkFixedFont -family Courier -size -12} # # Create an image corresponding to the display's DPI scaling # level, to be displayed in buttons embedded in a tablelist widget # set pct $tablelist::scalingpct image create photo openImg -file [file join $dir openAction$pct.gif] # # Create a vertically scrolled tablelist widget with 5 # dynamic-width columns and interactive sort capability # set tf .tf frame $tf -class ScrollArea |
︙ | ︙ | |||
90 91 92 93 94 95 96 | # file whose name is diplayed in the first column of the cell's row. #------------------------------------------------------------------------------ proc createFrame {tbl row col w} { # # Create the frame and replace the binding tag "Frame" # with "TablelistBody" in the list of its binding tags # | > | | | | 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 | # file whose name is diplayed in the first column of the cell's row. #------------------------------------------------------------------------------ proc createFrame {tbl row col w} { # # Create the frame and replace the binding tag "Frame" # with "TablelistBody" in the list of its binding tags # set height [expr {[font metrics $::tblFont -linespace] * 4 / 5}] frame $w -width 72p -height $height -background ivory -borderwidth 1 \ -relief solid bindtags $w [lreplace [bindtags $w] 1 1 TablelistBody] # # Create the child frame and replace the binding tag "Frame" # with "TablelistBody" in the list of its binding tags # frame $w.f -background red -borderwidth 1 -relief raised bindtags $w.f [lreplace [bindtags $w] 1 1 TablelistBody] # # Manage the child frame # set fileSize [$tbl cellcget $row,fileSize -text] place $w.f -relheight 1.0 -relwidth [expr {double($fileSize) / $::maxSize}] } #------------------------------------------------------------------------------ # createButton # # Creates a button widget w to be embedded into the specified cell of the # tablelist widget tbl. |
︙ | ︙ | |||
166 167 168 169 170 171 172 | # # Manage the widgets # grid $txt -row 0 -column 0 -sticky news grid $vsb -row 0 -column 1 -sticky ns grid rowconfigure $tf 0 -weight 1 grid columnconfigure $tf 0 -weight 1 | | | 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 | # # Manage the widgets # grid $txt -row 0 -column 0 -sticky news grid $vsb -row 0 -column 1 -sticky ns grid rowconfigure $tf 0 -weight 1 grid columnconfigure $tf 0 -weight 1 pack $btn -side bottom -pady 7p pack $tf -side top -expand yes -fill both # # Mark the file as seen # $tbl rowconfigure k$key -font BoldFont $tbl cellconfigure k$key,seen -text yes |
︙ | ︙ | |||
201 202 203 204 205 206 207 | grid $vsb -row 0 -rowspan 2 -column 1 -sticky ns } else { grid [$tbl cornerpath] -row 0 -column 1 -sticky ew grid $vsb -row 1 -column 1 -sticky ns } grid rowconfigure $tf 1 -weight 1 grid columnconfigure $tf 0 -weight 1 | | | 204 205 206 207 208 209 210 211 212 | grid $vsb -row 0 -rowspan 2 -column 1 -sticky ns } else { grid [$tbl cornerpath] -row 0 -column 1 -sticky ew grid $vsb -row 1 -column 1 -sticky ns } grid rowconfigure $tf 1 -weight 1 grid columnconfigure $tf 0 -weight 1 pack $btn -side bottom -pady 7p pack $tf -side top -expand yes -fill both |
Changes to examples/tablelist/embeddedWindows_tile.tcl.
1 2 3 4 5 6 7 8 | #!/usr/bin/env wish #============================================================================== # Demonstrates the use of embedded windows in tablelist widgets. # # Copyright (c) 2004-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== | | > | > | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | #!/usr/bin/env wish #============================================================================== # Demonstrates the use of embedded windows in tablelist widgets. # # Copyright (c) 2004-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== package require tablelist_tile 6.10 wm title . "Tile Library Scripts" # # Add some entries to the Tk option database # set dir [file dirname [info script]] source [file join $dir option_tile.tcl] # # Create the font TkFixedFont if not yet present # catch {font create TkFixedFont -family Courier -size -12} # # Create an image corresponding to the display's DPI scaling # level, to be displayed in buttons embedded in a tablelist widget # set pct $tablelist::scalingpct image create photo openImg -file [file join $dir openAction$pct.gif] if {[tablelist::getCurrentTheme] eq "aqua"} { # # Work around the improper appearance of the tile scrollbars # if {[package vcompare $::tk_patchLevel "8.6.10"] < 0} { interp alias {} ttk::scrollbar {} ::scrollbar |
︙ | ︙ | |||
121 122 123 124 125 126 127 | # file whose name is diplayed in the first column of the cell's row. #------------------------------------------------------------------------------ proc createFrame {tbl row col w} { # # Create the frame and replace the binding tag "Frame" # with "TablelistBody" in the list of its binding tags # | > | | | | 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 | # file whose name is diplayed in the first column of the cell's row. #------------------------------------------------------------------------------ proc createFrame {tbl row col w} { # # Create the frame and replace the binding tag "Frame" # with "TablelistBody" in the list of its binding tags # set height [expr {[font metrics $::tblFont -linespace] * 4 / 5}] frame $w -width 72p -height $height -background ivory -borderwidth 1 \ -relief solid bindtags $w [lreplace [bindtags $w] 1 1 TablelistBody] # # Create the child frame and replace the binding tag "Frame" # with "TablelistBody" in the list of its binding tags # frame $w.f -background red -borderwidth 1 -relief raised bindtags $w.f [lreplace [bindtags $w] 1 1 TablelistBody] # # Manage the child frame # set fileSize [$tbl cellcget $row,fileSize -text] place $w.f -relheight 1.0 -relwidth [expr {double($fileSize) / $::maxSize}] } #------------------------------------------------------------------------------ # createButton # # Creates a button widget w to be embedded into the specified cell of the # tablelist widget tbl. |
︙ | ︙ | |||
199 200 201 202 203 204 205 | # # Manage the widgets # grid $txt -row 0 -column 0 -sticky news grid $vsb -row 0 -column 1 -sticky ns grid rowconfigure $tf 0 -weight 1 grid columnconfigure $tf 0 -weight 1 | | | 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 | # # Manage the widgets # grid $txt -row 0 -column 0 -sticky news grid $vsb -row 0 -column 1 -sticky ns grid rowconfigure $tf 0 -weight 1 grid columnconfigure $tf 0 -weight 1 pack $btn -pady 7p pack $bf -side bottom -fill x pack $tf -side top -expand yes -fill both # # Mark the file as seen # $tbl rowconfigure k$key -font BoldFont |
︙ | ︙ | |||
237 238 239 240 241 242 243 | grid $vsb -row 0 -rowspan 2 -column 1 -sticky ns } else { grid [$tbl cornerpath] -row 0 -column 1 -sticky ew grid $vsb -row 1 -column 1 -sticky ns } grid rowconfigure $tf 1 -weight 1 grid columnconfigure $tf 0 -weight 1 | | | 240 241 242 243 244 245 246 247 248 249 | grid $vsb -row 0 -rowspan 2 -column 1 -sticky ns } else { grid [$tbl cornerpath] -row 0 -column 1 -sticky ew grid $vsb -row 1 -column 1 -sticky ns } grid rowconfigure $tf 1 -weight 1 grid columnconfigure $tf 0 -weight 1 pack $btn -pady 7p pack $bf -side bottom -fill x pack $tf -side top -expand yes -fill both |
Changes to examples/tablelist/images.tcl.
1 2 3 4 5 6 7 8 9 | #============================================================================== # Creates some images. # # Copyright (c) 2011-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== # # Create two images, to be displayed in tablelist cells with boolean values # | > | | > > > | | | | | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | #============================================================================== # Creates some images. # # Copyright (c) 2011-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== # # Create two images, to be displayed in tablelist cells with boolean values # set pct $tablelist::scalingpct image create photo checkedImg -file [file join $dir checked$pct.gif] image create photo uncheckedImg -file [file join $dir unchecked$pct.gif] # # Create 16 images representing different colors # set colorNames { "red" "green" "blue" "magenta" "yellow" "cyan" "light gray" "white" "dark red" "dark green" "dark blue" "dark magenta" "dark yellow" "dark cyan" "dark gray" "black" } set colorValues { #FF0000 #00FF00 #0000FF #FF00FF #FFFF00 #00FFFF #C0C0C0 #FFFFFF #800000 #008000 #000080 #800080 #808000 #008080 #808080 #000000 } foreach name $colorNames value $colorValues { set colors($name) $value } array set arr {100 13 125 16 150 20 175 23 200 26} set len $arr($pct) set len1 [expr {$len - 1}] foreach value $colorValues { image create photo img$value -height $len -width $len img$value put gray50 -to 0 0 $len 1 ;# top edge img$value put gray50 -to 0 1 1 $len1 ;# left edge img$value put gray75 -to 0 $len1 $len $len ;# bottom edge img$value put gray75 -to $len1 1 $len $len1 ;# right edge img$value put $value -to 1 1 $len1 $len1 ;# interior } |
Changes to examples/tablelist/iwidgets.tcl.
1 2 3 4 5 6 7 8 9 10 11 | #!/usr/bin/env wish #============================================================================== # Demonstrates the interactive tablelist cell editing with the aid of some # widgets from the Iwidgets package and of the Tk core checkbutton and # menubutton widgets. # # Copyright (c) 2004-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== package require Tk 8.4 ;# because of "-compound" | | > > > > > > < < < < < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | #!/usr/bin/env wish #============================================================================== # Demonstrates the interactive tablelist cell editing with the aid of some # widgets from the Iwidgets package and of the Tk core checkbutton and # menubutton widgets. # # Copyright (c) 2004-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== package require Tk 8.4 ;# because of "-compound" package require tablelist 6.10 if {[catch {package require iwidgets} result1] != 0 && [catch {package require Iwidgets} result2] != 0} { error "$result1; $result2" } wm title . "Serial Line Configuration" # # Add some entries to the Tk option database # set dir [file dirname [info script]] source [file join $dir option.tcl] option add *Tablelist*textBackground white option add *Tablelist*Entry.disabledBackground white option add *Tablelist*Entry.disabledForeground black option add *Tablelist*Dateentry*Label.background white option add *Tablelist*Timeentry*Label.background white # # Create the images "checkedImg" and "uncheckedImg", as well as 16 images of # names like "img#FF0000", displaying colors identified by names like "red" # source [file join $dir images.tcl] # # Register some widgets from the Iwidgets package for interactive cell editing # tablelist::addIncrEntryfield tablelist::addIncrSpinint tablelist::addIncrCombobox tablelist::addIncrDateTimeWidget dateentry -seconds tablelist::addIncrDateTimeWidget timeentry -seconds # # Create a tablelist widget with editable columns (except the first one) # set tbl .tbl tablelist::tablelist $tbl \ -columns {0 "No." right 0 "Available" center |
︙ | ︙ | |||
101 102 103 104 105 106 107 | } set btn [button .btn -text "Close" -command exit] # # Manage the widgets # | | > | 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 | } set btn [button .btn -text "Close" -command exit] # # Manage the widgets # pack $btn -side bottom -pady 7p pack $tbl -side top -expand yes -fill both #------------------------------------------------------------------------------ # editStartCmd # # Applies some configuration options to the edit window; if the latter is a # combobox, the procedure populates it. #------------------------------------------------------------------------------ proc editStartCmd {tbl row col text} { set w [$tbl editwinpath] set pct $tablelist::scalingpct switch [$tbl columncget $col -name] { lineName { # # Set an upper limit of 20 for the number of characters # $w configure -pasting no -fixed 20 |
︙ | ︙ | |||
144 145 146 147 148 149 150 | } parity { # # Populate the combobox and make it non-editable # $w insert list end None Even Odd Mark Space | | | | | 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 | } parity { # # Populate the combobox and make it non-editable # $w insert list end None Even Odd Mark Space $w configure -editable no -listheight [expr {120 * $pct / 100}] } stopBits { # # Populate the combobox and make it non-editable # $w insert list end 1 1.5 2 $w configure -editable no -listheight [expr {60 * $pct / 100}] } handshake { # # Populate the combobox and make it non-editable # $w insert list end XON/XOFF RTS/CTS None $w configure -editable no -listheight [expr {80 * $pct / 100}] } actDate { # # Set the date format "%Y-%m-%d" # $w configure -int yes |
︙ | ︙ |
Changes to examples/tablelist/iwidgets_tile.tcl.
1 2 3 4 5 6 7 8 9 10 | #!/usr/bin/env wish #============================================================================== # Demonstrates the interactive tablelist cell editing with the aid of some # widgets from the Iwidgets package and of the Tk core checkbutton and # menubutton widgets. # # Copyright (c) 2004-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== | | > > > > > > < < < < < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 | #!/usr/bin/env wish #============================================================================== # Demonstrates the interactive tablelist cell editing with the aid of some # widgets from the Iwidgets package and of the Tk core checkbutton and # menubutton widgets. # # Copyright (c) 2004-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== package require tablelist_tile 6.10 if {[catch {package require iwidgets} result1] != 0 && [catch {package require Iwidgets} result2] != 0} { error "$result1; $result2" } wm title . "Serial Line Configuration" # # Add some entries to the Tk option database # set dir [file dirname [info script]] source [file join $dir option_tile.tcl] option add *Tablelist*textBackground white option add *Tablelist*Entry.disabledBackground white option add *Tablelist*Entry.disabledForeground black option add *Tablelist*Dateentry*Label.background white option add *Tablelist*Timeentry*Label.background white # # Create the images "checkedImg" and "uncheckedImg", as well as 16 images of # names like "img#FF0000", displaying colors identified by names like "red" # source [file join $dir images.tcl] # # Register some widgets from the Iwidgets package for interactive cell editing # tablelist::addIncrEntryfield tablelist::addIncrSpinint tablelist::addIncrCombobox tablelist::addIncrDateTimeWidget dateentry -seconds tablelist::addIncrDateTimeWidget timeentry -seconds # # Improve the window's appearance by using a tile # frame as a container for the other widgets # set f [ttk::frame .f] # |
︙ | ︙ | |||
106 107 108 109 110 111 112 | } set btn [ttk::button $f.btn -text "Close" -command exit] # # Manage the widgets # | | > | 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 | } set btn [ttk::button $f.btn -text "Close" -command exit] # # Manage the widgets # pack $btn -side bottom -pady 7p pack $tbl -side top -expand yes -fill both pack $f -expand yes -fill both #------------------------------------------------------------------------------ # editStartCmd # # Applies some configuration options to the edit window; if the latter is a # combobox, the procedure populates it. #------------------------------------------------------------------------------ proc editStartCmd {tbl row col text} { set w [$tbl editwinpath] set pct $tablelist::scalingpct switch [$tbl columncget $col -name] { lineName { # # Set an upper limit of 20 for the number of characters # $w configure -pasting no -fixed 20 |
︙ | ︙ | |||
150 151 152 153 154 155 156 | } parity { # # Populate the combobox and make it non-editable # $w insert list end None Even Odd Mark Space | | | | | 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 | } parity { # # Populate the combobox and make it non-editable # $w insert list end None Even Odd Mark Space $w configure -editable no -listheight [expr {120 * $pct / 100}] } stopBits { # # Populate the combobox and make it non-editable # $w insert list end 1 1.5 2 $w configure -editable no -listheight [expr {60 * $pct / 100}] } handshake { # # Populate the combobox and make it non-editable # $w insert list end XON/XOFF RTS/CTS None $w configure -editable no -listheight [expr {80 * $pct / 100}] } actDate { # # Set the date format "%Y-%m-%d" # $w configure -int yes |
︙ | ︙ |
Changes to examples/tablelist/miscWidgets.tcl.
1 2 3 4 5 6 7 8 9 10 11 | #!/usr/bin/env wish #============================================================================== # Demonstrates the interactive tablelist cell editing with the aid of Bryan # Oakley's combobox, the mentry widgets of type "Date" and "Time", and of the # Tk core entry, spinbox, checkbutton, and menubutton widgets. # # Copyright (c) 2004-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== package require Tk 8.4 ;# because of "-compound" and the spinbox widget | | > > > > > > < < < < < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 | #!/usr/bin/env wish #============================================================================== # Demonstrates the interactive tablelist cell editing with the aid of Bryan # Oakley's combobox, the mentry widgets of type "Date" and "Time", and of the # Tk core entry, spinbox, checkbutton, and menubutton widgets. # # Copyright (c) 2004-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== package require Tk 8.4 ;# because of "-compound" and the spinbox widget package require tablelist 6.10 package require combobox package require mentry wm title . "Serial Line Configuration" # # Add some entries to the Tk option database # set dir [file dirname [info script]] source [file join $dir option.tcl] option add *Tablelist*Entry.background white option add *Tablelist*Spinbox.background white option add *Tablelist*Spinbox.readonlyBackground white option add *Tablelist*Combobox.background white option add *Tablelist*Combobox.elementBorderWidth 2 option add *Tablelist*Mentry.background white # # Create the images "checkedImg" and "uncheckedImg", as well as 16 images of # names like "img#FF0000", displaying colors identified by names like "red" # source [file join $dir images.tcl] # # Register Bryan Oakley's combobox widget as well as the mentry # widgets of type "Date" and "Time" for interactive cell editing # tablelist::addOakleyCombobox tablelist::addDateMentry Ymd - tablelist::addTimeMentry HMS : # # Create a tablelist widget with editable columns (except the first one) # set tbl .tbl tablelist::tablelist $tbl \ -columns {0 "No." right 0 "Available" center |
︙ | ︙ | |||
99 100 101 102 103 104 105 | } set btn [button .btn -text "Close" -command exit] # # Manage the widgets # | | | 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 | } set btn [button .btn -text "Close" -command exit] # # Manage the widgets # pack $btn -side bottom -pady 7p pack $tbl -side top -expand yes -fill both #------------------------------------------------------------------------------ # editStartCmd # # Applies some configuration options to the edit window; if the latter is a # combobox, the procedure populates it. |
︙ | ︙ |
Changes to examples/tablelist/miscWidgets_tile.tcl.
1 2 3 4 5 6 7 8 9 10 | #!/usr/bin/env wish #============================================================================== # Demonstrates the interactive tablelist cell editing with the aid of Bryan # Oakley's combobox, the mentry widgets of type "Date" and "Time", and of the # Tk core entry, spinbox, checkbutton, and menubutton widgets. # # Copyright (c) 2004-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== | | > > > > > > < < < < < < | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 | #!/usr/bin/env wish #============================================================================== # Demonstrates the interactive tablelist cell editing with the aid of Bryan # Oakley's combobox, the mentry widgets of type "Date" and "Time", and of the # Tk core entry, spinbox, checkbutton, and menubutton widgets. # # Copyright (c) 2004-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== package require tablelist_tile 6.10 package require combobox package require mentry wm title . "Serial Line Configuration" # # Add some entries to the Tk option database # set dir [file dirname [info script]] source [file join $dir option_tile.tcl] option add *Tablelist*Entry.background white option add *Tablelist*Spinbox.background white option add *Tablelist*Spinbox.readonlyBackground white option add *Tablelist*Combobox.background white option add *Tablelist*Combobox.elementBorderWidth 2 option add *Tablelist*Mentry.background white # # Create the images "checkedImg" and "uncheckedImg", as well as 16 images of # names like "img#FF0000", displaying colors identified by names like "red" # source [file join $dir images.tcl] # # Register Bryan Oakley's combobox widget as well as the mentry # widgets of type "Date" and "Time" for interactive cell editing # tablelist::addOakleyCombobox tablelist::addDateMentry Ymd - tablelist::addTimeMentry HMS : # # Improve the window's appearance by using a tile # frame as a container for the other widgets # set f [ttk::frame .f] # |
︙ | ︙ | |||
104 105 106 107 108 109 110 | } set btn [ttk::button $f.btn -text "Close" -command exit] # # Manage the widgets # | | | 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 | } set btn [ttk::button $f.btn -text "Close" -command exit] # # Manage the widgets # pack $btn -side bottom -pady 7p pack $tbl -side top -expand yes -fill both pack $f -expand yes -fill both #------------------------------------------------------------------------------ # editStartCmd # # Applies some configuration options to the edit window; if the latter is a |
︙ | ︙ |
Changes to examples/tablelist/styles.tcl.
1 2 3 4 5 6 7 8 | #!/usr/bin/env wish #============================================================================== # Demonstrates some ways of improving the look & feel of a tablelist widget. # # Copyright (c) 2002-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #!/usr/bin/env wish #============================================================================== # Demonstrates some ways of improving the look & feel of a tablelist widget. # # Copyright (c) 2002-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== package require tablelist 6.10 wm title . "Tablelist Styles" # # Get the current windowing system ("x11", "win32", "classic", # or "aqua") and add some entries to the Tk option database # |
︙ | ︙ | |||
83 84 85 86 87 88 89 | foreach row {0 1 2 3} { $tbl insert end \ [list "Cell $row,0" "Cell $row,1" "Cell $row,2" "Cell $row,3"] } } button .close -text "Close" -command exit | < > | | | | | | | 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 | foreach row {0 1 2 3} { $tbl insert end \ [list "Cell $row,0" "Cell $row,1" "Cell $row,2" "Cell $row,3"] } } button .close -text "Close" -command exit # # Manage the widgets # set pad {7p 0} grid .f.tbl0 .f.tbl1 -sticky news -padx $pad -pady $pad grid .f.tbl2 .f.tbl3 -sticky news -padx $pad -pady $pad grid .f.tbl4 .f.tbl5 -sticky news -padx $pad -pady $pad grid .f.tbl6 .f.tbl7 -sticky news -padx $pad -pady $pad grid rowconfigure .f {0 1 2 3} -weight 1 grid columnconfigure .f {0 1} -weight 1 pack .close -side bottom -pady 7p pack .f -side top -expand yes -fill both -padx {0 7p} |
Changes to examples/tablelist/styles_tile.tcl.
1 2 3 4 5 6 7 8 | #!/usr/bin/env wish #============================================================================== # Demonstrates some ways of improving the look & feel of a tablelist widget. # # Copyright (c) 2002-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | #!/usr/bin/env wish #============================================================================== # Demonstrates some ways of improving the look & feel of a tablelist widget. # # Copyright (c) 2002-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== package require tablelist_tile 6.10 wm title . "Tablelist Styles" # # Improve the window's appearance by using a tile # frame as a container for the other widgets # |
︙ | ︙ | |||
67 68 69 70 71 72 73 | foreach row {0 1 2 3} { $tbl insert end \ [list "Cell $row,0" "Cell $row,1" "Cell $row,2" "Cell $row,3"] } } ttk::button $f.close -text "Close" -command exit | < > | | | | | | | 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 | foreach row {0 1 2 3} { $tbl insert end \ [list "Cell $row,0" "Cell $row,1" "Cell $row,2" "Cell $row,3"] } } ttk::button $f.close -text "Close" -command exit # # Manage the widgets # set pad {7p 0} grid $f.f.tbl0 $f.f.tbl1 -sticky news -padx $pad -pady $pad grid $f.f.tbl2 $f.f.tbl3 -sticky news -padx $pad -pady $pad grid $f.f.tbl4 $f.f.tbl5 -sticky news -padx $pad -pady $pad grid $f.f.tbl6 $f.f.tbl7 -sticky news -padx $pad -pady $pad grid rowconfigure $f.f {0 1 2 3} -weight 1 grid columnconfigure $f.f {0 1} -weight 1 pack $f.close -side bottom -pady 7p pack $f.f -side top -expand yes -fill both -padx {0 7p} pack $f -expand yes -fill both |
Changes to examples/tablelist/tileWidgets.tcl.
1 2 3 4 5 6 7 8 9 | #!/usr/bin/env wish #============================================================================== # Demonstrates the interactive tablelist cell editing with the aid of some # widgets from the tile package. # # Copyright (c) 2005-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== | | | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | #!/usr/bin/env wish #============================================================================== # Demonstrates the interactive tablelist cell editing with the aid of some # widgets from the tile package. # # Copyright (c) 2005-2020 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) #============================================================================== package require tablelist_tile 6.10 wm title . "Serial Line Configuration" # # Add some entries to the Tk option database # set dir [file dirname [info script]] |
︙ | ︙ | |||
93 94 95 96 97 98 99 | } set btn [ttk::button $f.btn -text "Close" -command exit] # # Manage the widgets # | | | 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 | } set btn [ttk::button $f.btn -text "Close" -command exit] # # Manage the widgets # pack $btn -side bottom -pady 7p pack $tbl -side top -expand yes -fill both pack $f -expand yes -fill both #------------------------------------------------------------------------------ # editStartCmd # # Applies some configuration options to the edit window; if the latter is a |
︙ | ︙ |