DELETED cbkimages/cbkimages.tcl Index: cbkimages/cbkimages.tcl ================================================================== --- cbkimages/cbkimages.tcl +++ cbkimages/cbkimages.tcl @@ -1,12 +0,0 @@ -package provide cbkimages 1.0 - -if {![info exists library]} { - variable library [file dirname [info script]] -} - -source [file join $library sidebarimages.tcl] -source [file join $library toolbarimages.tcl] -source [file join $library demo.tcl] - - - DELETED cbkimages/demo.tcl Index: cbkimages/demo.tcl ================================================================== --- cbkimages/demo.tcl +++ cbkimages/demo.tcl @@ -1,10 +0,0 @@ -proc cbkimage_demo {} { - pack [text .t] -fill both -expand yes - foreach item [image names] { - .t image create end -image $item - .t insert end \n - .t insert end $item\n\n - } -} - - DELETED cbkimages/license.txt Index: cbkimages/license.txt ================================================================== --- cbkimages/license.txt +++ cbkimages/license.txt @@ -1,5 +0,0 @@ -All images in this library are derived from the PICOL project, http://picol.org.License: http://creativecommons.org/licenses/by/3.0/ - - - - DELETED cbkimages/pkgIndex.tcl Index: cbkimages/pkgIndex.tcl ================================================================== --- cbkimages/pkgIndex.tcl +++ cbkimages/pkgIndex.tcl @@ -1,2 +0,0 @@ - -package ifneeded cbkimages 1.0 [list source [file join $dir cbkimages.tcl]] DELETED cbkimages/sidebarimages.tcl Index: cbkimages/sidebarimages.tcl ================================================================== --- cbkimages/sidebarimages.tcl +++ cbkimages/sidebarimages.tcl @@ -1,203 +0,0 @@ -image create photo sidebarimages::accept_sidebar -data { - -R0lGODlhEAAQAPAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAAIfjI+py+0JwDMx -vmpPphj1gEle+EGkuJBXNYFoC8dPAQA7 - - -} -image create photo sidebarimages::adressbook_sidebar -data { - -R0lGODlhEAAQAPAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAAIqhI8Xa+sPYJqR -1Qddw9lqxXzfFlwkoonWqXKhR0WmTJVibMP17KZrTCoAADs= - - -} -image create photo sidebarimages::battery_full_sidebar -data { - -R0lGODlhEAAQAPAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAAIfjI+py+0PopzT -gBcqpVn2HX0X6GnkaGGXeK7YC8dMAQA7 - - -} -image create photo sidebarimages::book_sans_sidebar -data { - -R0lGODlhEAAQAPAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAAImDI55wcAPDVR0 -NRfns7lt3ElX6I0kyHUoqH6kaLDZ+tKne38V8hQAOw== - - -} -image create photo sidebarimages::bookmark_sidebar -data { - -R0lGODlhEAAQAPAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAAImDI4Yy8Dv3ko0 -QgulwU0fbXjcJILj55WphLKqK1Yj24JNbYdzUAAAOw== - - -} -image create photo sidebarimages::browser_window_sidebar -data { - -R0lGODlhEAAQAPAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAAImhI9pARwPF1MU -wYufzHklbXkWJx6gWW5Y2kztxJFvHM20Wyn3vhcAOw== - - -} -image create photo sidebarimages::calculator_sidebar -data { - -R0lGODlhEAAQAPAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAAInjIGpxqEP2pEs -SktxhSlzlE2O2HzgJVraYYbjuzotCpPbY6f6NQcFADs= - - -} -image create photo sidebarimages::clock_sidebar -data { - -R0lGODlhEAAQAPAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAAIpjA2px6G/2JPR -pXNRzppa4GFTKHIaN5bguTYN5FKg6W50qcotC+06XQAAOw== - - -} -image create photo sidebarimages::comment_sidebar -data { - -R0lGODlhEAAQAPAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAAIljI9pwO2+lAJR -Ihrwg9reujVZ5Y3m9pllV55LKI5Mm820TedGAQA7 - - -} -image create photo sidebarimages::computer_sidebar -data { - -R0lGODlhEAAQAPAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAAIjjI95wO2MgIp0 -GrnsrRZv7QWhEo5J+aTaKqbP4qqx284vixQAOw== - - -} -image create photo sidebarimages::data_privacy_sidebar -data { - -R0lGODlhEAAQAPAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAAIthI+hC+vdnmMq -1lmPxLSHdHngt30aElnoBGGpkZlga8pnAqMQvvM3Z7nohpECADs= - - -} -image create photo sidebarimages::database_sidebar -data { - -R0lGODlhEAAQAPAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAAIljIGpduobngRt -QmrxYbzT2IXgKDLfV25keqam6rbuiLJNXGdMAQA7 - - -} -image create photo sidebarimages::document_image_sidebar -data { - -R0lGODlhEAAQAPAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAAIrhI+hC+vdnmMq -1lmPxLTzYIGMdlFIEkJGBkmkloKr3JrnGn+ix+Vfejs5CgA7 - - -} -image create photo sidebarimages::document_music_sidebar -data { - -R0lGODlhEAAQAPAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAAIshI+hC+vdnmMq -1lmPxLQH631MInpWBJ5d+hmrpGnlFbvz3aIbd4NYigjaFAUAOw== - - -} -image create photo sidebarimages::folder_sans_sidebar -data { - -R0lGODlhEAAQAPAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAAIhjI+pi+DODpCv -vjCN3TC27Glg2IXY6JUkGqkpy7gtRwMFADs= - - -} -image create photo sidebarimages::globe_sidebar -data { - -R0lGODlhEAAQAPAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAAIvjA2px6G/WHLS -gTMnvhr6lV0WwmlUI1rlt7aeijUn3Imhykb3NpIzZSKxZMLIoQAAOw== - - -} -image create photo sidebarimages::information_sidebar -data { - -R0lGODlhEAAQAPAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAAIejI+pAb3Z4jvR -TVavkbrTCmigmF2jWU6nmi6g5SkFADs= - - -} -image create photo sidebarimages::internet_sidebar -data { - -R0lGODlhEAAQAPAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAAIqjI95wMqwHozP -yHutRFk3Oi3WGISidnJRek5usoGg2WG2G3tfuVPKnygAADs= - - -} -image create photo sidebarimages::list_sidebar -data { - -R0lGODlhEAAQAPAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAAIdjI+pm+DhogQm -svau3ry+OXkUZ3XmKUJgWW4tehUAOw== - - -} -image create photo sidebarimages::mail_sidebar -data { - -R0lGODlhEAAQAPAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAAIkjI+pi+API2Rm -OnZv0A1U/4HPwYUgeaJKSW1py1IxJtVji7cFADs= - - -} -image create photo sidebarimages::network_wireless_sidebar -data { - -R0lGODlhEAAQAPAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAAIqjI+pBg0Lw4uy -MXrmXFbeqHlOZj1mtY2n2aHQ+XHfpqQe14513iK6qygAADs= - - -} -image create photo sidebarimages::news_sidebar -data { - -R0lGODlhEAAQAPAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAAIjjI+py30Ao5QG -uIovnTNQHXlht4VKCYnjmp6s9X2O3LwcVQAAOw== - - -} -image create photo sidebarimages::printer_sidebar -data { - -R0lGODlhEAAQAPAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAAIkjI+JwO0KlImJ -wivt0Qv7LQWaQ5JTiZ6oKa5sE8JteKouQ4cFADs= - - -} -image create photo sidebarimages::settings_sidebar -data { - -R0lGODlhEAAQAPAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAAIojI+pBrDnWAxT -tosrzVj13XghNFoaGH2ICq4lObIml3D0SkKPtPdIAQA7 - - -} -image create photo sidebarimages::source_code_sidebar -data { - -R0lGODlhEAAQAPAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAAIjjI+py72gYJQI -UGNZxjdsD33cZYllkn0ieKxt57pe5NT2rRQAOw== - - -} -image create photo sidebarimages::speaker_louder_sidebar -data { - -R0lGODlhEAAQAPAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAAIpjI+pywf4GIhu -TRrzvSF3s3Hfo4XgCIYemZpouX1oIsoUdMsW1PR+UgAAOw== - - -} -image create photo sidebarimages::star_sidebar -data { - -R0lGODlhEAAQAPAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAAIjjI+pBrDbXmpR -Mqqo3jrw71xgdYwhYkKfCmajW3UoWdInZBQAOw== - - -} -image create photo sidebarimages::text_sidebar -data { - -R0lGODlhEAAQAPAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAAIijI+pC72Mmpwg -1EOpfS7yi30JOJIbY5pYKnro2IZPqc5GAQA7 - - -} -image create photo sidebarimages::user_close_sidebar -data { - -R0lGODlhEAAQAPAAAAAAAAAAACH5BAEAAAEALAAAAAAQABAAAAIdjI+pAQ2LnINM -zmWvyg3y51mUIY0m+YnpyrbuyxYAOw== - - -} DELETED cbkimages/test.tcl Index: cbkimages/test.tcl ================================================================== --- cbkimages/test.tcl +++ cbkimages/test.tcl @@ -1,3 +0,0 @@ -lappend auto_path . -package require cbkimages -cbkimage_demo DELETED cbkimages/toolbarimages.tcl Index: cbkimages/toolbarimages.tcl ================================================================== --- cbkimages/toolbarimages.tcl +++ cbkimages/toolbarimages.tcl @@ -1,148 +0,0 @@ -image create photo toolbarimages::accept_toolbar -data { - -R0lGODlhIAAgAPAAAAAAAAAAACH5BAEAAAEALAAAAAAgACAAAAJHjI+py+0Po5y0 -2osXAJnt3SXfFxrjGJ5oppIN+LZcDCvy7J227PDH/QAGhMGbL2JUVZKuZZJFxBw7 -ypKpaR3istyu9wsOHwoAOw== - - -} -image create photo toolbarimages::arrow_full_down_toolbar -data { - -R0lGODlhIAAgAPAAAAAAAAAAACH5BAEAAAEALAAAAAAgACAAAAJNjI+py+3PgJxU -wljzXVnv1FUfGE4jUpqnkVpr0AIv3M6xXb+3nq+7EwuqDsIfqhhqID3Kpevh/CBP -Ql5qRktis6Itq+v9PsNfsvkcKAAAOw== - - -} -image create photo toolbarimages::arrow_full_up_toolbar -data { - -R0lGODlhIAAgAPAAAAAAAAAAACH5BAEAAAEALAAAAAAgACAAAAJGjI+py+0PAwCx -mjktxFg3znkKCIoHSZoo6q2r5bpRHD80/d34qN9J39vsRD7VsHXUFIlJWLOyRNaM -U2ZVKqNmrVuT9/soAAA7 - - -} -image create photo toolbarimages::book -data { - -R0lGODlhIAAgAPAAAAAAAAAAACH5BAEAAAEALAAAAAAgACAAAAJfDI6pm+HPojwP -0oqz1eby72HTqGTkCZjIx3Zq2IqpDMcbPdvym+t31fABe46gsEjs1HQ147G5OiJ5 -0imu6rpWoUsbN8lMOoVfbHkrjkrP63Q3xn66wd65eY6KaPKTTAEAOw== - - -} -image create photo toolbarimages::cancel_toolbar -data { - -R0lGODlhIAAgAPAAAAAAAAAAACH5BAEAAAEALAAAAAAgACAAAAJfjI+py+1/AIBK -NmmpwbPyDn3gJo5MOaJmorLo+XqlLF4xOTttsD9qH/p9NBFhhogDInnK5W+JMEKZ -UqSRQ7wOg7mmK5fcLppeL7UWvY3Vahi6iKW800c5xgatT/f8RAEAOw== - - -} -image create photo toolbarimages::clock_toolbar -data { - -R0lGODlhIAAgAPAAAAAAAAAAACH5BAEAAAEALAAAAAAgACAAAAJsjI8By50PTZsz -RoqrPbmzrWBPZoklBaGIs2qc+y4jDMdAyoYfLvN9bbs4gEEhyXhDEovKXbPXUj2T -0aXEVM35tFcpaNP5gsNipQ5atiWtIBfbrKaKvWf0mNvFZ+17/vHk8XcXqAcYmJbg -AVIAADs= - - -} -image create photo toolbarimages::document_sans_add_toolbar -data { - -R0lGODlhIAAgAPAAAAAAAAAAACH5BAEAAAEALAAAAAAgACAAAAJ3hI+Jwe2tYnw0 -mFoThmC/e3iXxzEhNpJWZ6Yfq0ooTMoZrTqujuft7KPsSkEesEgU9nzDH1KhLEpc -zRn1tGJWT9UX7drpGsclcQu309R6w8X6PFmZs/K4W8TOz7FODn+Thha2pPRlOKhF -yEVYCAYzBTnFE0nZUwAAOw== - - -} -image create photo toolbarimages::document_sans_remove_toolbar -data { - -R0lGODlhIAAgAPAAAAAAAAAAACH5BAEAAAEALAAAAAAgACAAAAJyhI+Jwe2tYnw0 -mFoThmC/e3iXxzEhNpJWZ6Yfq0ooTMoZrTqujuft7KPsSkEesEgU9nzDH1KhLEpc -zRn1tGJWT9XXktPpGmvhL88MFjtj2M1oylqQWza5CH3Gr/Qatl9Nd1em9cWlR3eV -Arc4kcYIR1EAADs= - - -} -image create photo toolbarimages::document_toolbar -data { - -R0lGODlhIAAgAPAAAAAAAAAAACH5BAEAAAEALAAAAAAgACAAAAJfhI+Jwe2tYnw0 -mFoThmC/e3iXxzEhNpJWZ6Yfq0ooTMoZrTqujuft7KPsSkEesEgU9nzDH9KpfEJf -0tXx2bRKs9nYUov9dmvir/eK5JrJ6KK6+t6W4XP5TILX3PL8bwEAOw== - - -} -image create photo toolbarimages::download_toolbar -data { - -R0lGODlhIAAgAPAAAAAAAAAAACH5BAEAAAEALAAAAAAgACAAAAJHjI+py+0PgQSw -nkltxXrPHn2gw40JhopmWpoGm7kXKittjUj4zve+CwsKY4GhkTY7HnPK5YzZRL6I -0RS0Crtirb+u9wsOOwoAOw== - - -} -image create photo toolbarimages::folder -data { - -R0lGODlhIAAgAPAAAAAAAAAAACH5BAEAAAEALAAAAAAgACAAAAJLjI+py+0Po5wM -2IupwhzoZG3dSBohSKZZcCLqy4kw/Dlrvdw42u7u5ZN5gr8eUXcEEg/IYNP33EVx -01r1c9VkKdtJV/KNzMbkMqkAADs= - - -} -image create photo toolbarimages::information_toolbar -data { - -R0lGODlhIAAgAPAAAAgSEQAAACH5BAEAAAEALAAAAAAgACAAAAJFjI+py+3vgJyw -zgtqxFcz3nkKSIkJKZknqiJo1h5kvIb0jatv2u5w/LoFaUMgi3g0zpBLJUiY7EV1 -U1PR6vt5stqcl1YAADs= - - -} -image create photo toolbarimages::refresh_toolbar -data { - -R0lGODlhIAAgAPAAAAAAAAAAACH5BAEAAAEALAAAAAAgACAAAAJkjI+py+3vgJwS -NoqxRbnP7YVf5HHlpaGUOpKrkoGp2Vrz8W5GvvNyfftVcDVdgOfTIYtKIFNIGxpv -KUCzuJJCkh2hNdHdBntJ2Jjs1J6PMbT0fDqxv9Pw0Rgt4+V48Lo/R/dQAAA7 - - -} -image create photo toolbarimages::satellite_ground_toolbar -data { - -R0lGODlhIAAgAPAAAAAAAAAAACH5BAEAAAEALAAAAAAgACAAAAJojI8Bu+n/mITU -yVbzmborbHAewmzXSGIXgKbsB7ZmWNJvEru2ncN3uvNFRKaXqserFWE0yCp3ZCmf -K5zxWqQSj82k9tf5nlBiYriMpKCVmnV66Pa439a5fE534e/7UZ+M1mLnF0e4VgAA -Ow== - - -} -image create photo toolbarimages::search_toolbar -data { - -R0lGODlhIAAgAPAAAAAAAAAAACH5BAEAAAEALAAAAAAgACAAAAJXjI+py+2vgJwQ -zkvruojrLjHZN24hCVipVoqnyq5w9T61cze5G8v6zrP5VMOEp+c60koYJbEJLQo5 -UenHUL0mm1oTtBuJgo3i8SFrxn7TamfazQay55oCADs= - - -} -image create photo toolbarimages::security_closed_toolbar -data { - -R0lGODlhIAAgAPAAAAAAAAAAACH5BAEAAAEALAAAAAAgACAAAAJRjI+py+0Po5w0 -gYvrwjxr04XAJ4ZkB6IVp7CUisCRnHqS29qzHvNNCfTlgiUIEWg8ipJK2qbpHEIv -zOnoYRVaslcHt/vjVqdjaLl5Vn7WbEcBADs= - - -} -image create photo toolbarimages::settings_toolbar -data { - -R0lGODlhIAAgAPAAAAAAAAAAACH5BAEAAAEALAAAAAAgACAAAAJhjI+py+0PgQSw -nkltxVrJxIGZE2JhcC7myqZeC7tv3G4rwloms0cy/hNNSMHaw2hANpRKXu7yJN5U -wWQVOlxesR9q1tezho+0qLZsnqGnzqxx7BWOxB1gt36e49X7vh9fAAA7 - - -} -image create photo toolbarimages::upload_toolbar -data { - -R0lGODlhIAAgAPAAAAAAAAAAACH5BAEAAAEALAAAAAAgACAAAAJIjI+py+0PAwCx -mjktxFg3znkKCIoHSZpJqC5su3ZwnM3Ia0tyzvf+70IJhzsd8Vg6IZe1C3N5oyif -SWeUisMer1oU8AsOi8UFADs= - - -} DELETED machelp/help.tcl Index: machelp/help.tcl ================================================================== --- machelp/help.tcl +++ machelp/help.tcl @@ -1,650 +0,0 @@ -#+########################################################################## -# -# Hypertext HelpSystem.tcl -- A help system based on wiki 1194 and tile -# by Keith Vetter, May 2007 -# -# with support for images and launching external clients for URL by Kevin Walzer -# - -pacakge require xplat -if {[tk windowingsystem] eq "aqua"} { - package require cocoaprint -} - -package rqeuire xplat - -namespace eval ::Help { - variable W ;# Various widgets - variable pages ;# All the help pages - variable alias ;# Alias to help pages - variable state - variable font TkTextFont - - array unset pages - array unset alias - array unset state - array set state {history {} seen {} current {} all {} allTOC {} haveTOC 0} - array set W {top .helpSystem main "" tree ""} - array set alias {index Index previous Previous back Back search Search - history History next Next} - - if {![info exists library]} { - variable library [file dirname [info script]] - } -} - - - -## BON HELP -##+########################################################################## -# -# Help Section -# -# Based on http://wiki.tcl.tk/1194 -# -# AddPage title aliases text -- register a hypertext page -# Help ?title? -- bring up a toplevel showing the specified page -# or a index of titles, if not specified -# -# Hypertext pages are in a subset of Wiki format: -# indented lines come in fixed font without evaluation; -# blank lines break paragraphs -# a line starting with " * " gets a bullet -# a line starting with " - " gets a dash -# a line starting with " 1. " will be a numbered list -# repeating the initial *,- or "1" will indent the list -# -# text enclosed by '''''' is embolden -# text enclosed by '''' is italics -# all lines without leading blanks are displayed without explicit -# linebreak (but possibly word-wrapped) -# a link is the title of another page in brackets (see examples at -# end). Links are displayed underlined and blue (or purple if they -# have been visited before), and change the cursor to a pointing -# hand. Clicking on a link of course brings up that page. -# -# In addition, you get "Index", "Search" (case-insensitive regexp in -# titles and full text), "History", and "Back" links at the bottom of -# pages. - - -##+########################################################################## -# -# ::Help::Help -- initializes and creates the help dialog -# -proc ::Help::Help {{title ""}} { - variable W - - if {![winfo exists $W(top)]} { - ::Help::DoDisplay $W(top) - } - - raise $W(top) - ::Help::Show $title -} -##+########################################################################## -# -# ::Help::ReadHelpFiles -- reads "help.txt" in the packages directory -# and creates all the help pages. -# -proc ::Help::ReadHelpFiles {dir} { - - set fname [file join $dir help.txt] - set fin [open $fname r] - set data [read $fin] ; list - close $fin - - regsub -all -line {^-+$} $data \x01 data - regsub -all -line {^\#.*$\n} $data {} data - foreach section [split $data \x01] { - set n [regexp -line {^title:\s*(.*)$} $section => title] - if {! $n} { - puts "Bad help section\n'[string range $section 0 400]'" - continue - } - set aliases {} - foreach {. alias} [regexp -all -line -inline {^alias:\s*(.*)$} $section] { - lappend aliases $alias - } - - regsub -all -line {^(title:|alias:).*$\n} $section {} section - ::Help::AddPage $title $aliases $section - } - ::Help::BuildTOC -} - -##+########################################################################## -# -# ::Help::Read Images -- reads "images.tcl" in the packages directory -# and creates all images for the help pages. -##+########################################################################## - -proc ::Help::ReadImages {dir} { - - variable library - - source [file join $library images.tcl] - -} - - -# -# ::Help::AddPage -- Adds another page to the help system -# -proc ::Help::AddPage {title aliases body} { - variable pages - variable state - variable alias - - set title [string trim $title] - set body [string trim $body "\n"] - regsub -all {\\\n} $body {} body ;# Remove escaped lines - regsub -all {[ \t]+\n} $body "\n" body ;# Remove trailing spaces - regsub -all {([^\n])\n([^\s])} $body {\1 \2} body ;# Unwrap paragraphs - - set pages($title) $body - - lappend aliases [string tolower $title] - foreach name $aliases { set alias([string tolower $name]) $title } - - if {[lsearch $state(all) $title] == -1} { - set state(all) [lsort [lappend state(all) $title]] - } -} -##+########################################################################## -# -# ::Help::DoDisplay -- Creates our help display. If we have tile 0.7.8 then -# we will also have a TOC pane. -# -proc ::Help::DoDisplay {TOP} { - variable state - - catch {destroy $TOP} - toplevel $TOP - wm title $TOP "Help" - - frame $TOP.bottom -bd 2 -relief ridge - button $TOP.b -text "Print" -command [list ::Help::PrintHelp $TOP] - pack $TOP.bottom -side bottom -fill both - pack $TOP.b -side bottom -expand 1 -pady 10 -in $TOP.bottom - - set P $TOP.p - if {1} { ;# Need tags on treeview - set state(haveTOC) 1 - ::ttk::panedwindow $P -orient horizontal - - pack $P -side top -fill both -expand 1 - frame $P.toc -relief ridge - frame $P.help -bd 2 -relief ridge - - $P add $P.toc - $P add $P.help - ::Help::CreateTOC $P.toc - ::Help::CreateHelp $P.help - } else { - set state(haveTOC) 0 - frame $P - pack $P -side top -fill both -expand 1 - ::Help::CreateHelp $P - } - - bind $TOP [list wm withdraw $TOP] - bind $TOP [list wm withdraw $TOP] - -} -##+########################################################################## -# -# ::Help::CreateTOC -- Creates a TOC display from tile's treeview widget -# -proc ::Help::CreateTOC {TOC} { - variable W - - set W(tree) $TOC.tree - scrollbar $TOC.sby -orient vert -command "$W(tree) yview" - #scrollbar $TOC.sbx -orient hori -command "$W(tree) xview" - - ::ttk::treeview $W(tree) -padding {0 0 0 0} -selectmode browse \ - -yscrollcommand "$TOC.sby set" ;#$ -xscrollcommand "$TOC.sbx set" - - grid $W(tree) $TOC.sby -sticky news - #grid $TOC.sbx -sticky ew - grid rowconfigure $TOC 0 -weight 1 - grid columnconfigure $TOC 0 -weight 1 - - $W(tree) heading #0 -text "Table of Contents" - $W(tree) tag configure link -foreground blue - # NB. binding to buttonpress sometimes "misses" clicks - #$W(tree) tag bind link ::Help::ButtonPress - bind $W(tree) <> ::Help::TreeviewSelection - ::Help::BuildTOC -} -##+########################################################################## -# -# ::Help::CreateHelp -- Creates our main help widget -# -proc ::Help::CreateHelp {w} { - variable W - variable font - - set W(main) $w.t - text $w.t -border 5 -relief flat -wrap word -state disabled -width 60 \ - -yscrollcommand "$w.s set" -padx 5 -font $font - scrollbar $w.s -orient vert -command "$w.t yview" - pack $w.s -fill y -side right - pack $w.t -fill both -expand 1 -side left - - $w.t tag config link -foreground blue -underline 1 - $w.t tag config seen -foreground purple4 -underline 1 - $w.t tag bind link "$w.t config -cursor pointinghand" - $w.t tag bind link "$w.t config -cursor {}" - $w.t tag bind link <1> "::Help::Click $w.t %x %y" - $w.t tag config hdr -font {-size 18} - $w.t tag config fix -font \ - "[font actual [$w.t cget -font]] -family Courier" - $w.t tag config bold -font \ - "[font actual [$w.t cget -font]] -weight bold" - $w.t tag config italic -font \ - "[font actual [$w.t cget -font]] -slant italic" - - set l1 [font measure $font " "] - set l2 [font measure $font " \u2022 "] - set l3 [font measure $font " \u2013 "] - set l3 [expr {$l2 + ($l2 - $l1)}] - $w.t tag config bullet -lmargin1 $l1 -lmargin2 $l2 - $w.t tag config number -lmargin1 $l1 -lmargin2 $l2 - $w.t tag config dash -lmargin1 $l1 -lmargin2 $l2 - - bind $w.t [list ::Help::Next $w.t 1] - bind $w.t

[list ::Help::Next $w.t -1] - bind $w.t [list ::Help::Back $w.t] - bind $w.t [bind Text ] - - # Create the bitmap for our bullet - if {0 && [lsearch [image names] ::img::bullet] == -1} { - image create bitmap ::img::bullet -data { - #define bullet_width 11 - #define bullet_height 9 - static char bullet_bits[] = { - 0x00,0x00, 0x00,0x00, 0x70,0x00, 0xf8,0x00, 0xf8,0x00, - 0xf8,0x00, 0x70,0x00, 0x00,0x00, 0x00,0x00 - }; - } - } -} -##+########################################################################## -# -# ::Help::Click -- Handles clicking a link on the help page -# -proc ::Help::Click {w x y} { - set range [$w tag prevrange link "[$w index @$x,$y] + 1 char"] - - if {[tk windowingsystem] eq "aqua"} { - package require launcher - if {[llength $range] && [regexp "http*" [eval $w get $range]]} { - launcher::launchurl [eval $w get $range] - return - } - if {[llength $range] && [regexp "@" [eval $w get $range]]} { - - set mail [eval $w get $range] - launcher::launchurl "mailto:$mail" - return - } - } - - if {[llength $range]} {::Help::Show [eval $w get $range]} - -} -##+########################################################################## -# -# ::Help::Back -- Goes back in help history -# -proc ::Help::Back {w} { - variable state - - set l [llength $state(history)] - if {$l <= 1} return - set last [lindex $state(history) [expr {$l-2}]] - set history [lrange $state(history) 0 [expr {$l-3}]] - ::Help::Show $last - -} -##+########################################################################## -# -# ::Help::Next -- Goes to next help page -# -proc ::Help::Next {w dir} { - variable state - - set what $state(all) - if {$state(allTOC) ne {}} {set what $state(allTOC)} ;# TOC order if we can - - set n [lsearch -exact $what $state(current)] - set n [expr {($n + $dir) % [llength $what]}] - set next [lindex $what $n] - ::Help::Show $next - -} -##+########################################################################## -# -# ::Help::Listpage -- Puts up a help page with a bunch of links (all or history) -# -proc ::Help::Listpage {w llist} { - foreach i $llist {$w insert end \n; ::Help::Showlink $w $i} -} -##+########################################################################## -# -# ::Help::Search -- Creates search help page -# -proc ::Help::Search {w} { - $w insert end "\nSearch phrase: " - entry $w.e -textvar ::Help::state(search) - $w window create end -window $w.e - focus $w.e - $w.e select range 0 end - bind $w.e "::Help::DoSearch $w" - button $w.b -text "Search Help" -command "::Help::DoSearch $w" - $w window create end -window $w.b -} -##+########################################################################## -# -# ::Help::DoSearch -- Does actual help search -# -proc ::Help::DoSearch {w} { - variable pages - variable state - - $w config -state normal - $w insert end "\n\nSearch results for '$state(search)':\n" - foreach i $state(all) { - if {[regexp -nocase $state(search) $i]} { ;# Found in title - $w insert end \n - ::Help::Showlink $w $i - } elseif {[regexp -nocase -indices -- $state(search) $pages($i) pos]} { - set p1 [expr {[lindex $pos 0]-20}] - set p2 [expr {[lindex $pos 1]+20}] - regsub -all \n [string range $pages($i) $p1 $p2] " " context - $w insert end \n - ::Help::Showlink $w $i - $w insert end " - ...$context..." - } - } - $w config -state disabled -} -##+########################################################################## -# -# ::Help::Showlink -- Displays link specially -# -proc ::Help::Showlink {w link {tag {}}} { - variable state - - set tag [concat $tag link] - set title [::Help::FindPage $link] - if {[lsearch -exact $state(seen) $title] > -1} { - lappend tag seen - } - - if {[lsearch [image names] $link] >= 0} { - set end0 [$w index end] - $w insert end "\n" - $w image create end -image $link - $w insert end "\n" - return - } - - $w insert end $link $tag -} - - -##+########################################################################## -# -# ::Help::FindPage -- Finds actual pages given a possible alias -# -proc ::Help::FindPage {title} { - variable pages - variable alias - - if {[info exists pages($title)]} { return $title } - set title2 [string tolower $title] - if {[info exists alias($title2)]} { return $alias($title2) } - return "ERROR!" -} -##+########################################################################## -# -# ::Help::Show -- Shows help or meta-help page -# -proc ::Help::Show {title} { - variable pages - variable alias - variable state - variable W - - set w $W(main) - set title [::Help::FindPage $title] - - if {[lsearch -exact $state(seen) $title] == -1} {lappend state(seen) $title} - $w config -state normal - $w delete 1.0 end - $w insert end $title hdr "\n" - set next 0 ;# Some pages have no next page - switch -- $title { - Back { ::Help::Back $w; return} - History { ::Help::Listpage $w $state(history)} - Next { ::Help::Next $w 1; return} - Previous { ::Help::Next $w -1; return} - Index { ::Help::Listpage $w $state(all)} - Search { ::Help::Search $w} - default { ::Help::ShowPage $w $title ; set next 1 } - } - - # Add bottom of the page links - $w insert end \n------\n {} - if {! $state(haveTOC) && [info exists alias(toc)]} { - $w insert end TOC link " - " {} - } - $w insert end Index link " - " {} Search link - if {$next} { - $w insert end " - " {} Previous link " - " {} Next link - } - if {[llength $state(history)]} { - $w insert end " - " {} History link " - " {} Back link - } - - $w insert end \n - lappend state(history) $title - $w config -state disabled - - set state(current) $title - -} -##+########################################################################## -# -# ::Help::ShowPage -- Shows a text help page, doing wiki type transforms -# -proc ::Help::ShowPage {w title} { - - variable pages - - set endash \u2013 - set emdash \u2014 - set bullet \u2022 - - $w insert end \n ;# Space down from the title - if {! [info exists pages($title)]} { - set lines [list "This help page is missing."] - } else { - set lines [split $pages($title) \n] - } - - foreach line $lines { - set tag {} - set op1 "" - if {[regexp {^ +([1*-]+)\s*(.*)} $line -> op txt]} { - set op1 [string index $op 0] - set lvl [expr {[string length $op] - 1}] - set indent [string repeat " " $lvl] - if {$op1 eq "1"} { ;# Number - if {! [info exists number($lvl)]} { set number($lvl) 0 } - set tag number - incr number($lvl) - $w insert end "$indent $number($lvl)" $tag - } elseif {$op1 eq "*"} { ;# Bullet - set tag bullet - $w insert end "$indent $bullet " $tag - } elseif {$op1 eq "-"} { ;# Dash - set tag dash - $w insert end "$indent $endash " $tag - } - set line $txt - } elseif {[string match " *" $line]} { ;# Line beginning w/ a space - $w insert end $line\n fix - unset -nocomplain number - continue - } - if {$op1 ne "1"} {unset -nocomplain number} - - while {1} { ;# Look for markups - set link0 [set bold0 [set ital0 $line]] - set n1 [regexp {^(.*?)[[](.*?)[]](.*$)} $line -> link0 link link1] - set n2 [regexp {^(.*?)'''(.*?)'''(\s*.*$)} $line -> bold0 bold bold1] - set n3 [regexp {^(.*?)''(.*?)''(\s*.*$)} $line -> ital0 ital ital1] - if {$n1 == 0 && $n2 == 0 && $n3 == 0} break - - set len1 [expr {$n1 ? [string length $link0] : 9999}] - set len2 [expr {$n2 ? [string length $bold0] : 9999}] - set len3 [expr {$n3 ? [string length $ital0] : 9999}] - - if {$len1 < $len3} { - $w insert end $link0 $tag - ::Help::Showlink $w $link $tag - set line $link1 - } elseif {$len2 <= $len3} { - $w insert end $bold0 $tag $bold [concat $tag bold] - set line $bold1 - } else { - $w insert end $ital0 $tag $ital [concat $tag italic] - set line $ital1 - } - } - $w insert end "$line\n" $tag - } - -} - - -##+########################################################################## -# -# ::Help::BuildTOC -- Fills in our TOC widget based on a TOC page -# -proc ::Help::BuildTOC {} { - variable W - variable pages - variable state - - set state(allTOC) {} ;# All pages in TOC ordering - if {! [winfo exists $W(tree)]} return - set tocData $pages([::Help::FindPage toc]) - - $W(tree) delete [$W(tree) child {}] - unset -nocomplain parent - set parent() {} - - regsub -all {'{2,}} $tocData {} tocData - foreach line [split $tocData \n] { - set n [regexp {^\s*(-+)\s*(.*)} $line => dashes txt] - if {! $n} continue - - set isLink [regexp {^\[(.*)\]$} $txt => txt] - set pDashes [string range $dashes 1 end] - set parent($dashes) [$W(tree) insert $parent($pDashes) end -text $txt] - if {$isLink} { - $W(tree) item $parent($dashes) -tag link - - set ptitle [::Help::FindPage $txt] - if {[lsearch $state(allTOC) $ptitle] == -1} { - lappend state(allTOC) $ptitle - } - } - } -} -##+########################################################################## -# -# ::Help::ButtonPress -- Handles clicking on a TOC link -# !!! Sometimes misses clicks, so we're using TreeviewSelection instead -# -proc ::Help::ButtonPress {} { - variable W - - set id [$W(tree) selection] - set title [$W(tree) item $id -text] - ::Help::Show $title -} -##+########################################################################## -# -# ::Help::TreeviewSelection -- Handles clicking on any item in the TOC -# -proc ::Help::TreeviewSelection {} { - variable W - - set id [$W(tree) selection] - set title [$W(tree) item $id -text] - set tag [$W(tree) item $id -tag] - if {$tag eq "link"} { - ::Help::Show $title - } else { ;# Make all children visible - set last [lindex [$W(tree) children $id] end] - if {$last ne {} && [$W(tree) item $id -open]} { - $W(tree) see $last - } - } -} -proc CenterWindow {w} { - wm withdraw $w - set x [expr [winfo screenwidth $w]/2 - [winfo reqwidth $w]/2 \ - - [winfo vrootx [winfo parent $w]]] - set y [expr [winfo screenheight $w]/2 - [winfo reqheight $w]/2 \ - - [winfo vrooty [winfo parent $w]]] - wm geom $w +$x+$y - wm deiconify $w -} - - -proc ::Help::PrintHelp {w} { - - set printfile [open [file join $::env(TMPDIR) help.txt] w+] - puts $printfile [$w.p.help.t get 1.0 end] - close $printfile - - switch [tk windowingsystem] { - "aqua" { - - exec /usr/bin/textutil -convert html [file join $::env(TMPDIR) help.txt] -output [file join $::env(TMPDIR) help.html] 2>[file join $::env(TMPDIR) converterr] - catch {exec /usr/sbin/cupsfilter -i "text/html" [file join $::env(TMPDIR) help.html] > [file join $::env(TMPDIR) help.pdf] 2>[file join $::env(TMPDIR) printerr]} - after 100 - cocoaprint::print [file join $::env(TMPDIR) help.pdf] $w - } - - "x11" { - - xplat::print [file join $::env(TMPDIR) help.txt] - } - "win32" { - xplat::print [file join $::env(TMPDIR) help.txt] - } - } -} - - - -proc ::Help::Startup {appname} { - - variable library - - ::Help::ReadHelpFiles $library - ::Help::ReadImages $library - ::Help::Help "appname User Help" - - -} - - DELETED machelp/machelp.tcl Index: machelp/machelp.tcl ================================================================== --- machelp/machelp.tcl +++ machelp/machelp.tcl @@ -1,59 +0,0 @@ -package provide machelp 1.0 - -package require xplat - -namespace eval machelp { - - - if {![info exists library]} { - variable library [file dirname [info script]] - } - - - #set app name and version to parse help url correctly - proc setAppName {app version} { - - variable appname - variable appversion - - set appname $app - set appversion $version - - } - - - #open help url online - proc userhelp {} { - - variable appname - variable appversion - variable library - - source [file join $machelp::library help.tcl] - - } - - #e-mail developer for assistance - proc usermail {} { - - variable appname - variable appversion - - xplat::launch mailto:kw@codebykevin.com?subject=$appname - } - - - - #e-mail developer for assistance - proc appweb {} { - - variable appname - variable appversion - - xplat::launch http://www.codebykevin.com/$appname.html - - } - - namespace export * - -} DELETED machelp/pkgIndex.tcl Index: machelp/pkgIndex.tcl ================================================================== --- machelp/pkgIndex.tcl +++ machelp/pkgIndex.tcl @@ -1,5 +0,0 @@ -package ifneeded machelp 1.0 [list source [file join $dir machelp.tcl]] - - - - DELETED regproc/pkgIndex.tcl Index: regproc/pkgIndex.tcl ================================================================== --- regproc/pkgIndex.tcl +++ regproc/pkgIndex.tcl @@ -1,11 +0,0 @@ -# Tcl package index file, version 1.1 -# This file is generated by the "pkg_mkIndex" command -# and sourced either when an application starts up or -# by a "package unknown" script. It invokes the -# "package ifneeded" command to set up package-related -# information so that packages will be loaded automatically -# in response to "package require" commands. When this -# script is sourced, the variable $dir must contain the -# full path name of this file's directory. - -package ifneeded regproc 1.4 [list source [file join $dir regproc.tcl]] DELETED regproc/regproc.tcl Index: regproc/regproc.tcl ================================================================== --- regproc/regproc.tcl +++ regproc/regproc.tcl @@ -1,221 +0,0 @@ -#regproc.tcl routines to register serial numbers - -# Copyright (C) 2015 WordTech Communications LLC - -#MIT license. - -package provide regproc 1.4 -package require http - -package require xplat -package require cbkimages - - -namespace eval regproc { - - if {![info exists library]} { - variable library [file dirname [info script]] - } - - #dialog before demo has expired - proc makePitch {} { - variable version - variable appname - variable appstore - - toplevel .purchase - wm title .purchase "Purchase $appname" - wm resizable .purchase 0 0 - - wm withdraw .purchase - wm transient .purchase . - - wm protocol .purchase WM_DELETE_WINDOW {} - - ttk::frame .purchase.top -padding 10 - pack .purchase.top -side top -fill both -expand yes - ttk::label .purchase.top.label -text "You are currently using a demo of $appname. This version will give you the chance to try \n$appname free of charge for 30 days. Would you like to buy $appname now?" -image toolbarimages::clock_toolbar -compound left -anchor n - - pack .purchase.top.label -side top -fill x -expand yes - - ttk::frame .purchase.bottom -padding 5 - pack .purchase.bottom -side bottom -fill both -expand yes - - ttk::frame .purchase.bottom.upper - pack .purchase.bottom.upper -side top -fill both -expand no - - - ttk::frame .purchase.bottom.lower -padding 5 - pack .purchase.bottom.lower -side bottom -fill both -expand no - - ttk::button .purchase.bottom.lower.install -text "Purchase" -default active -command "xplat::launch http://www.codebykevin.com/$appname.html; regproc::getReg; destroy .purchase" - ttk::button .purchase.bottom.lower.cancel -text "Cancel" -command " destroy .purchase; raise ." - pack .purchase.bottom.lower.install .purchase.bottom.lower.cancel -side right -fill both -expand no - - ::tk::PlaceWindow .purchase widget . - - wm deiconify .purchase - focus .purchase.bottom.lower.install - after idle [list after 0 wm attributes .purchase -notify 1] - - bind all [list add [list wm attributes . -notify 0]] - - } - - #check for license, validate if found, set demo pitch if not found - proc readLic {application version} { - - variable serial - variable datadir - variable appname - variable appversion - variable appstore - - set appname $application - set appversion $version - - set datadir [file join [list xplat::appconfig $appname] "Preferences"] - - - if {[file exists $datadir/.lic]} { - file rename $datadir/.lic $datadir/$appname.lic - set licnum [open $datadir/$appname.lic r] - set serial [read $licnum] - close $licnum - return - } else { - set serial "Unregistered" - regproc::makePitch - } - } - - - #write license to file - proc setLic {} { - variable serial - variable serialbase - variable datadir - variable appname - variable regwindow - variable appstore - - if {$serial == ""} { - destroy .number - return - } - - set count 20000 - - for {set i 1} {$i < $count} {incr i 1} { - - lappend serialbase [string toupper $appname]-[expr $i * 5]-[expr $i/11]-[expr $i - 1]-[string toupper [string trim [string range $appname 0 1]]] - } - - set output [lsearch -inline $serialbase $serial] - puts $serial - puts $output - - if {$output >= 0} { - cd $datadir - set lic [open $datadir/$appname.lic w] - puts $lic "$serial" - close $lic - tk_messageBox -icon info -title "Thank You" -message "Thank You" -detail "Thank you for registering $appname." -parent .number - destroy .number - #display window that was hidden - catch {wm deiconify .} - - } else { - tk_messageBox -icon warning -title "Incorrect Serial Number" -message "Incorrect Serial Number" -detail "Incorrect serial number. Please try again." -parent .number - regproc::getReg - } - } - - - - #generate license numbers - proc genList {application} { - - variable appname - variable regwindow - variable appstore - - set appname $application - - set count 20000 - - for {set i 1} {$i < $count} {incr i 1} { - - lappend serialbase [string toupper $appname]-[expr $i * 5]-[expr $i/11]-[expr $i - 1]-[string toupper [string trim [string range $appname 0 1]]] - } - - - if [file exists $::env(HOME)/[list $appname]-list] { - file delete $::env(HOME)/[list $appname]-list - } - - foreach item $serialbase { - split $item\n - set keylist [open $::env(HOME)/[list $appname]-list a] - puts $keylist $item - close $keylist - } - } - - #dialog to input registration number from demo prompt - proc getReg {} { - - - variable serial - variable regwindow - variable appstore - variable expired - variable appname - - toplevel .number - wm title .number "License" - wm resizable .number 0 0 - - wm withdraw .number - wm transient .number . - - wm protocol .number WM_DELETE_WINDOW {} - - ttk::frame .number.top -padding 10 - pack .number.top -side top -fill both -expand yes - - - ttk::label .number.top.label -text "Please enter your serial number for $appname\nin the field below:" -image toolbarimages::accept_toolbar -compound left -anchor n -padding 10 - pack .number.top.label -side top -fill both -expand yes - - ttk::entry .number.top.entry -textvariable [namespace current]::serial - pack .number.top.entry -side bottom -fill both -expand yes - - ttk::frame .number.bottom -padding 5 - pack .number.bottom -side bottom -fill both -expand yes - - ttk::frame .number.bottom.upper - pack .number.bottom.upper -side top -fill both -expand no - - - ttk::frame .number.bottom.lower -padding 5 - pack .number.bottom.lower -side bottom -fill both -expand no - - bind .number {regproc::setLic; destroy .number; raise .} - ttk::button .number.bottom.lower.install -text "Register" -default active -command {regproc::setLic; destroy .number; raise .} - ttk::button .number.bottom.lower.cancel -text "Cancel" -command "destroy .number; raise ." - pack .number.bottom.lower.install .number.bottom.lower.cancel -side right -fill both -expand no - - ::tk::PlaceWindow .number widget . - - wm deiconify .number - focus .number.bottom.lower.install - raise .number - if {[tk windowingsystem] eq "aqua"} { - after idle [list after 0 wm attributes .number -notify 1] - bind all [list wm attributes . -notify 0] - } - } - - namespace export * -} DELETED softwareupdate/pkgIndex.tcl Index: softwareupdate/pkgIndex.tcl ================================================================== --- softwareupdate/pkgIndex.tcl +++ softwareupdate/pkgIndex.tcl @@ -1,11 +0,0 @@ -# Tcl package index file, version 1.1 -# This file is generated by the "pkg_mkIndex" command -# and sourced either when an application starts up or -# by a "package unknown" script. It invokes the -# "package ifneeded" command to set up package-related -# information so that packages will be loaded automatically -# in response to "package require" commands. When this -# script is sourced, the variable $dir must contain the -# full path name of this file's directory. - -package ifneeded softwareupdate 1.5 [list source [file join $dir softwareupdate.tcl]] DELETED softwareupdate/softwareupdate.tcl Index: softwareupdate/softwareupdate.tcl ================================================================== --- softwareupdate/softwareupdate.tcl +++ softwareupdate/softwareupdate.tcl @@ -1,353 +0,0 @@ -#softwareupdate.tcl routines to manage spoftware updates - -# Copyright (C) 2015 WordTech Communications LLC - -#Proprietary to WordTech Communications LLC. Redistribution prohibited. - -package provide softwareupdate 1.5 -package require http - - -namespace eval softwareupdate { - - if {![info exists library]} { - variable library [file dirname [info script]] - } - - - variable icon - variable appname - variable tmpdir - variable currentinstall - - switch [tk windowingsystem] { - "aqua" { - set tmpdir $::env(TMPDIR) - - } - - "win32" { - set tmpdir $::env(TMP) - } - - "x11" { - set tmpdir $::env(TMP) - } - } - - - - proc setIcon {appicon} { - - variable icon - set icon $appicon - return $icon - } - - proc setAppName {name} { - - variable appname - set appname $name - return $appname - - } - - - #check version of installed software - proc checkVersion {app version} { - variable appversion - variable appname - variable currentversion - variable versionnumber - - set appname $app - - set versionurl http://www.codebykevin.com/version.tcl - http::config -useragent "$appname Update Check" - - if [catch {http::geturl $versionurl} msg] { - puts "error: $msg" - tk_messageBox -icon warning -title "Unable to Connect to Server" -message "Unable to Connect to Server" -detail "Unable to connect to www.codebykevin.com to check for updates. Please make sure you are connected to the Internet." -parent . - return - } - - array set appversion [http::data [http::geturl $versionurl]] - set versionnumber $appversion([string tolower $appname]) - if {$currentversion < $versionnumber} { - softwareupdate::updatePitch - } else { - softwareupdate::upToDate - } - } - - #define the current version of the software - proc setVersion {app number} { - variable currentversion - variable appname - set currentversion $number - set appname $app - - } - - #define the current version of the software - proc setVersion {app number} { - variable currentversion - variable appname - set currentversion $number - set appname $app - - } - - - #get the current installation path - proc findCurrentInstallation {} { - variable currentinstall - variable appname - switch [tk windowingsystem] { - - "aqua" { - set approot [info nameofexecutable] - set apppath [split $approot /] - set currentinstall [join [lrange $apppath 0 [lsearch $apppath "*.app"]] / ] - } - - "win32" { - set currentinstall [file join C {Program Files} $appname] - - } - - "x11" { - return - } - } - - return $currentinstall - - } - - - proc updatePitch {} { - variable appname - - set changeurl http://www.codebykevin.com/$appname-changes.tcl - - if [catch {http::geturl $changeurl} msg] { - puts "error: $msg" - tk_messageBox -icon warning -title "Unable to Connect to Server" -message "Unable to Connect to Server" -detail "Unable to connect to www.codebykevin.com to check for updates. Please make sure you are connected to the Internet." -parent . - return - } - - - set changelist [http::data [http::geturl $changeurl]] - - set updateanswer [tk_messageBox -title "Update" -icon info -message "Update Available" -detail "A new version ($softwareupdate::versionnumber) of $appname is available.\n\nThis new version features the following updates and changes:\n\n$changelist\n\nWould you like to install it? " -type yesno -parent .] - switch -- $updateanswer { - yes { - softwareupdate::installUpdate - } - no { - destroy $updateanswer - return - } - - } - } - - - #"busy" dialog - proc checkingForUpdates {} { - - variable appname - variable icon - - catch {destroy .updateprogress} - - toplevel .updateprogress - wm title .updateprogress "Updating $appname" - - wm withdraw .updateprogress - update idletasks - - ttk::frame .updateprogress.f -padding 5 - pack .updateprogress.f -fill both -expand yes - - ttk::label .updateprogress.f.l -bg gray95 -image $icon - pack .updateprogress.f.l -side left -fill both -expand yes - - ttk::frame .updateprogress.f.r - pack .updateprogress.f.r -side right -fill both -expand yes - - - ttk::label .updateprogress.f.r.t -text "Checking for updates..." -padding 5 - pack .updateprogress.f.r.t -side top -fill both -expand yes - - ttk::frame .updateprogress.f.r.f -padding 5 - pack .updateprogress.f.r.f -side top -fill both -expand yes - - ttk::progressbar .updateprogress.f.r.f.progress -mode indeterminate -orient horizontal - pack .updateprogress.f.r.f.progress -fill both -expand yes -side top - - .updateprogress.f.r.f.progress start - - ttk::button .updateprogress.f.r.f.b -text "Cancel" -command {destroy .updateprogress} - - pack .updateprogress.f.r.f.b -side bottom -fill both -expand no - - wm geometry .updateprogress 400x100 - wm resizable .updateprogress 0 0 - - wm deiconify .updateprogress - raise .updateprogress - - wm transient .updateprogress . - - } - - #dialog if current version is installed - proc upToDate {name number} { - - catch {destroy .updateprogress} - - tk_messageBox -icon info -message "You're up to date!" -detail "$name $number is the currently the newest version available." -parent . -title "Up to Date" - - - } - - #show progress of installation - proc progressDialog {} { - - variable appname - variable status - variable icon - - catch {destroy .downloadprogress} - - toplevel .downloadprogress - wm title .downloadprogress "Updating $appname" - - wm transient .downloadprogress . - - ttk::label .downloadprogress.label -image $icon -anchor w - - pack .downloadprogress.label -side left -fill both -expand yes - - - ttk::frame .downloadprogress.frame -padding 5 - pack .downloadprogress.frame -side right -fill both -expand yes - - ttk::label .downloadprogress.frame.l -textvariable softwareupdate::status -width 40 -text "" - pack .downloadprogress.frame.l -side top -fill both -expand yes - - ttk::progressbar .downloadprogress.frame.bar -mode indeterminate -orient horizontal -maximum 100 - pack .downloadprogress.frame.bar -side top -fill both -expand yes - - .downloadprogress.frame.bar start - update - - ttk::button .downloadprogress.frame.b -text "Cancel" -command {destroy .updateprogress} - pack .downloadprogress.frame.b -side right -fill both -expand no - - wm geometry .downloadprogress 400x100 - wm resizable .downloadprogress 0 0 - - } - - #download and install the update - proc installUpdate {} { - variable currentinstall - variable status - variable appname - variable tmpdir - - catch {destroy .update} - - softwareupdate::findCurrentInstallation - - softwareupdate::progressDialog - set status "Downloading update for $appname" - - switch [tk windowingsystem] { - - "aqua" { - http::geturl http://www.codebykevin.com/updates/[list $appname].tgz -channel [open $tmpdir/[list $appname].tgz w] - update - after 1000 - cd $tmpdir - set status "Unpacking update for $appname" - update - after 1000 - catch {exec tar xvfz [list $appname].tgz} - } - - "win32" { - - http::geturl http://www.codebykevin.com/updates/[list $appname].exe -channel [open $tmpdir/[list $appname].exe w] - - } - - "x11" { - tk_messageBox -icon info -parent . -message "Please ask the maintainer of $appname on your platform to prepare a release of the latest version." - return - } - } - - - set status "Ready to install" - .downloadprogress.frame.bar configure -mode determinate - .downloadprogress.frame.bar configure -value 100 - .downloadprogress.frame.bar stop - destroy .downloadprogress.frame.b - pack [ttk::button .downloadprogress.frame.b -text "Install and Relaunch" -command softwareupdate::launchUpdate] -side right -fill both -expand no - return - } - - - #launch the update - proc launchUpdate {} { - - variable currentinstall - variable appname - variable tmpdir - - switch [tk windowingsystem] { - - "aqua" { - if {[catch {exec codesign -v $tmpdir/$appname.app} msg]} { - bgerror $msg - tk_messageBox -icon warning -message "Error!" -detail "An error occurred in the installation of $appname. Please try again later." - return - } else { - - file rename -force $currentinstall [file join /Users [exec whoami] .Trash [file tail $currentinstall]] - - file rename -force /tmp/$appname.app $currentinstall - - exec $currentinstall/Contents/MacOS/$appname & - - exit - } - } - - "win32" { - - file rename -force $currentinstall/[list $appname].exe $currentinstall/[list $appname].exe~ - file copy $tmpdir/[list $appname].exe $currentinstall/[list $appname.exe] - exec $currentinstall/[list $appname].exe & - } - - "x11" { - tk_messageBox -icon info -parent . -message "Please ask the maintainer of $appname on your platform to prepare a release of the latest version." - return - } - } - - catch {destroy .downloadprogress} - - - - } - - namespace export * - -} - DELETED tablelist5.13/CHANGES.txt Index: tablelist5.13/CHANGES.txt ================================================================== --- tablelist5.13/CHANGES.txt +++ tablelist5.13/CHANGES.txt @@ -1,1988 +0,0 @@ -What is new in Tablelist 5.13? ------------------------------- - -1. Added support for Mac OS X 10.10 (Yosemite) (thanks to Kevin Walzer - for his proposal). - -2. Renamed the four arrow styles having the shape of an angle from - "flat7x5", ..., "flat10x6" to "flatAngle7x5", ..., "flatAngle10x6" - (POTENTIAL INCOMPATIBILITY!); added the arrow styles "flat7x5", - "flat9x6", "flatAngle7x4" (which is now the default on Yosemite), - "flatAngle9x5", and "flatAngle10x7". - -3. Added the tree style "mate", inspired by a few GTK+ themes of the - MATE desktop. - -4. Added the "-showeditcursor" configuration option, used to let the - cursor take on the shape of a pencil whenever a mouse klick would - start an editing session (thanks to Rene Zaumseil and Cesare - Bavazzano for their proposals). - -5. New column configuration option "-changetitlesnipside", which allows - you to override the alignment-specific default snip side for the - column's title (thanks to John Vella for his proposal). - -6. Support for the word "last" as row, column, cell, or child index, - indicating the last row/column/cell of the tablelist or the last - child of a given parent node (remember that the meaning of "end" as a - row, column, or child index is subcommand-specific). - -7. The description of the "imagelabelpath" subcommand in the reference - manual now contains an example showing how to define bindings for the - embedded images. - -8. Eliminated the endless loop generated by the "yview" subcommand when - synchronizing two or more tablelist widgets (thanks to Paul Obermeier - for his bug report). - -What was new in Tablelist 5.12.1? ---------------------------------- - -This is a bugfix-only release. The corrected files in the "scripts" -directory are "tablelistEdit.tcl" and "tablelistUtil.tcl". - -1. Appended the missing 4th argument to the two invocations of the - procedure "tablelist::moveOrActivate" in the file - "tablelistEdit.tcl" (thanks to Patrick Fradin and Ralf Fassel for - their bug reports). - -2. Fixed a typo in the file "tablelistUtil.tcl" (Thanks to Patrick - Fradin for reporting this bug). - -What was new in Tablelist 5.12? -------------------------------- - -1. Added the "-customdragsource" configuration option, used to indicate - whether the tablelist widget is a drag source for some drag & drop - implementation other than TkDND and the drag & drop framework - included in BWidget. - -2. Improvements and extensions in the default binding scripts. Besides - providing full compatibility with the Tk listbox, they now perform an - automatic drag-friendly handling of the selection and of pointer - movements with mouse button 1 down if the "-customdragsource" option - was set to true or the tablelist's body was registered as a TkDND or - BWidget drag source (thanks to Will Duquette for his proposal). The - same holds true for the local drag & drop via the "move" subcommand. - -3. Added the "hidetargetmark", "showtargetmark", "targetmarkpath", and - "targetmarkpos" subcommands, for enhanced drop target support (thanks - to Trevor Williams for his proposal). - -4. Added a "Drag & Drop Support" section to the reference manual, with - examples demonstrating the use of the new subcommands mentioned - above in a tablelist widget registered as a TkDND or BWidget drop - target. - -5. The visibility of the horizontal separator placed just below the last - tablelist row if the value of the "-showseparators" option is true - and that of the "-fullseparators" option is false, can now be - controlled with the aid of the new "-showhorizseparator" - configuration option (thanks to Martyn Smith for his proposal). - -6. New values "flat5x3" and "flat5x4" for the "-arrowstyle" - configuration option, suiting current versions of the Ubuntu Linux - distribution. - -7. Adapted the look & feel of the tree styles "adwaita", "ubuntu", and - "mint" to current versions of the GTK+ 3 theme Adwaita and of the - Linux distributions Ubuntu Linux and Linux Mint, respectively. - -8. Fixed a long-standing bug related to horizontal scrolling in an empty - tablelist widget with positve "-titlecolumns" value (thanks to Ulrich - Seidl for his bug report). - -What was new in Tablelist 5.11? -------------------------------- - -1. Added the "findrowname" and "findcolumnname" subcommands (thanks to - Adrian Medrano Calvo for his proposal and discussions on this - subject). - -2. Collapsing a row no longer leads to renumbering the lines for the - purpose of updating a column configured to display the line numbers - (thanks to Will Duquette for his proposal). - -3. For improved appearance, if the value of the "-showseparators" option - is true and that of the "-fullseparators" option is false, then a - horizontal separator is now placed just below the last tablelist row - (thanks to Allan Silverstein for his proposal). - -4. Worked around a peculiarity of Tk on Windows, which caused problems - when resizing the tablelist window in the presence of embedded images - or multi-line elements (thanks to Will Duquette for his bug report). - -5. Added the missing actualization of the active and anchor row indices - after moving an item to a different position (thanks to Will Duquette - for his bug report). - -6. Fixed two bugs in Tablelist_tile, related to header labels with - embedded images (thanks to Ulrich Seidl for his bug reports). - -7. Numerous further improvements in the code and documentation. - -What was new in Tablelist 5.10? -------------------------------- - -1. Added the "-acceptdropcommand" configuration option, used to control - whether the local drag & drop may move a specified item just before - a given row (thanks to Nagu and Georgios Petasis for discussions on - this subject). - -2. Added the "-instanttoggle" configuration option, related to the cell - editing with the aid of a Tk or tile checkbutton (thanks to Rich - Wellner for his proposal and discussions on this topic). - -3. Added the "-tight" configuration option, used to eliminate the - one-pixel additional space left below each tablelist row for Tk - listbox compatibility (thanks to Koen Breugelmans for his proposal - and discussions on this subject). - -4. Added the "isviewable" and "viewablerowcount" subcommands (thanks to - Nagu for proposing the latter). - -5. Improvements related to the value of the "-data" option for the - virtual events <> and <> - (thanks to Georgios Petasis for discussions on this topic). - -6. The item deletion has become significantly faster, especially in - tablelists used as tree widgets and in the presence of embedded - images and/or multi-line elements (thanks to Rob Ratcliff and Rene - Zaumseil for requesting this performance improvement). - -7. Guarded against column deletions from within non-default binding - scripts for the header labels (thanks to Ulrich Seidl for his - input). - -8. Restored the support for Tcl/Tk versions earlier than 8.3, by - cleaning up the use of elided text in the underlying text widget. - Similarly, restored the support for Tcl/Tk 8.0, by cleaning up the - use of "regsub" and that of the event (thanks to Joerg - Mueck for reporting the first two issues). - -9. Improved the package loading mechanism (thanks to Paul Obermeier for - his bug report). - -10. Guarded against potential item insertions or deletions from within - the command specified as the value of the "-editendcommand" option - (thanks to Julian H J Loaring for his bug report). - -11. Guarded against deletion of embedded images or windows from within - the command specified as the value of the "-tooltipaddcommand" - option (thanks to Jan Kandziora for his bug report). - -12. Fixed a bug related to column deletion if the "-selecttype" option - has the value "cell" (thanks to Ulrich Seidl for his bug report). - -13. Several further code improvements and minor bug fixes. - -What was new in Tablelist 5.9? ------------------------------- - -1. Added the "-valign" column and cell configuration option, for - controlling the vertical alignment of embedded images and windows - (thanks to Trevor Williams for his proposal). - -2. The "-stripebackground" and "-stripeforeground" options can now be - specified at column level, too (thanks to Christian Gollwitzer for - his proposal). - -3. Improvements related to the Windows 7 platform. - -4. Worked around a text widget bug in Tk versions 8.5 and later, related - to getting the index of the last line in the window if some of the - lines are elided (thanks to Bernhard Wallner for his bug report). - -5. Corrected a typo in the implementation of the "rowconfigure" - subcommand, introduced in the last Tablelist version (thanks to Jerzy - Witkowski for reporting this bug). - -6. Fixed a bug related to resetting the "-(select)background" and - "-(select)foreground options at column, row, and cell levels, - introduced in the previous Tablelist version (thanks to Christian - Gollwitzer for his bug report). - -7. Several further improvements in the code, demo scripts, and - documentation. - -What was new in Tablelist 5.8? ------------------------------- - -1. Support for interactive cell editing with the aid of the ctext - widget (thanks to Sait Dogru for his proposal). - -2. Added the "canceledediting" subcommand (thanks to Martyn Smith for - his proposal). - -3. The "selection" and "cellselection" subcommands have become by - orders of magnitude faster (thanks to Jean-Francois Beaud for his - input that motivated me to speed up these subcommands). - -4. The "-(select)background" and "-(select)foreground options at - column, row, and cell levels now impose by far less performance - penalty than in earlier Tablelist versions. - -5. The keyboard traversal during interactive cell editing is now aware - of changes like appending a new row, performed by the procedure - specified as the value of the "-editendcommand" configuration option - (thanks to Andreas Leitgeb for his proposal). - -6. For Tk versions 8.5 or later, most virtual events are now generated - with the "-data" option set to a suitable event-specific value - (thanks to Christian Gollwitzer, Andreas Leitgeb, and Nagu for their - proposals). - -7. Improvements related to the selection mode "extended". - -8. Worked around a peculiarity of Tk on Windows, related to deleting an - embedded window while resizing a text widget interactively (thanks - to Harald Oehlmann for his bug report and discussions on this - topic). - -9. Eliminated a regression introduced in Tablelist version 5.6, related - to vertical scrolling under Tk 8.5 or later in the presence of - embedded images or windows (thanks to Patrick Fradin for reporting - this bug). - -10. Fixed a screen refresh problem introduced in Tablelist version 5.6, - related to wrapped multiline elements (thanks to Rob for his bug - report). - -11. Further code improvements (thanks to Harald Oehlmann for his - valuable contribution). - -12. Added a "Virtual Events" section to the reference manual (thanks to - Andreas Leitgeb for his proposal). - -What was new in Tablelist 5.7? ------------------------------- - -1. Added the "cellbbox" subcommand. - -2. Added the "editinfo" subcommand (thanks to Trevor Williams for his - proposal). - -3. Adapted the tree styles "ubuntu" and "mint" to the latest Ubuntu - Linux and Linux Mint releases. - -4. Minor change related to the ttk::combobox widget used as edit window - (thanks to Julian H J Loaring for his input). - -5. Improved the multi-platform support by increased use of virtual - events. - -6. Worked around a bug in some earlier Tk versions, related to - checkbuttons without indicator (thanks to Allan Silverstein for his - input). - -7. Restored the support for Tcl/Tk versions earlier than 8.4, which has - been broken since the previous Tablelist release, due to the use of - the "namespace exists" command, introduced in Tcl 8.4 (thanks to - Ralf Fassel for drawing my attention to this issue). - -8. Fixed a copy & paste bug related to embedded windows, introduced in - the previous Tablelist version (thanks to Heng Li and David Hanks - for their bug reports). - -9. Fixed a long-standing bug related to the "cancelediting" subcommand - and the "-forceeditendcommand" option (thanks to Julian H J Loaring - for his bug report). - -10. Fixed a long-standing minor bug that caused the "-labelbg" column - configuration option to be accepted by Tablelist_tile, contrary to - the option of the same name at widget level (thanks to Bernhard - Wallner for his bug report). - -11. Several further improvements in the code and demo scripts (thanks to - Patrick Fradin for his valuable contribution and to Marianne Baumann - for her input related to the "-showlabels" option). - -What was new in Tablelist 5.6? ------------------------------- - -1. Added the tree styles "adwaita", "mint", and "ubuntu", inspired by a - few GTK+ 3 themes on popular Linux distributions. - -2. Added the "-windowupdate" cell configuration option (thanks to - Trevor Williams for his valuable contribution). - -3. The item insertion and sorting have become significantly faster, - especially when using static-width columns. - -4. Embedded windows are now hidden during interactive cell editing - (thanks to Trevor Williams for discussions on this subject). - -5. Extended the support for the "tileqt" theme to work on KDE 4, too. - -6. Improvements in the documentation (thanks to Glenn Herteg for his - proposal). - -7. Guarded against the case that a tablelist widget is deleted and its - name is reused for a widget of a different class (thanks to Roger - Niva for his valuable input). - -8. Guarded against scripts that start by destroying all children of the - root window (thanks to Helmut Giese and Gerhard Kraus for drawing my - attention to this case). - -9. Fixed two bugs related to the "move" subcommand, introduced in - Tablelist version 5.2 (thanks to "DrS" and Trevor Williams for their - bug reports). - -10. Several further improvements and minor bug fixes. - -What was new in Tablelist 5.5? ------------------------------- - -1. Hidden tablelist elements are no longer excluded from the selection - (thanks to Martyn Smith for his proposal). (They are, however, - ignored when exporting the selection.) - -2. Added the "cornerpath" and "cornerlabelpath" subcommands. The first - one makes it quite easy to respect the native Mac OS X look & feel, - where the vertical scrollbar appears placed under the header (thanks - to Torsten Berg for a related page on the Wiki, which provided me the - idea for these subcommands). The "cornerpath" subcommand is now used - in all demo scrips that contain vertical scrollbars. - -3. Added support for the appearance-related changes introduced in Mac - OS X 10.7 (Lion). - -4. On Mac OS X Aqua, the default values of the "-move(column)cursor" - and "-resizecursor" options are now native cursors. Besides - improving the look & feel of tablelist widgets on the Mac, this - change also works around the problem that on Mac OS X 10.7, Tk - versions 8.5 and 8.6 can only use native and native-mapped cursors. - -5. Removed the "-labelbackground" option from Tablelist_tile, because - current versions of the tile engine no longer support setting the - background color for the header labels (and even with earlier tile - versions, some themes ignored any attempt to change the background - color of the header labels). - -6. Adapted the code to some changes in current tile versions, to make - sure that in disabled state the tile-based column labels will appear - in the theme-specific disabled foreground color, as it was the case - with earlier tile versions (thanks to "tombert" for his related - posting on comp.lang.tcl). - -7. Improved a few binding scripts (thanks to Ulrich Seidl for his bug - report and testing). - -8. Fixed a bug related to embedded windows in a tablelist used as a - tree widget (again, thanks to Ulrich Seidl for his bug report and - testing). - -9. Several further improvements in the code, demo scripts, and - documentation. - -What was new in Tablelist 5.4? ------------------------------- - -1. Added the "-populatecommand" configuration option, used by the - "searchcolumn" subcommand to insert child items on demand before - checking whether they contain the specified pattern. - -2. Added the "-autoscan" configuration option, which can be used to - deactivate the automatic scrolling triggered by leaving the - tablelist window with mouse button 1 down, in order to avoid any - conflicts with drag & drop via tkdnd (thanks to Patrick Fradin for - his valuable contribution). - -3. New "isexpanded" subcommand. - -4. New value "flat9x6" for the "-arrowstyle" configuration option. - -5. Adapted the tree style "oxygen2" to the look of current KDE 4 - versions. - -6. Worked around some peculiarities of Tk on Mac OS X Aqua (thanks to - Torsten Berg for her problem report and discussions on this topic). - -7. Improved the check for PNG support in Tk (thanks to Ian Gay for his - posting on the Wiki related to this subject). - -8. Fixed a bug related to the tree style "aqua", introduced in - Tablelist version 5.3 (thanks to Julian H J Loaring for his bug - report). - -9. Numerous further improvements in the code and documentation. - -What was new in Tablelist 5.3.1? --------------------------------- - -This release contains just one bug-fix and an enhancement: - -1. Fixed a bug related to the "-hide" row configuration option, - introduced in the previous Tablelist version (thanks to Ralf Fassel - and Michal Sosnowski for their bug reports). - -2. Extended the support for the native "Aqua-blue" background for the - header label of the sort column (which in the previous Tablelist - release was restricted to Tk versions 8.6 and above) to the Cocoa- - based Tk patch levels 8.5.9 and above (thanks to Kevin Walzer for - discussions on this topic and to Paul Obermeier for enabling me to - access the ActiveTcl 8.5.8 distribution for the Mac). - -What was new in Tablelist 5.3? ------------------------------- - -1. The interactive row move operation (i.e., local drag & drop) now - supports moving an item outside its parent and dropping it under - another item as a child (thanks to Dr. Detlef Groth for his - proposal, thorough testing, and discussions on this topic). - -2. Added the "-acceptchildcommand" configuration option, related to the - local drag & drop. - -3. New "searchcolumn" subcommand, supporting a rich set of options - (thanks to Matthew Callaghan, Adrian Davis, and Jeff Godfrey for - their proposals). - -4. New "getformatted", "getformattedcolumns", and "getformattedcells" - subcommands. - -5. Support for interactive cell editing with the aid of the Tk core and - tile menubutton widgets (thanks to Georgios Petasis for his - proposal). - -6. Support for the row indices "top" and "bottom" (thanks to Julian H J - Loaring and Paul Obermeier for their proposals). Likewise, support - for the column indices "left" and "right". - -7. New value "photo7x7" for the "-arrowstyle" configuration option, - needed for the "aqua" theme. - -8. Adapted the appearance of tablelist widgets on the Macintosh to - current versions of OS X Aqua. - -9. Numerous further improvements and minor bug fixes. - -What was new in Tablelist 5.2? ------------------------------- - -1. Added the "-fullseparators" configuration option (thanks to Kevin - Partin, Martyn Smith, and Harald Oehlmann for their proposals). - -2. Added the tree styles "ambiance", "dust", "dustSand", "newWave", - "plastik", and "radiance". - -3. The implementation of the "collapse(all)" and "expand(all)" - subcommands no longer makes use of the "-hide" row configuration - option, hence you are now free to set the latter (via - "rowconfigure", "configrowlist", "configrows", or "togglerowhide"), - regardless of whether the tablelist widget displays a tree - hierarchy or just a plain list. - -4. The "move" subcommand now supports moving an item outside its - parent. - -5. Deleting the whole content of a tablelist widget has become - significantly faster (thanks to Harold Campbell for his input). - -6. Worked around a peculiarity of the text widget related to tag - handling when deleting a range of lines from its end (thanks to - Batox for his bug report). - -7. Minor improvements and bug-fixes in the binding scripts (thanks to - Bernhard Wallner, Batox, and Roger Niva for their bug reports). - -8. Fixed a bug related to the "-selecttype cell" configuration option, - (re)introduced in Tablelist version 5.0 (thanks to Harold Campbell - and Dietmar Mueller for their bug reports). - -9. Fixed a bug related to row hiding via "configrowlist" or - "configrows", introduced in Tablelist version 5.0 (thanks to Michal - Sosnowski for his bug report). - -10. Fixed a long-standing bug related to tooltip support (thanks to - Trevor Williams for his bug report). - -11. Several further improvements and minor bug fixes. - -What was new in Tablelist 5.1? ------------------------------- - -This is a bugfix-only release. The corrected files in the "scripts" -directory are "tablelistBind.tcl", "tablelistSort.tcl", -"tablelistUtil.tcl", and "tablelistWidget.tcl". - -1. Fixed a bug related to item deletion, introduced in the previous - Tablelist version (thanks to Aric Bills and Roger Niva for their bug - reports). - -2. Fixed a bug related to multi-column sorting, introduced in the - previous Tablelist version (thanks to Albrecht Mucha for his bug - report). - -3. Fixed a long-standing bug related to column deletion (thanks to - Liang Sian Yin for his bug report). - -4. Fixed a few further minor bugs and typos, introduced in the previous - Tablelist version (thanks to Patrick Fradin, Roger Niva, Harald - Oehlmann, and Peter Spjuth for their bug reports). - -What was new in Tablelist 5.0? ------------------------------- - -1. A tablelist widget is now not only a multi-column listbox, but also - a multi-column tree widget (thanks to Sebastien Barre, Tillmann - Basien, Jos Decoster, Dr. Detlef Groth, Kai Morich, Georgios - Petasis, and Kevin Walzer for their proposals, as well as to Paul - Obermeier for testing the preliminary version). This is achieved - with the aid of the new configuration options "-collapsecommand", - "-expandcommand", "-treecolumn", and "-treestyle", along with the - new subcommands "childcount", "childindex", "childkeys", "collapse", - "collapseall", "depth", "descendantcount", "expand", "expandall", - "expandedkeys", "insertchild(ren)", "insertchildlist", "noderow", - "parentkey", and "toplevelkey". - -2. Added the "-editselectedonly" configuration option, related to - starting the interactive cell editing with mouse button 1 (thanks to - Julian H J Loaring for discussions on this topic). - -3. New values "flat6x4", "flat9x7", and "flat10x6" for the - "-arrowstyle" configuration option. - -4. New value "asciinocase" for the "-sortmode" column configuration - option. - -5. New subcommands "applysorting", "getfullkeys", and "refreshsorting". - -6. Two new demo scripts (and their tile-based counterparts) - illustrating the use of a tablelist as multi-column tree widget. - -7. The subcommands "insert", "insertlist", "insertchild(ren)", and - "insertchildlist" now return the list of full keys corresponding to - the items just inserted. - -8. Fixed a long-standing bug related to the "-labelfont" option (thanks - to Jacek Jendrysik for his bug report). - -9. Fixed a bug related to the "-text" column configuration option - (thanks to Paul Obermeier for his bug report). - -10. Fixed a long-standing bug related to embedded windows in right- - aligned columns (thanks to Jerzy Witkowski for his bug report). - -11. Numerous further improvements in the code and documentation. - -What was new in Tablelist 4.12? -------------------------------- - -1. Added the "labeltag" subcommand and the helper command "tablelist:: - getTablelistColumn", designed to be used in non-default binding - scripts for the header labels. - -2. Support for interactive cell editing with the aid of the tile - spinbox widget. The demo script "tileWidgets.tcl" now uses this - widget when available. - -3. Support for interactive cell editing with the aid of the new mentry - widget for IPv6 addresses. - -4. Improved the support for Windows Vista and added explicit support - for the "vista" theme. - -5. Updated the support for the themes "plastik" and "keramik"; added - support for the "keramik_alt" theme. - -6. Support for the native "Aqua-blue" background, set for the header - label of the sort column (thanks to Kevin Walzer for his proposal - and valuable contribution). For technical reasons, this feature is - only supported for Mac-Tk versions using Cocoa. - -7. Further improvements in the support for Mac OS X Aqua (thanks to - Daniel Steffen and Kevin Walzer for their valuable feedback). - -8. Improvements in the binding scripts related to interactive cell - editing (thanks to Hadas Porat for discussions on this subject). - -9. The binding for the event in the resize area of a - column header now works as expected for large lists, too. - -10. Eliminated a minor regression related to interactive cell editing, - introduced in the previous Tablelist version (thanks to Kai Morich - for his valuable input). - -11. Fixed a small bug related to interactive cell editing with the aid - of a text widget (thanks to Bryan Oakley for his bug report and - valuable suggestion). - -12. Fixed a long-standing bug related to the "-listvariable" option in - disabled state (thanks to Ralf Fassel for his bug report). - -13. Added a version-related hint to the "How to use it?" section of the - Tablelist Programmer's Guide. - -What was new in Tablelist 4.11? -------------------------------- - -1. Added the "-columntitles" configuration option, which is mainly a - simplified form of the "-columns" option (thanks to Roy Terry for - his proposal). - -2. Added the virtual events <> and - <>, generated after toggling the - hidden state of a column or row, respectively (thanks to Jeff - Godfrey for his proposal). - -3. Besides with , the optimal column width can now be set - with in the resize area of the column's header. - Similarly, the effect of can also be achieved with - in the column label's resize area. - -4. Support for Windows Vista (thanks to Jeremy Cowgar for his input). - -5. The recommended package name is now "tablelist" rather than - "Tablelist", for compatibility with the ActiveTcl distribution; the - demo scripts have been changed accordingly. - -6. Made sure that the "-tooltipdelcommand" configuration option won't - affect other widgets (thanks to Jeff Godfrey for drawing my - attention to this issue). - -7. Fixed a long-standing nasty bug related to the "yview" subcommand - (thanks to Nestor Patino for his bug report and very helpful example - script). - -8. Fixed two bugs related to the "-listvariable" configuration option - (again, thanks to Nestor Patino for his valuable input). - -9. Fixed a bug related to the item deletion when using Tcl/Tk 8.5 - (thanks to Jos Decoster and Sven Wuytack for their valuable - contribution to finding and fixing this bug). - -10. Fixed a bug related to the "-windowdestroy" cell configuration - option, introduced in Tablelist 4.9 (thanks to Sebastien Barre for - his bug report). - -What was new in Tablelist 4.10? -------------------------------- - -1. Support for individual binding scripts controlling the interactive - cell editing, with the aid of the new "editwintag" subcommand - (thanks to Oscar Fuentes for his valuable input). - -2. Complemented the "attrib" subcommand with the new subcommands - "hasattrib" and "unsetattrib". - -3. Support for column-, row-, and cell-specific attributes, with the - aid of the new subcommands "columnattrib", "hascolumnattrib", - "unsetcolumnattrib", "rowattrib", "hasrowattrib", "unsetrowattrib", - "cellattrib", "hascellattrib", and "unsetcellattrib". - -4. Support for interactive cell editing with the aid of the new mentry - widget of type "DateTime", introduced in version 3.2 of the Mentry - package (thanks to Florian Murr for his proposal). - -5. Made sure that the default bindings are set up immediately when - loading the package, prior to creating any tablelist widget (thanks - to Schelte Bron for his proposal and discussions on this topic). - -6. Re-established the support for tile widgets as edit windows in non- - tile-based tablelist widgets (again, thanks to Schelte Bron for - reporting that this was broken in the last few Tablelist versions). - -7. Adapted the handling of the tile checkbutton as edit window in the - "xpnative" theme to some changes made in tile 0.8 (thanks to Jeff - Godfrey for his bug report). - -8. Guarded against potential widget deletion from within user-defined - binding scripts or "update (idletasks)" (thanks to Schelte Bron and - Jan Kandziora for their bug reports). - -9. Updated the (very rarely needed) distribution file "repair.tcl" to - work with current Tablelist versions (thanks to Robert Stollf for - his bug report). - -10. Corrected the description of the "-height" option in the reference - manual (thanks to Glenn Herteg for his bug report concerning the - case "-height 0"). - -11. Improved the color handling in the "disabled" state (thanks to Rolf - Ade for his bug report and discussions on this topic). - -12. Made the handling of elided text more robust (thanks to Jos Decoster - for his bug report and valuable contribution). - -13. Several further improvements and minor bug fixes (thanks to Albrecht - Mucha for his valuable input). - -What was new in Tablelist 4.9? ------------------------------- - -1. Added the "-wrap" column configuration option, which makes it - possible to display long texts in word-wrapped multi-line rather - than snipped form (thanks to Alexander Schoepe and Anant Adke for - their proposals). Also, added support for interactive cell editing - with a word- or char-wrapped text widget when using Tk 8.5 (thanks - to Juberi Rajib for discussions on this topic). - -2. Support for dynamic-width embedded windows, with the aid of the new - "-stretchwindow" cell configuration option (thanks to Kurt Kurczyk, - Bryan Oakley, and Rasmus Debitsch for their proposals). The demo - script "embeddedWindows.tcl" and its tile-based counterpart now make - use of this option. - -3. New "formatinfo" subcommand, returning information about the cell - whose content is being formatted by a command specified as the value - of the "-formatcommand" column configuration option (thanks to Goran - Ivankovic and Sebastien Barre for their proposals). - -4. Changed the default value of the "-activestyle" configuration option - from "underline" to "frame" and that of the "-setfocus" option from - 0 to 1, making them conform to similar changes in Tk 8.5 related to - the listbox widget. - -5. Improved the appearance of the header labels for the "aqua" theme - (thanks to Torsten Berg for discussing this topic on the Wiki). - -6. Eliminated the potential invocation of the "unknown" command from - within the Tablelist code (thanks to Roger Niva for discussions on - this topic). - -7. When starting the interactive cell editing with the aid of a - combobox widget, the list associated with the latter is only dropped - down if the combobox is read-only (thanks to Bryan Oakley for his - proposal). - -8. The "setThemeDefaults" command no longer throws an error if the - current theme is not explicitly supported by Tablelist. Instead, it - uses the options set by the current theme and falls back to the - "default" one for the rest (thanks to Schelte Bron for his valuable - contribution). - -9. Improved the tablelist widget's appearance when the header labels - are not shown (thanks to Mark Garvey for his input). - -10. Fixed two bugs related to the optimized item insertion (thanks to - Harold Campbell and Bryan Oakley for their bug reports). - -11. Fixed a bug related to the "-showlinenumbers" column configuration - option (thanks to Martin Lemburg for his bug report). - -12. Several further improvements and minor bug fixes. - -What was new in Tablelist 4.8? ------------------------------- - -This release fixes a few nasty bugs related to the optimized item -insertion, introduced in the previous Tablelist version (thanks to -Harold Campbell, Roger Niva, and Joerg Klingseisen for their bug -reports). - -What was new in Tablelist 4.7? ------------------------------- - -1. Significant performance improvements related to the "insert", - "rowconfigure", "sort", "sortbycolumn", and "sortbycolumnlist" - subcommands (thanks to Harold Campbell for his valuable - contribution to speeding up the item insertion). The extent of the - speed-up depends on the configuration options present at column, - row, and cell levels. - -2. Support for cell- and column label-specific balloon help, with the - aid of the new configuration options "-tooltipaddcommand" and - "-tooltipdelcommand". - -3. New subcommands "iselemsnipped" and "istitlesnipped", which make it - very easy to display the full cell texts and column titles as - tooltips for cells and header labels with snipped contents. - -4. New subcommands "configcolumnlist", "configcolumns", - "configrowlist", "configrows", "configcelllist", and "configcells", - which allow you to configure several columns/rows/cells with a - single command invocation (thanks to Harold Campbell, Jeff Godfrey, - and Paul Obermeier for their proposals). - -5. Worked around some performance problems regarding the "switch" - command in Tcl 8.5a6/8.5b1 and ActiveTcl 8.4.14. - -6. Made sure that ActiveState's "style::as" package won't break the - mousewheel bindings (thanks to Michael Schlenker for drawing my - attention to this problem). - -7. Improved the focus handling when resizing a column interactively - (thanks to Jorge Enderr for his bug report). - -8. Corrected a typo in the adaptation of vertical scrolling to the - text widget changes made in Tk 8.5 (thanks to Julian M Noble for - his posting on the Wiki related to this subject). - -9. Fixed a bug related to hidden rows when having "-selecttype cell", - introduced in Tablelist version 4.3 (thanks to Harold Campbell for - his bug report and discussions on this subject). - -10. Fixed a bug in the "cellconfigure" subcommand, introduced in the - previous Tablelist release (thanks to Roy Terry for reporting this - problem on the Wiki). - -11. Fixed a bug in the "-changesnipside" option (thanks to Kai Morich - for his bug report). - -12. Numerous further improvements in the code and documentation. - -What was new in Tablelist 4.6? ------------------------------- - -1. Tablelist_tile now supports tile 0.8 and Tk 8.5a6/8.5b1 (where tile - is integrated in the core). The new commands "tablelist::setTheme", - "tablelist::getCurrentTheme", and "tablelist::getThemes" enable you - to set and get the current theme and to query the available ones, - without having to worry about the incompatibilities between the - various tile versions. - -2. New column configuration option "-changesnipside", which allows you - to override the alignment-specific default snip side (thanks to - Georgios Petasis for his proposal). - -3. New "columnwidth" subcommand, with the options "-requested", - "-stretched", and "-total" (thanks to Matthew Callaghan, Richard - Finstad, Lieven Forrez, and Tom Roeder for their proposals). - -4. Support for the new virtual event <>, - generated after resizing a column interactively (thanks to Kurt - Kurczyk for his proposal). - -5. Visual improvement: Within an active row, the gap to the left or - right of an embedded image or window no longer appears underlined - (when the "-activestyle" option has its default value "underline"). - -6. Embedded images and windows are no longer hidden during interactive - cell editing (except the editing with the aid of a Tk or tile - checkbutton widget). - -7. Significantly improved the redraw and stretching behavior when - resizing a column interactively. - -8. Eliminated some annoying visual effects caused by hidden columns - when displaying the items of an already visible tablelist widget - (thanks to Rolf Ade for discussions on this topic). - -9. Adapted the implementation of vertical scrolling to the text widget - changes made in Tk 8.5 (thanks to Julian M Noble for his posting on - the Wiki related to this subject). - -10. Fixed a bug related to hidden rows, introduced in Tablelist version - 4.3 (thanks to Matthew Callaghan for his bug report). - -11. Eliminated the possible endless loop caused by some option database - settings in the "seecell" subcommand (thanks to Erik Allaert and - Mauro Comin for reporting this bug). - -12. Added a detailed performance-related hint to the description of the - "-listvariable" configuration option. - -13. Numerous further improvements and minor bug fixes. - -What was new in Tablelist 4.5? ------------------------------- - -1. Static-width columns are now displayed much faster than in earlier - Tablelist releases. - -2. Quite significantly reduced the performance penalty imposed by - various column, row, and cell configuration options when sorting, - redisplaying, moving, or deleting tablelist items. - -3. Embedded images are now handled much more efficiently and are - displayed much faster than in earlier Tablelist versions. - -4. New column configuration option "-showlinenumbers" (thanks to Rolf - Schroedter and Sean Xu for their proposals and to Kathrin Klaes for - testing the implementation). - -5. Support for tile-based multi-entry widgets (introduced in Mentry - 3.0) used as edit windows. - -6. Significantly improved the handling of the <> virtual - event. - -7. Defined more reasonable windowing system- and theme-specific default - values for the "-arrowdisabledcolor" option. - -8. Improved and simplified the package loading mechanism (thanks to - Andreas Kupries for his valuable contribution). - -9. Eliminated the "togglevisibility" subcommand, which was deprecated - in the previous Tablelist version in favor of "togglecolumnhide". - -10. Fixed a bug in the implementation of the "deletecolumns" subcommand, - introduced in the previous Tablelist release (thanks to Kai Morich, - Kurt Kurczyk, and Dave Leslie for their bug reports). - -11. Fixed two binding-related bugs (thanks to Mark Garvey and Kurt - Kurczyk for their bug reports). - -12. Fixed a bug related to the handling of the "tileqt" theme (thanks to - Andres Garcia for his bug report). - -13. Fixed a small but annoying bug related to the "-maxwidth" column - configuration option, introduced in the previous Tablelist version. - -14. Numerous further improvements and minor bug fixes (thanks to - Patrick Fradin and Georgios Petasis for their valuable feedback). - -What was new in Tablelist 4.4? ------------------------------- - -1. New row configuration option "-hide" (thanks to Jeff Godfrey, - Patrick Fradin. Hemang Lavana, and Martyn Smith for their - proposals, and especially to Harold Campbell for providing the - initial implementation and testing the final one.) For performance - reasons this option is implemented by using elided text in the - underlying text widget, and therefore it is not supported for Tk - versions earlier than 8.3. - -2. New subcommand "togglerowhide" for hiding/unhiding several rows at - a time (not supported for Tk versions earlier than 8.3). - -3. Renamed the "togglevisibility" subcommand to "togglecolumnhide". - The old name is still supported, but will be eliminated in the next - Tablelist release. - -4. New command "tablelist::setThemeDefaults", which can be used to - make sure that classical Tk widgets, e.g., text, will have a theme- - specific appearance, just like the tile widgets. The tile-based - demo scripts now make use of this command. - -5. When using the "tileqt" theme, the version number of TileQt must be - 0.3 or higher (thanks to Georgios Petasis for providing the new - "tileqt" features used in this Tablelist release). - -6. For Tk 8.3 or later, hidden columns are now handled by using elided - text, which results in very significant performance improvements - (thanks to Harold Campbell for his valuable contribution). - -7. Improved the handling of the "-listvariable" option in connection - with snit widgetadaptors (thanks to Rolf Ade for his bug-fix). - -8. Corrected a typo in the implementation of the "move" subcommand, - introduced in the previous release (thanks to Jerome Siot for his - bug report). - -9. Improved the handling of the virtual event <> (thanks - to Wofgang Grosser for his bug report). - -10. Fixed a long-standing bug related to hidden columns (thanks to Dave - Leslie for his bug report). - -11. Worked around a peculiarity of the "place" command on Windows, - which caused refresh problems in column labels with images (thanks - to Sebastien Barre for his bug report). - -12. Numerous further improvements and minor bug fixes. - -What was new in Tablelist 4.3? ------------------------------- - -1. Support for multi-line cells: Newline characters now force line - breaks when displaying the items (thanks to Sebastien Barre, - Tillmann Basien, Cameron Laird, Kai Morich, and Vaclav Snajdr for - their proposals). In addition, interactive cell editing can now - take place with the aid of a text widget, too (this has caused a few - minor changes in the default key bindings for the edit window). - -2. Support for multi-column sorting with the aid of the new subcommands - "sortbycolumnlist", "sortcolumnlist", and "sortorderlist", as well - as of the new command "tablelist::addToSortColumns". The latter is - designed to be specified as the value of the new widget and column - configuration option "-labelcommand2", whose value is invoked on - events. Multi-column sorting is visualized by - means of multiple sort arrows, which are displayed together with the - corresponding sort ranks. (Thanks to Harold Campbell for proposing - most of these features, providing the initial implementation, and - testing the final one.) - -3. New configuration option "-setfocus", specifying whether mouse - button 1 should set the focus to the tablelist's body (thanks to - Tillmann Basien for discussions on this topic). - -4. Replaced the contents of the directory "images" with a script file - containing procedures that create the bitmap images from inline data - (thanks to Mats Bengtsson, Patrick Fradin, and Kai Morich for their - proposals). - -5. Fixed a bug related to the use of a tile entry within a non-tile- - based tablelist widget on Windows XP (thanks to Schelte Bron for his - bug report). - -6. The handling of events during interactive cell editing - is now explicitly restricted to Mac OS Classic and Mac OS X Aqua, - because, strangely enough, on Windows these events are generated by - simple keypresses if Num Lock is active. - -7. Numerous further code improvements, minor bug-fixes, and support for - several recent changes in tile. - -8. Cleaned up the documentation, to make sure that the HTML files - generated for the ActiveTcl distribution with the tool HTML Tidy - will be syntactically identical to the original ones. - -What was new in Tablelist 4.2? ------------------------------- - -1. The resize area of the header labels now consists of a few pixels - on both sides of the right edge (thanks to Bryan Oakley for - suggesting this improvement). - -2. Made sure that the header labels have the right appearance in the - "aqua" theme when using tile version 0.6.4 or later (thanks to - Bryan Oakley for his bug report). - -3. Several further improvements related to Mac OS X Aqua (for example, - support for the "Command" key during keyboard navigation between - the editable cells). - -4. Fixed a very long-standing bug in the "containing" subcommand - (thanks to Mats Bengtsson, Schelte Bron, and Mark Garvey for their - bug reports). - -5. Fixed a bug related to the "xpnative" theme, introduced in the - previous release (thanks to Mark Garvey, Jeff Godfrey, and Uwe - Koloska for their bug reports). - -6. Fixed another very long-standing bug, related to insertion and - deletion of columns having images in their labels (thanks to - Sebastien Barre for his bug report). - -7. Fixed an old bug related to embedding images or windows into hidden - cells (again, thanks to Sebastien Barre for reporting this bug). - -8. The demo scripts now work independently of their location (this - small improvement reflects the fact that Tablelist is now included - in tklib, where the examples are in a location different from - "$tablelist::library/demos"). - -9. Adapted two tile-based demo scripts to the recently released tile - version 0.7. - -10. Several further improvements in the code and documentation (thanks - to Patrick Fradin for his valuable contribution). - -What was new in Tablelist 4.1? ------------------------------- - -1. Significantly extended the tile support in the Tablelist_tile - package: Header labels now look and behave like the column - headings of treeview widgets, and over a dozen configuration - options have theme-specific default values (thanks to Paul - Obermeier for his excellent "poImgview" application, which helped - me a lot during this work, as well as to Georgios Petasis for his - Qt-related hints). - -2. Header labels containing the mouse cursor are now set into active - state. Their appearance is controlled in the Tablelist package by - the new configuration options "-labelactivebackground" and - "-labelactiveforeground", while the Tablelist_tile package uses - theme-specific background and foreground colors for the active and - pressed states of the labels. - -3. New configuration option "-arrowstyle", specifying the flat or - sunken relief and the dimensions of the arrow indicating the - sorting order. This option has windowing system- and theme- - specific default values. - -4. New configuration option "-protecttitlecolumns", used to protect - the title column boundary from being crossed when moving a column - interactively (thanks to Schelte Bron for his proposal). - -5. New configuration option "-spacing", specifying additional space to - provide above and below each tablelist row (thanks to Sebastien - Barre for his proposal). - -6. New column configuration option "-stretchable", complementing the - global "-stretch" option (thanks to Sebastien Barre for his - proposal). - -7. New row configuration option "-name", whose value can also be used - as a row index and as the first component of a cell index (thanks - to John Kozura for his proposal). - -8. New cell configuration option "-windowdestroy", specifying a script - to be invoked when a window embedded into the cell is destroyed - (thanks to Sebastien Barre for his proposal). - -9. New "imagelabelpath" subcommand (thanks to Schelte Bron for his - proposal). - -10. Keyboard navigation during interactive cell editing now works on - Mac OS X Aqua, too. - -11. Restored the support for Tcl/Tk versions earlier than 8.3, by - cleaning up the handling of the "-titlecolumns" option (thanks to - Andreas Flach and Brian O'Hagan for their bug reports). - -12. Restored the support for Tcl/Tk versions earlier than 8.0.4, which - has been broken since release 3.5, due to the use of the - event, introduced in Tk 8.0.4 (thanks to Brian O'Hagan - for his valuable contribution). - -13. Worked around a peculiarity of the text widget's "dump -window" - command (thanks to Greg Reynolds for his bug-fix). - -14. Fixed a binding-related bug in "extended" selection mode (thanks to - David Mattinson for his bug-fix). - -15. Numerous further improvements and minor bug fixes (thanks to - Schelte Bron, Patrick Fradin, Silas Justiniano, and Uwe Koloska for - their bug reports and valuable contributions). - -What was new in Tablelist 4.0? ------------------------------- - -1. Support for the tile entry, combobox, and checkbutton widgets for - interactive cell editing (thanks to Miguel Bagnon, Andy Black, - Adrian Chan, and Mark Garvey for their proposals and to Mats - Bengtsson and Kevin Walzer for their support on the Macintosh). - See the new reference page "tablelistTile.html" for details. - -2. Support for tile-compatibility: By just specifying "package - require Tablelist_tile" instead of "package require Tablelist", the - tablelist widgets will have a modern theme-specific appearance - (again, thanks to the above-mentioned Tablelist users for their - suggestions and assistance). See the "How to use it?" and "More on - Tablelist_tile" sections of the tutorial "tablelist.html" for - details. - -3. New demo script "tileWidgets.tcl", illustrating the use of tile - widgets for interactive cell editing and of the Tablelist_tile - package. All the other demo scripts are now provided in both a - traditional and a tile-based version. See the "Tile-based demo - scripts" section of the tutorial "tablelist.html" for an example - and some screenshots. - -4. The Tk checkbutton used for interactive cell editing is now a - platform-specific checkbutton widget on Windows and the Macintosh - (thanks to Mats Bengtsson for his help related to the Macintosh - platform). - -5. The "-editwindow" option is now available at cell level, too - (thanks to Kenneth Green for his proposal). - -6. New subcommand "togglevisibility" for hiding/unhiding several - columns at a time (thanks to Stefan Finzel and Kai Morich for their - proposals). - -7. Support for the new virtual event <>, - generated when a tablelist widget having "-exportselection 1" loses - the selection (thanks to Aldo Buratti for his proposal). - -8. After sorting the items, the "most important" row is automatically - brought into view (thanks to Kai Morich for his valuable input). - -9. Worked around a peculiarity of Tk for Windows, related to mouse - events (thanks to Tore Morkemo and Mike Collins for their bug - reports). - -10. Worked around a problem related to the visibility of the up/down- - arrow on Mac OS X Aqua (thanks to Kevin Walzer for his bug report). - -11. Fixed a bug in the "seecell" subcommand, introduced in Tablelist - version 3.7 (thanks to Stefan Finzel for his bug report). - -12. Fixed a bug in the "rowconfigure" subcommand, introduced in the - previous Tablelist release (thanks to Tore Morkemo for his bug - report). - -13. Eliminated the memory leak caused by incomplete cleanup on deleting - rows with embedded windows (thanks to David Cockerell for his bug - report). - -14. Fixed a small timing-related bug in the "editcell" subcommand - (thanks to Kenneth Green for his bug report). - -15. Numerous further improvements and minor bug fixes (thanks to Greg - Reynolds for his valuable input). - -What was new in Tablelist 3.8? ------------------------------- - -1. New configuration option "-forceeditendcommand", controlling the - invocation of the script corresponding to the value of the - "-editendcommand" option (thanks to Nestor Patino for his proposal). - -2. New subcommands "getcells" and "windowpath" (thanks to Jeff Godfrey - and Mike Collins for their proposals). - -3. Support for the new virtual event <>, - generated by the "cancelediting" subcommand. - -4. Significantly improved the performance of the "delete", - "deletecolumns", and "movecolumn" subcommands for tablelist widgets - having color or font options set at column, row, or cell level - (thanks to Michael Bahr for his valuable feedback). - -5. Improved the autoscrolling with the left mouse button in both the - body and the header of a tablelist widget having title columns. - -6. Fixed a bug related to the "-titlecolumns" option, introduced in the - previous Tablelist release (thanks to Alexander Schoepe for his bug - report). - -7. Fixed a typo in the implementation of the "seecell" subcommand, - introduced in the previous Tablelist release (thanks to Patrick - Fradin for his bug report). - -8. Improved the demo script "embeddedWindows.tcl" (thanks to Patrick - Fradin for his valuable input). - -9. Several further improvements and minor bug fixes. - -What was new in Tablelist 3.7? ------------------------------- - -1. New configuration option "-titlecolumns", specifying the number of - the non-scrollable columns at the left edge of the window (thanks to - Goran Ivankovic, Paul Kienzle, Hemang Lavana, and Takeshi Sakamoto - for their proposals). For technical reasons (the use of the - "-elide" option for a text widget tag), this option is not supported - for Tk versions earlier than 8.3. - -2. Extended the "separatorpath" and "separators" subcommands, to - support the new special separator, which is displayed to mark the - end of the title columns, independently of the value of the - "-showseparators" option. - -3. The "-stripebackground" and "-stripeforeground" options now have a - higher priority than the "-background" and "-foreground" column - configuration options, respectively (see the demo script - "styles.tcl", which has been extended to illustrate this change). - -4. Improved the handling of embedded images with transparent - background, complementing the changes made in the previous Tablelist - release (thanks to Kai Morich for his valuable contribution). - -5. Improved the implementation of the "seecell" subcommand for centered - and right-aligned columns. - -6. Fixed two bugs related to the "rowconfigure" subcommand, introduced - in Tablelist version 3.5 (thanks to Ted Branscomb and Roger Niva for - their bug reports). - -7. Fixed an old bug related to the "movecolumn" subcommand. - -8. Several further improvements and minor bug fixes. - -What was new in Tablelist 3.6? ------------------------------- - -1. Support for embedded windows, with the aid of the new cell - configuration option "-window" (thanks to Wolf Grossi, Glenn - Herteg, Takeshi Sakamoto, and Keesang Song for proposing this - option). - -2. New demo script "embeddedWindows.tcl" illustrating the use of - embedded windows in tablelist widgets; this is discussed in a new - section of the tutorial "tablelist.html". - -3. Significantly improved and optimized the handling of embedded - images. - -4. Simplified the support for user-defined binding scripts with the - aid of the new commands "tablelist::getTablelistPath" and - "tablelist::convEventFields", as well as of a new binding tag whose - name is returned by the new "bodytag" subcommand (which is now used - in the demo script "browse.tcl"). - -5. Support for the new virtual events <>, - <>, <> and - <> (thanks to John Vidolich for his - proposal). In addition, the new virtual event <> - can now be used instead of <> (which is supported - for compatibility reasons). - -6. New subcommand "itemlistvar", for accessing the tablelist widget's - internal list (thanks to Patrick Fradin for his valuable input). - -7. Fixed a bug related to the "-listvariable" option, introduced in - the previous Tablelist release (thanks to Torsten Reincke for his - bug report). - -8. Fixed two bugs related to the "cellselection" subcommand (thanks to - John Vidolich for his bug report). - -9. Fixed a few typos and minor bugs in the default binding scripts - (thanks to Patrick Fradin, Tore Morkemo, and Torsten Reincke for - their bug reports). - -10. Numerous further improvements and minor bug fixes. - -What was new in Tablelist 3.5? ------------------------------- - -1. New configuration option "-selecttype" with the values "row" and - "cell", and new binding scripts supporting these two selection - types (thanks to Kevin Partin for his proposal and to Dietmar - Mueller for his valuable contribution). - -2. New subcommands "activatecell", "cellselection", and - "curcellselection", used in the binding scripts mentioned above. - -3. The words "active" and "anchor" are now recognized as valid column - and cell indices, too. - -4. New configuration options "-movablerows" and "-movecursor", and new - mouse bindings for moving a row interactively (thanks to Dan Rogahn - for his valuable contribution). - -5. The key sequences used for navigation between the editable cells - now also move the active item or element and change the - (cell)selection and the (cell)selection anchor in the body of the - tablelist widget. - -6. Improved the handling and appearance of the checkbutton widget when - used as edit window (thanks to Kevin Partin for reporting a problem - experienced when the tablelist is embedded into an Iwidgets - dialogshell). - -7. The "-listvariable" option now supports variable names returned by - the "itcl::scope" command, too (thanks to Nicolae Mihalache for his - bug report). - -8. Fixed a very long-standing bug related to horizontal scrolling when - using a non-default font (thanks to Brand Hilton for his bug report - and fix). - -9. Fixed another very long-standing bug, related to list variables - (thanks to Dr. Detlef Groth and John R. Smith for their bug - reports). - -10. Numerous further improvements and minor bug fixes (thanks to - Patrick Fradin for his valuable input). - -What was new in Tablelist 3.4? ------------------------------- - -1. New column configuration option "-editwindow", specifying the - widget type used for interactive cell editing in the respective - column (thanks to Damon Courtney, Patrick Fradin, and Keesang Song - for their proposals and to Mats Bengtsson and Benny Riefenstein for - their help related to the Macintosh platform). The edit window may - be a Tk core entry, spinbox, or checkbutton, or one of the 16 - supported widgets from the packages BWidget, Iwidgets, combobox (by - Bryan Oakley), and Mentry. - -2. New subcommand "editwinpath". - -3. Three new demo scripts illustrating the use of the "-editwindow" - option; these are discussed in a new section of the tutorial - "tablelist.html". - -4. New column configuration option "-maxwidth" (thanks to Tore Morkemo - for his proposal). - -5. The event in a column label now restores the - column's last static width (thanks to Dietmar Mueller for his - valuable input). - -6. Changing a tablelist's font now updates the column widths - accordingly. - -7. Improved the handling of the "-setgrid" option. - -8. Improved the error handling related to the option database in the - general mega-widget utility module "mwutil.tcl". - -9. Fixed a minor bug in the "containingcolumn" subcommand (thanks to - David Mattinson for his bug report). - -10. Restored the support for Tcl/Tk versions earlier than 8.0.4, which - has been broken since release 3.0, due to the use of the - event, introduced in Tk 8.0.4. - -11. Further code improvements (thanks to Patrick Fradin for his - valuable input). - -12. Many improvements in the documentation, including a new Quick - Reference section (thanks to Dietmar Mueller for his valuable - contribution). - -What was new in Tablelist 3.3? ------------------------------- - -1. New column configuration option "-text" (thanks to Paul Kienzle for - his proposal). - -2. New subcommands "containing", "containingcolumn", "containingcell", - and "fillcolumn". - -3. New subcommands "deletecolumns", "insertcolumns", and - "insertcolumnlist" (thanks to Kevin Partin and Paul Kienzle for - their proposals). - -4. Renamed the subcommands "getcolumn" and "getkey" to "getcolumns" and - "getkeys", respectively. (This won't break any existing scripts, - because the old command names are abbreviations of the new ones.) - -5. Restored the support for Tcl/Tk versions earlier than 8.4, which was - broken in Tablelist 3.1 and 3.2, due to the use of the improved - syntax of the "place configure" command, introduced in Tk 8.4 - (thanks to David Mattinson, Kurt Braganza, and Alexander Baath for - reporting this problem). - -6. Fixed a bug in the "editcell" subcommand, introduced in Tablelist - 3.1 (thanks to Damon Courtney for his bug report). - -7. Improved the demo script "config.tcl" (thanks to Mats Bengtsson for - his input). - -8. Restructured the code by moving several procedures from the - distribution file "tablelistWidget.tcl" into smaller, more - manageable modules. - -9. Numerous further improvements and minor bug fixes. - -What was new in Tablelist 3.2? ------------------------------- - -1. The key associated with a tablelist item can now be used as a row - index and as the first component of a cell index of the form - "row,col". - -2. The "delete", "get", "getcolumn", "getkey", "selection clear", and - "selection set" subcommands now also accept a list of indices as - single argument (thanks to Damon Courtney and Erik Leunissen for - their proposals). - -3. Made the interactive "movecolumn" operation more intuitive and - compatible with the behavior exhibited by similar actions in popular - applications on various platforms (thanks to Paul Kienzle for his - suggestion). For example, the target position of the column being - moved is now indicated by a temporary gap displayed in the - tablelist's header. - -4. New configuration option "-targetcolor", used to set the color of - the gap mentioned above. - -5. Fixed a bug related to the event, caused by a missing - close-bracket in the last release (thanks to Patrick Fradin for his - bug report). - -6. Fixed a bug that raised an error in the "movecolumn" command for an - empty tablelist widget (thanks to Paul Kienzle for his bug report). - -7. The workaround in the "xview" and "yview" subcommands for a Tk bug - under Mac OS X Aqua is now only activated for that windowing system, - since (as reported by Patrick Fradin) it caused problems on some - other systems. - -8. Further minor code improvements. - -What was new in Tablelist 3.1? ------------------------------- - -1. New configuration options "-movablecolumns" and - "-movecolumncursor". - -2. New column configuration option "-name", whose value can also be - used as a column index and as the second component of a cell index - of the form "row,col". - -3. New subcommands "move", "movecolumn", "getcolumn", "getkey", and - "finishediting" (thanks to Damon Courtney, Daniel Fehrenbach, Jeff - Godfrey, and Kevin Partin for their proposals). - -4. Extended the scope of the "cancelediting" subcommand. - -5. New mouse bindings for moving a column interactively. - -6. The autoscrolling, as described in the "DEFAULT BINDINGS" section - of the "listbox" manual entry, is now implemented for the header of - a tablelist widget, too. - -7. The interactive cell editing is now finished by any mouse click in - the tablelist's body, outside the cell just being edited (thanks to - Patrick Fradin and Jeff Godfrey for this suggestion). - -8. The value returned by the "selection includes" command no longer - depends on the tablelist's state. - -9. Worked around a bug in Tk 8.4.0 and 8.4.1 related to the "selection - handle" command, which caused crashes under KDE 3.0 (thanks to - Andres Garcia for reporting this and to Joe English for suggesting - the workaround and fixing the bug in Tk 8.4.2). - -10. Improved the support of Mac OS X Aqua and Mac OS Classic (thanks to - Mats Bengtsson, Raymond Calande, Techin Alex Kang, Bernhard - Spinnler, and especially to Benny Riefenstein for their valuable - contributions). - -11. Fixed a bug related to the invocation of the "cellconfigure" - subcommand from within a pre-edit callback (thanks to Dr. Johannes- - Heinrich Vogeler for his bug report). - -12. Several performance improvements (thanks to Patrick Fradin for his - valuable suggestions). - -13. Improved the platform-specific stuff in the demo scripts - "config.tcl" and "browse.tcl". - -14. Numerous further improvements in the code and documentation. - -What was new in Tablelist 3.0? ------------------------------- - -The main new feature provided by this release is the support for -interactive cell editing (thanks to Juri Shimon, Dr. Johannes-Heinrich -Vogeler, and Jeff Godfrey for their proposal). The first three items -below are related to this subject: - -1. New configuration options "-editstartcommand" and "-editendcommand". - -2. New column and cell configuration option "-editable". - -3. New subcommands "editcell", "entrypath", "cancelediting", and - "rejectinput". - -Further changes: - -4. New subcommands "seecolumn" and "seecell". - -5. Tabulator and newline characters are now retained in the internal - list, displayed as "\t" and "\n", and supported by interactive cell - editing (thanks to Jacek Jenrysik for his query concerning multi- - line items). - -6. The redisplay and sorting of tablelist items have become - dramatically faster (thanks to Matt Becker for his input that - determined me to optimize these operations, and also for his - testing). - -7. Further performance improvements (thanks to Patrick Fradin for his - valuable contribution). - -8. The option values displayed by the demo script "config.tcl" can now - be edited interactively. - -9. Minor improvements in the code and documentation. - -What was new in Tablelist 2.8? ------------------------------- - -1. The trailing or leading ellipsis ("...") used when displaying the - elements that don't fit into their cells can now be replaced with an - arbitrary string specified with the aid of the new "-snipstring" - configuration option (thanks to Tore Morkemo for his proposal). - -2. New value "none" for the "-activestyle" configuration option. - -3. When exporting the selection, the elements of the hidden columns are - now skipped and the contents of the visible cells are transformed - according to the value of the "-formatcommand" option for the - corresponding columns. - -4. Improved and simplified the focus control (thanks to Juri Shimon and - Gopal Reddy for their bug reports). - -5. Further minor code improvements. - -What was new in Tablelist 2.7? ------------------------------- - -1. Increased the speed of the "insert" and "insertlist" subcommands as - well as that of item insertions with the aid of the "-listvariable" - option by a factor of about 1.3. The "insert" subcommand is now - about 2.3 times faster than in version 2.4. Compared to version - 2.4, item insertion with the aid of the "-listvariable" option has - become more than 10 times faster. - -2. The number of pixels by which a column is stretched is now - proportional to its width in pixels. Based on this change, - significantly improved the stretching behavior after an interactive - column resize operation (thanks to Mats Bengtsson for his valuable - suggestions). - -3. Fixed a bug in the "-(label)font" and "-labelborderwidth" - configuration options, introduced in version 2.5 (thanks to Bastien - Chevreux for his bug report). - -4. Fixed a bug in the "columncget", "rowcget", and "cellcget" - subcommands, introduced in version 2.3 (again, thanks to Bastien - Chevreux for reporting this bug). - -5. Fixed a bug in the binding scripts for the binding tag - "TablelistBody" (thanks to Miguel Bagnon for his bug report). - -6. Applied a patch proposed by Jeff Adamczak that works around a bug in - the "lsort" command, present in Tcl versions 8.0 - 8.3.2. - -7. Applied a patch proposed (in a slightly different form) by Mats - Bengtsson that works around a bug in the "info script" command on - the Macintosh. - -8. Further minor code improvements. - -What was new in Tablelist 2.6? ------------------------------- - -The only change in this version is a bug-fix eliminating a rather nasty -bug in the "insert" and "insertlist" subcommands, introduced in the -previous release. Thanks to Mats Bengtsson for his bug report and to -Jeffrey Hobbs for suggesting me to bump the version number to 2.6. - -What was new in Tablelist 2.5? ------------------------------- - -1. Increased the speed of the "insert" subcommand by a factor of about - 1.8 and that of item insertions with the aid of the "-listvariable" - option by a factor of about 8. (These figures are based on speed - measurements made with two tablelist widgets: one having 1000 rows - and 10 columns and another one with 5000 rows and 20 columns.) - -2. The "delete", "sort", and "sortbycolumn" subcommands, as well as row - and cell updates with the aid of the "rowconfigure" and - "cellconfigure" operations have also become significantly faster. - -3. New "insertlist" subcommand. - -4. New "-stripeheight" configuration option (thanks to Gregory Samoluk - for his proposal). - -5. If no columns are to be stretched then the blank space following the - header labels is now filled with a dummy, insensitive label having - the same background, borderwidth, and relief as the "normal" header - labels. - -6. Fixed a bug concerning the placement of the arrow indicating the - sorting order (thanks to Robert Minichino for his bug report). - -7. Improved the handling of header labels with embedded images, to - eliminate some peculiarities experienced on Windows. - -8. Several further improvements and minor bug fixes. - -What was new in Tablelist 2.4? ------------------------------- - -1. New column configuration option "-formatcommand" (thanks to Jeff - Godfrey for his proposal). This option is now used in the demo - script "browse.tcl". - -2. New row configuration option "-selectable" (thanks to Tore Morkemo - for this proposal). - -3. Significantly improved the performance of the row and cell updates, - as well as of the "delete" subcommand (thanks to Emanuele Lupi for - her input that determined me to optimize these operations). - -4. The widget implementation is now fully compatible with the recent - changes made in Tk 8.4a4 (thanks to Patrick Fradin for his input). - -5. Pop-up menus as children of a tablelist widget cause no problem any - longer (thanks to Andres Garcia and Bastien Chevreux for reporting - this bug, introduced in the previous release). - -6. Fixed a bug caused by the delayed redisplay after changing the - number of columns (thanks to Tore Morkemo for his bug report). - -7. Minor improvements in the code and documentation. - -What was new in Tablelist 2.3? ------------------------------- - -1. New configuration option "-activestyle", enabling to surround the - active item with a frame instead of underlining it. - -2. The columns can now be separated with borders, by making use of the - new configuration option "-showseparators". - -3. A nice distinguishing effect for the rows can now be obtained with - the aid of the new configuration options "-stripebackground" and - "-stripeforeground". - -4. New tablelist widget subcommands "separatorpath" and "separators". - -5. Fixed a bug related to the column index if the header labels are - hidden (thanks to Emanuele Lupi for her bug report). - -6. New demo script "styles.tcl", showing several ways to improve the - appearance of a tablelist widget. - -7. The demo scripts "config.tcl" and "browse.tcl" now make use of the - new "-stripebackground" option. - -8. Numerous further improvements and minor bug fixes (thanks to Patrick - Fradin for his valuable input). - -What was new in Tablelist 2.2? ------------------------------- - -1. The "-font" configuration option can now be specified at column, - row, and cell level, too (this was proposed and partly implemented - by Patrick Fradin). The data will be aligned properly, no matter if - the fonts are of different sizes. - -2. Significantly improved the performance of the Tcl command associated - with a tablelist widget, especially that of the "delete", "sort", - and "sortbycolumn" subcommands for a large number (i.e., several - thousands) of items. - -3. Corrected the creation of the arrow indicating the sorting order, to - make sure that it works under all supported Tcl/Tk versions (thanks - to Juri Shimon and Andres Garcia for their bug reports). - -4. Several improvements in the demo scripts "config.tcl" and - "browse.tcl". Among others, the GUIs generated by these scripts now - have a better platform-specific look & feel (many thanks to Mats - Bengtsson for his valuable suggestions concerning the Macintosh - platform). - -5. Further minor improvements in the code. - -What was new in Tablelist 2.1? ------------------------------- - -1. The up- or down-arrow indicating the sorting order now has a 3-D - border, giving the arrow a sunken relief. - -2. Due to the new 3-D look of the arrow, the default values of the - "-arrowcolor" and "-arrowdisabledcolor" configuration options have - been changed to an empty string, indicating that the arrow will - inherit the background color of the label in which it is placed. - -3. Several improvements in the demo script "browse.tcl". - -4. Minor improvements in the code and documentation. - -5. The distribution file "tablelist2_1.zip" for Windows now includes - the "tablelist2.1" directory, hence it is no longer necessary to - create this folder before unpacking the distribution file (thanks to - Kevin Partin for this suggestion). - -What was new in Tablelist 2.0? ------------------------------- - -1. New cell configuration option "-image", used to set and retrieve - the image to be displayed (by itself or together with a text) in a - cell of a tablelist widget. - -2. New column configuration option "-labelimage" specifying the image - to be displayed (by itself or combined with a text) in a column - label. - -3. The alignment of a header label can now be defined to be different - from that of the elements contained in its column, by using the new - column configuration option "-labelalign". - -4. Renamed the column configuration option "-justify" to "-align", - because (at least in the case of the header labels) this actually - specifies not only the justification, but also the anchor point. - Hopefully, this POTENTIAL INCOMPATIBILITY will not break too many - existing applications, because the column alignments are usually - specified within the "-columns" global option. - -5. Fixed a bug that raised an error when some configuration options - were specified at widget creation time before the "-columns" option - (thanks to Bastien Chevreux for his bug report). - -6. Reverted the implementation of the focus control to that contained - in the pre-1.6 Tablelist releases, because its simplified version - from the last release failed to work as expected if a tablelist was - the only widget taking the focus during keyboard traversal (thanks - to Juri Shimon for his bug report). - -7. Fixed a bug that caused an erronous return value of the "labels" - subcommand if the arrow indicating the sorting order was displayed. - -8. Several performance improvements, kindly contributed by Patrick - Fradin. - -9. To improve the performance even further, the invocations of "info - exists" for array elements are no longer replaced with a call to a - helper procedure (introduced in Tablelist 1.2), because the Tcl bug - that made this necessary for Tcl versions 8.2, 8.3.0 - 8.3.2, and - 8.4a1 was fixed in Tcl 8.3.3 and 8.4a2. If for some reason you - cannot upgrade your Tcl/Tk version, then you should patch the file - "tablelistWidget.tcl" with the aid of the script "repair.tcl", as - described in the files "README.txt" and "tablelist.html". - -10. The demo script "browse.tcl" now inserts an image into the first - cell of each row of the tablelist widget. - -11. Numerous further improvements and minor bug fixes. - -What was new in Tablelist 1.6? ------------------------------- - -1. The value of the "-stretch" configuration option is now ignored if - the width of the tablelist widget was specified as zero or less. - This change was necessary in order to improve the behavior of - dynamic-width tablelist widgets with the "-setgrid" option set to - true. - -2. By pressing mouse button 1 over a header label, the label's relief - is now only changed to "sunken" if the value of the global or - column-specific "-labelcommand" option is nonempty. - -3. Several improvements concerning hidden columns (thanks to Juri - Shimon for his bug report). - -4. Made the focus control more straight-forward. - -5. Extended the "How to use it?" section of the tutorial - "tablelist.html". - -What was new in Tablelist 1.5? ------------------------------- - -This version contains mainly bug fixes and small improvements. Many -thanks to Andres Garcia, Bastien Chevreux, and Patrick Fradin for their -valuable contributions. - -1. Fixed a bug concerning the "-label*" configuration options. - -2. Fixed the erronous invocation of "getSubCmd" in the selection - handler "fetchSelection" (this bug was introduced in version 1.1). - -3. Elements that don't fit into their cells are now displayed with a - trailing or leading ellipsis ("..."), depending on the column - alignment. - -4. Several further improvements and minor bug fixes. - -What was new in Tablelist 1.4? ------------------------------- - -1. New "-stretch" configuration option specifying the columns that are - to be stretched in order to eliminate the blank space that might - appear at the right of the table. - -2. Improved the error handling in the "attrib", "configure", - "columnconfigure", "rowconfigure", and "cellconfigure" subcommands. - -3. Improved the demo scripts "browse.tcl" and "config.tcl". - -What was new in Tablelist 1.3? ------------------------------- - -1. The "sortbycolumn" subcommand now per default places an up- or - down-arrow indicating the sorting order into the respective column's - label. This can be enabled or disabled with the new "-showarrow" - configuration option, at both widget and column level. - -2. New configuration options "-arrowcolor", "-arrowdisabledcolor", and - "-incrarrowtype" to control the appearance of the arrow mentioned - above. - -3. New "resetsortinfo" subcommand, used to reset the information about - the sorting of the items. - -4. Improved the demo script "browse.tcl". - -5. Further improvements in the code and documentation. - -What was new in Tablelist 1.2? ------------------------------- - -1. Whereever possible, eliminated the invocations of "info exists" for - array elements. This works around a severe bug in Tcl versions 8.2 - and 8.3 (fixed in 8.4a2), which causes excessive memory use when - calling "info exists" on a non-existent array element. Some serious - memory leaks in earlier Tablelist versions when run under Tcl/Tk 8.2 - or 8.3 (reported by Henning Hanusa and Christian Burrini) could be - tracked down to this very annoying Tcl bug (which I was not aware of - until recently). - -2. The help variables used in the initialization of the "tablelist" - namespace are now declared with the "variable" keyword, in order to - avoid any conflicts with global variables. - -3. Improved the parsing of configuration and command options. - -What was new in Tablelist 1.1? ------------------------------- - -This version contains mainly bug fixes and small improvements. Many -thanks to Patrick Fradin, Bastien Chevreux, and Mats Bengtsson for -their valuable contributions. - -1. Fixed some bugs in the implementation of the "-listvariable" option. - Also, the value of this option can now be an array element, not only - a scalar variable. - -2. Fixed a bug in the implementation of the "get" subcommand. - -3. New "sortcolumn" and "sortorder" subcommands to query the arguments - of the last sorting. - -4. Improved the look & feel of tablelist widgets on the Macintosh. - -5. Worked around a bug in Tk 8.3.0 (fixed in 8.3.1) concerning listbox - widgets with configured "-cursor" option. - -6. Several further improvements and minor bug fixes. - -What was new in Tablelist 1.0? ------------------------------- - -1. New "-resizable" option for the "columnconfigure" subcommand. - -2. New "labels" subcommand. returning the list of the header labels. - -3. The "-disabledforeground" and "-state" configuration options no - longer require Tk version 8.3 or higher. - -4. All "-label*" column configuration options can now have an empty - string as value, meaning that the corresponding global option will - be used instead of the column-specific one. - -5. Improved the output of the "columnconfigure" subcommand. - -6. The help variables used in the coordinate transformations within - the scripts defined for the "TablelistBody" binding tag have been - moved into the "tablelist" namespace, in order to avoid any - conflicts with global variables. - -7. Improved cross-platform support with the aid of the new <> - virtual event. - -8. Fixed a bug in the "compareAsSet" procedure of the demo script - "config.tcl". - -9. New demo script "browse.tcl", containing a simple widget browser - based on a tablelist. - -10. Both demo scripts now use a namespace for their procedures, to - avoid any conflicts when evaluating them with the "source" command. - -11. The tutorial "tablelist.html" is now completed and includes a - detailed discussion of both demo scripts mentioned above. - -12. Numerous further improvements in the code and documentation. - -What was new in Tablelist 0.9? ------------------------------- - -1. The documentation now includes the tutorial "tablelist.html" (part - of which is still work in progress), as well as reference pages for - the two exported commands "tablelist::tablelist" and - "tablelist::sortByColumn". - -2. The "-listvariable" configuration option is now fully implemented. - -3. A column of a tablelist widget can now be made invisible by using - the new "-hide" option of the "columnconfigure" subcommand. - -4. The contents of a row can now be updated with the new "-text" option - of the "rowconfigure" subcommand. - -5. For Tk versions 8.3 or higher the "tablelist::tablelist" command now - supports the "-disabledforeground", "-labeldisabledforeground", and - "-state" configuration options. - -6. Replaced "[focus]" with "[focus -displayof $win]", so that the code - will work properly in applications using multiple displays. - Similarly, the "font measure" command is now invoked with the - "-displayof $win" option. This also works around a peculiarity of - the "font measure" command. - -7. Renamed "tablelistBindingTag" to "Tablelist". - -8. Fixed a bug in the private procedure "colIndex", for arguments of - the form "@x,y". This procedure is invoked (directly or indirectly) - in the implementation of all commands that take a column or cell - index or an x coordinate as argument. - -9. Numerous further improvements and minor bug fixes. DELETED tablelist5.13/COPYRIGHT.txt Index: tablelist5.13/COPYRIGHT.txt ================================================================== --- tablelist5.13/COPYRIGHT.txt +++ tablelist5.13/COPYRIGHT.txt @@ -1,10 +0,0 @@ -Multi-column listbox and tree widget package Tablelist, version 5.13 -Copyright (c) 2000-2015 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) - -This library is free software; you can use, modify, and redistribute it -for any purpose, provided that existing copyright notices are retained -in all copies and that this notice is included verbatim in any -distributions. - -This software is distributed WITHOUT ANY WARRANTY; without even the -implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. DELETED tablelist5.13/README.txt Index: tablelist5.13/README.txt ================================================================== --- tablelist5.13/README.txt +++ tablelist5.13/README.txt @@ -1,165 +0,0 @@ - The Multi-Column Listbox and Tree Widget Package Tablelist - - by - - Csaba Nemethi - - csaba.nemethi@t-online.de - - -What is Tablelist? ------------------- - -Tablelist is a library package for Tcl/Tk versions 8.0 or higher, -written in pure Tcl/Tk code. It contains: - - - the implementation of the "tablelist" mega-widget, including a - general utility module for mega-widgets; - - a demo script containing a useful procedure that displays the - configuration options of an arbitrary widget in a tablelist and - enables you to edit their values interactively; - - a demo script implementing a widget browser based on a tablelist - used as multi-column listbox; - - a demo script implementing a widget browser based on a tablelist - used as multi-column tree widget; - - a demo script implementing a directory viewer based on a tablelist - used as multi-column tree widget; - - a demo script showing several ways to improve the appearance of a - tablelist widget; - - four further demo scripts, illustrating the interactive cell - editing with the aid of various widgets from the Tk core and from - the packages tile, BWidget, Iwidgets, combobox (by Bryan Oakley), - and Mentry; - - one further demo script, with a tablelist widget containing - embedded windows; - - tile-based counterparts of the above-mentioned demo scripts; - - a tutorial in HTML format; - - reference pages in HTML format. - -A tablelist is a multi-column listbox and tree widget. The width of -each column can be dynamic (i.e., just large enough to hold all its -elements, including the header) or static (specified in characters or -pixels). The columns are, per default, resizable. The alignment of -each column can be specified as "left", "right", or "center". - -The columns, rows, and cells can be configured individually. Several -of the global and column-specific options refer to the headers, -implemented as label widgets. For instance, the "-labelcommand" option -specifies a Tcl command to be invoked when mouse button 1 is released -over a label. The most common value of this option sorts the items -based on the respective column. - -The Tablelist package provides a great variety of tree styles -controlling the look & feel of the column that displays the tree -hierarchy with the aid of indentations and expand/collapse controls. - -Interactive editing of the elements of a tablelist widget can be -enabled for individual cells and for entire columns. A great variety -of widgets from the Tk core and from the packages tile, BWidget, -Iwidgets, combobox, ctext, and Mentry (or Mentry_tile) is supported for -being used as embedded edit window. In addition, a rich set of keyboard -bindings is provided for a comfortable navigation between the editable -cells. - -The Tcl command corresponding to a tablelist widget is very similar to -the one associated with a normal listbox. There are column-, row-, and -cell-specific counterparts of the "configure" and "cget" subcommands -("columnconfigure", "rowconfigure", "cellconfigure", ...). They can be -used, among others, to insert images into the cells and the header -labels, or to insert embedded windows into the cells. The "index", -"nearest", and "see" command options refer to the rows, but similar -subcommands are provided for the columns and cells ("columnindex", -"cellindex", ...). The items can be sorted with the "sort", -"sortbycolumn", and "sortbycolumnlist" command options. - -The bindings defined for the body of a tablelist widget make it behave -just like a normal listbox. This includes the support for the virtual -event <> (which is equivalent to <>). -In addition, version 2.3 or higher of the widget callback package Wcb -(written in pure Tcl/Tk code as well) can be used to define callbacks -for the "activate", "selection set", and "selection clear" commands, -and Wcb version 3.0 or higher also supports callbacks for the -"activatecell", "cellselection set", and "cellselection clear" -commands. The download location of Wcb is - - http://www.nemethi.de - -How to get it? --------------- - -Tablelist is available for free download from the same URL as Wcb. The -distribution file is "tablelist5.13.tar.gz" for UNIX and -"tablelist5_13.zip" for Windows. These files contain the same -information, except for the additional carriage return character -preceding the linefeed at the end of each line in the text files for -Windows. - -Tablelist is also included in tklib, which has the address - - http://core.tcl.tk/tklib - -How to install it? ------------------- - -Install the package as a subdirectory of one of the directories given -by the "auto_path" variable. For example, you can install it as a -directory at the same level as the Tcl and Tk script libraries. The -locations of these library directories are given by the "tcl_library" -and "tk_library" variables, respectively. - -To install Tablelist on UNIX, "cd" to the desired directory and unpack -the distribution file "tablelist5.13.tar.gz": - - gunzip -c tablelist5.13.tar.gz | tar -xf - - -This command will create a directory named "tablelist5.13", with the -subdirectories "demos", "doc", and "scripts". - -On Windows, use WinZip or some other program capable of unpacking the -distribution file "tablelist5_13.zip" into the directory -"tablelist5.13", with the subdirectories "demos", "doc", and "scripts". - -The file "tablelistEdit.tcl" in the "scripts" directory is only needed -for applications making use of interactive cell editing. Similarly, the -file "tablelistMove.tcl" in the same directory is only required for -scripts invoking the "move" or "movecolumn" tablelist command. Finally, -the file "tablelistThemes.tcl" is only needed for applications using -the package Tablelist_tile (see next section). - -Next, you should check the exact version number of your Tcl/Tk -distribution, given by the "tcl_patchLevel" and "tk_patchLevel" -variables. If you are using Tcl/Tk version 8.2.X, 8.3.0 - 8.3.2, or -8.4a1, then you should proceed as described in the "How to install it?" -section of the file "tablelist.html", located in the "doc" directory. - -How to use it? --------------- - -The Tablelist distribution provides two packages, called Tablelist and -Tablelist_tile. The main difference between the two is that -Tablelist_tile enables the tile-based, theme-specific appearance of -tablelist widgets; this package requires Tcl/Tk 8.4 or higher and tile -0.6 or higher. It is not possible to use both packages in one and the -same application, because both are implemented in the same "tablelist" -namespace and provide identical commands. - -To be able to use the commands and variables implemented in the package -Tablelist, your scripts must contain one of the lines - - package require tablelist ?version? - package require Tablelist ?version? - -Likewise, to be able to use the commands and variables implemented in -the package Tablelist_tile, your scripts must contain one of the lines - - package require tablelist_tile ?version? - package require Tablelist_tile ?version? - -Since the packages Tablelist and Tablelist_tile are implemented in the -"tablelist" namespace, you must either import the procedures you need, -or use qualified names like "tablelist::tablelist". - -For a detailed description of the commands and variables provided by -Tablelist and of the examples contained in the "demos" directory, see -the tutorial "tablelist.html" and the reference pages, all located in -the "doc" directory. DELETED tablelist5.13/demos/browse.tcl Index: tablelist5.13/demos/browse.tcl ================================================================== --- tablelist5.13/demos/browse.tcl +++ tablelist5.13/demos/browse.tcl @@ -1,357 +0,0 @@ -#============================================================================== -# Demonstrates how to use a tablelist widget for displaying information about -# the children of an arbitrary widget. -# -# Copyright (c) 2000-2015 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) -#============================================================================== - -package require tablelist 5.13 - -namespace eval demo { - variable dir [file dirname [info script]] - - # - # Create two images, needed in the procedure putChildren - # - variable leafImg [image create bitmap -file [file join $dir leaf.xbm] \ - -background coral -foreground gray50] - variable compImg [image create bitmap -file [file join $dir comp.xbm] \ - -background yellow -foreground gray50] -} - -source [file join $demo::dir config.tcl] - -#------------------------------------------------------------------------------ -# demo::displayChildren -# -# Displays information on the children of the widget w in a tablelist widget -# contained in a newly created top-level widget. Returns the name of the -# tablelist widget. -#------------------------------------------------------------------------------ -proc demo::displayChildren w { - if {![winfo exists $w]} { - bell - tk_messageBox -title "Error" -icon error -message \ - "Bad window path name \"$w\"" - return "" - } - - # - # Create a top-level widget of the class DemoTop - # - set top .browseTop - for {set n 2} {[winfo exists $top]} {incr n} { - set top .browseTop$n - } - toplevel $top -class DemoTop - - # - # Create a vertically scrolled tablelist widget with 9 dynamic-width - # columns and interactive sort capability within the top-level - # - set tf $top.tf - frame $tf - set tbl $tf.tbl - set vsb $tf.vsb - tablelist::tablelist $tbl \ - -columns {0 "Path Name" left - 0 "Class" left - 0 "X" right - 0 "Y" right - 0 "Width" right - 0 "Height" right - 0 "Mapped" center - 0 "Viewable" center - 0 "Manager" left} \ - -labelcommand demo::labelCmd -yscrollcommand [list $vsb set] -width 0 - if {[$tbl cget -selectborderwidth] == 0} { - $tbl configure -spacing 1 - } - foreach col {2 3 4 5} { - $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 - # - foreach l [$tbl labels] { - bind $l [list demo::updateItemsDelayed $tbl] - } - bind $tbl [list demo::updateItemsDelayed $tbl] - - # - # Create a pop-up menu with two command entries; bind the script - # associated with its first entry to the event, too - # - set menu $top.menu - menu $menu -tearoff no - $menu add command -label "Display Children" \ - -command [list demo::putChildrenOfSelWidget $tbl] - $menu add command -label "Display Config" \ - -command [list demo::dispConfigOfSelWidget $tbl] - set bodyTag [$tbl bodytag] - bind $bodyTag [list demo::putChildrenOfSelWidget $tbl] - bind $bodyTag <> [bind TablelistBody ] - bind $bodyTag <> +[bind TablelistBody ] - bind $bodyTag <> +[list demo::postPopupMenu $top %X %Y] - - # - # Create three buttons within a frame child of the top-level widget - # - set bf $top.bf - frame $bf - set b1 $bf.b1 - set b2 $bf.b2 - set b3 $bf.b3 - button $b1 -text "Refresh" - button $b2 -text "Parent" - button $b3 -text "Close" -command [list destroy $top] - - # - # Manage the widgets - # - grid $tbl -row 0 -rowspan 2 -column 0 -sticky news - variable winSys - if {[string compare $winSys "aqua"] == 0} { - grid [$tbl cornerpath] -row 0 -column 1 -sticky ew - grid $vsb -row 1 -column 1 -sticky ns - } else { - grid $vsb -row 0 -rowspan 2 -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 10 - 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 - return $tbl -} - -#------------------------------------------------------------------------------ -# demo::putChildren -# -# Outputs the data of the children of the widget w into the tablelist widget -# tbl. -#------------------------------------------------------------------------------ -proc demo::putChildren {w tbl} { - # - # The following check is necessary because this procedure - # is also invoked by the "Refresh" and "Parent" buttons - # - if {![winfo exists $w]} { - bell - set choice [tk_messageBox -title "Error" -icon warning \ - -message "Bad window path name \"$w\" -- replacing\ - it with nearest existent ancestor" \ - -type okcancel -default ok -parent [winfo toplevel $tbl]] - if {[string compare $choice "ok"] == 0} { - while {![winfo exists $w]} { - set last [string last "." $w] - if {$last != 0} { - incr last -1 - } - set w [string range $w 0 $last] - } - } else { - return "" - } - } - - set top [winfo toplevel $tbl] - wm title $top "Children of the [winfo class $w] Widget \"$w\"" - - $tbl resetsortinfo - $tbl delete 0 end - - # - # Display the data of the children of the - # widget w in the tablelist widget tbl - # - variable leafImg - variable compImg - foreach c [winfo children $w] { - # - # Insert the data of the current child into the tablelist widget - # - set item {} - lappend item $c [winfo class $c] [winfo x $c] [winfo y $c] \ - [winfo width $c] [winfo height $c] [winfo ismapped $c] \ - [winfo viewable $c] [winfo manager $c] - $tbl insert end $item - - # - # Insert an image into the first cell of the row - # - if {[llength [winfo children $c]] == 0} { - $tbl cellconfigure end,0 -image $leafImg - } else { - $tbl cellconfigure end,0 -image $compImg - } - } - - # - # Configure the "Refresh" and "Parent" buttons - # - $top.bf.b1 configure -command [list demo::putChildren $w $tbl] - set b2 $top.bf.b2 - set p [winfo parent $w] - if {[string compare $p ""] == 0} { - $b2 configure -state disabled - } else { - $b2 configure -state normal -command [list demo::putChildren $p $tbl] - } -} - -#------------------------------------------------------------------------------ -# demo::formatBoolean -# -# Returns "yes" or "no", according to the specified boolean value. -#------------------------------------------------------------------------------ -proc demo::formatBoolean val { - return [expr {$val ? "yes" : "no"}] -} - -#------------------------------------------------------------------------------ -# demo::labelCmd -# -# Sorts the contents of the tablelist widget tbl by its col'th column and makes -# sure the items will be updated 500 ms later (because one of the items might -# refer to a canvas containing the arrow that displays the sort order). -#------------------------------------------------------------------------------ -proc demo::labelCmd {tbl col} { - tablelist::sortByColumn $tbl $col - updateItemsDelayed $tbl -} - -#------------------------------------------------------------------------------ -# demo::updateItemsDelayed -# -# Arranges for the items of the tablelist widget tbl to be updated 500 ms later. -#------------------------------------------------------------------------------ -proc demo::updateItemsDelayed tbl { - # - # Schedule the demo::updateItems command for execution - # 500 ms later, but only if it is not yet pending - # - if {[string compare [$tbl attrib afterId] ""] == 0} { - $tbl attrib afterId [after 500 [list demo::updateItems $tbl]] - } -} - -#------------------------------------------------------------------------------ -# demo::updateItems -# -# Updates the items of the tablelist widget tbl. -#------------------------------------------------------------------------------ -proc demo::updateItems tbl { - # - # Reset the tablelist's "afterId" attribute - # - $tbl attrib afterId "" - - # - # Update the items - # - set rowCount [$tbl size] - for {set row 0} {$row < $rowCount} {incr row} { - set c [$tbl cellcget $row,0 -text] - if {![winfo exists $c]} { - continue - } - - set item {} - lappend item $c [winfo class $c] [winfo x $c] [winfo y $c] \ - [winfo width $c] [winfo height $c] [winfo ismapped $c] \ - [winfo viewable $c] [winfo manager $c] - $tbl rowconfigure $row -text $item - } - - # - # Repeat the last sort operation (if any) - # - $tbl refreshsorting -} - -#------------------------------------------------------------------------------ -# demo::putChildrenOfSelWidget -# -# Outputs the data of the children of the selected widget into the tablelist -# widget tbl. -#------------------------------------------------------------------------------ -proc demo::putChildrenOfSelWidget tbl { - set w [$tbl cellcget [$tbl curselection],0 -text] - if {![winfo exists $w]} { - bell - tk_messageBox -title "Error" -icon error -message \ - "Bad window path name \"$w\"" -parent [winfo toplevel $tbl] - return "" - } - - if {[llength [winfo children $w]] == 0} { - bell - } else { - putChildren $w $tbl - } -} - -#------------------------------------------------------------------------------ -# demo::dispConfigOfSelWidget -# -# Displays the configuration options of the selected widget within the -# tablelist tbl in a tablelist widget contained in a newly created top-level -# widget. -#------------------------------------------------------------------------------ -proc demo::dispConfigOfSelWidget tbl { - demo::displayConfig [$tbl cellcget [$tbl curselection],0 -text] -} - -#------------------------------------------------------------------------------ -# demo::postPopupMenu -# -# Posts the pop-up menu $top.menu at the given screen position. Before posting -# the menu, the procedure enables/disables its first entry, depending upon -# whether the selected widget has children or not. -#------------------------------------------------------------------------------ -proc demo::postPopupMenu {top rootX rootY} { - set tbl $top.tf.tbl - set w [$tbl cellcget [$tbl curselection],0 -text] - if {![winfo exists $w]} { - bell - tk_messageBox -title "Error" -icon error -message \ - "Bad window path name \"$w\"" -parent $top - return "" - } - - set menu $top.menu - if {[llength [winfo children $w]] == 0} { - $menu entryconfigure 0 -state disabled - } else { - $menu entryconfigure 0 -state normal - } - - tk_popup $menu $rootX $rootY -} - -#------------------------------------------------------------------------------ - -if {$tcl_interactive} { - return "\nTo display information about the children of an arbitrary\ - widget, enter\n\n\tdemo::displayChildren \n" -} else { - wm withdraw . - tk_messageBox -title $argv0 -icon warning -message \ - "Please source this script into\nan interactive wish session" - exit 1 -} DELETED tablelist5.13/demos/browseTree.tcl Index: tablelist5.13/demos/browseTree.tcl ================================================================== --- tablelist5.13/demos/browseTree.tcl +++ tablelist5.13/demos/browseTree.tcl @@ -1,444 +0,0 @@ -#============================================================================== -# Demonstrates how to use a tablelist widget for displaying information about -# the children of an arbitrary widget. -# -# Copyright (c) 2010-2015 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) -#============================================================================== - -package require Tk 8.3 -package require tablelist 5.13 - -namespace eval demo { - variable dir [file dirname [info script]] - - # - # Create two images, needed in the procedure putChildren - # - variable leafImg [image create bitmap -file [file join $dir leaf.xbm] \ - -background coral -foreground gray50] - variable compImg [image create bitmap -file [file join $dir comp.xbm] \ - -background yellow -foreground gray50] -} - -source [file join $demo::dir config.tcl] - -#------------------------------------------------------------------------------ -# demo::displayChildren -# -# Displays information on the children of the widget w in a tablelist widget -# contained in a newly created top-level widget. Returns the name of the -# tablelist widget. -#------------------------------------------------------------------------------ -proc demo::displayChildren w { - if {![winfo exists $w]} { - bell - tk_messageBox -title "Error" -icon error -message \ - "Bad window path name \"$w\"" - return "" - } - - # - # Create a top-level widget of the class DemoTop - # - set top .browseTop - for {set n 2} {[winfo exists $top]} {incr n} { - set top .browseTop$n - } - toplevel $top -class DemoTop - - # - # Create a vertically scrolled tablelist widget with 9 dynamic-width - # columns and interactive sort capability within the top-level - # - set tf $top.tf - frame $tf - set tbl $tf.tbl - set vsb $tf.vsb - tablelist::tablelist $tbl \ - -columns {0 "Path Name" left - 0 "Class" left - 0 "X" right - 0 "Y" right - 0 "Width" right - 0 "Height" right - 0 "Mapped" center - 0 "Viewable" center - 0 "Manager" left} \ - -expandcommand demo::expandCmd -labelcommand demo::labelCmd \ - -yscrollcommand [list $vsb set] -setgrid no -width 0 - if {[$tbl cget -selectborderwidth] == 0} { - $tbl configure -spacing 1 - } - foreach col {2 3 4 5} { - $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 - # - foreach l [$tbl labels] { - bind $l [list demo::updateItemsDelayed $tbl] - } - bind $tbl [list demo::updateItemsDelayed $tbl] - - # - # Create a pop-up menu with two command entries; bind the script - # associated with its first entry to the event, too - # - set menu $top.menu - menu $menu -tearoff no - $menu add command -label "Display Children" \ - -command [list demo::putChildrenOfSelWidget $tbl] - $menu add command -label "Display Config" \ - -command [list demo::dispConfigOfSelWidget $tbl] - set bodyTag [$tbl bodytag] - bind $bodyTag [list demo::putChildrenOfSelWidget $tbl] - bind $bodyTag <> [bind TablelistBody ] - bind $bodyTag <> +[bind TablelistBody ] - bind $bodyTag <> +[list demo::postPopupMenu $top %X %Y] - - # - # Create three buttons within a frame child of the top-level widget - # - set bf $top.bf - frame $bf - set b1 $bf.b1 - set b2 $bf.b2 - set b3 $bf.b3 - button $b1 -text "Refresh" - button $b2 -text "Parent" - button $b3 -text "Close" -command [list destroy $top] - - # - # Manage the widgets - # - grid $tbl -row 0 -rowspan 2 -column 0 -sticky news - variable winSys - if {[string compare $winSys "aqua"] == 0} { - grid [$tbl cornerpath] -row 0 -column 1 -sticky ew - grid $vsb -row 1 -column 1 -sticky ns - } else { - grid $vsb -row 0 -rowspan 2 -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 10 - 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 - return $tbl -} - -#------------------------------------------------------------------------------ -# demo::putChildren -# -# Outputs the data of the children of the widget w into the tablelist widget -# tbl, as child items of the one identified by nodeIdx. -#------------------------------------------------------------------------------ -proc demo::putChildren {w tbl nodeIdx} { - # - # The following check is necessary because this procedure - # is also invoked by the "Refresh" and "Parent" buttons - # - if {![winfo exists $w]} { - bell - if {[string compare $nodeIdx "root"] == 0} { - set choice [tk_messageBox -title "Error" -icon warning \ - -message "Bad window path name \"$w\" -- replacing\ - it with nearest existent ancestor" \ - -type okcancel -default ok \ - -parent [winfo toplevel $tbl]] - if {[string compare $choice "ok"] == 0} { - while {![winfo exists $w]} { - set last [string last "." $w] - if {$last != 0} { - incr last -1 - } - set w [string range $w 0 $last] - } - } else { - return "" - } - } else { - return "" - } - } - - if {[string compare $nodeIdx "root"] == 0} { - set top [winfo toplevel $tbl] - wm title $top "Children of the [winfo class $w] Widget \"$w\"" - - $tbl resetsortinfo - $tbl delete 0 end - set row 0 - } else { - set row [expr {$nodeIdx + 1}] - } - - # - # Display the data of the children of the - # widget w in the tablelist widget tbl - # - variable leafImg - variable compImg - foreach c [winfo children $w] { - # - # Insert the data of the current child into the tablelist widget - # - set item {} - lappend item \ - [winfo name $c] [winfo class $c] [winfo x $c] [winfo y $c] \ - [winfo width $c] [winfo height $c] [winfo ismapped $c] \ - [winfo viewable $c] [winfo manager $c] - $tbl insertchild $nodeIdx end $item - - # - # Insert an image into the first cell of the row; mark the - # row as collapsed if the child widget has children itself - # - if {[llength [winfo children $c]] == 0} { - $tbl cellconfigure $row,0 -image $leafImg - } else { - $tbl cellconfigure $row,0 -image $compImg - $tbl collapse $row - } - - $tbl rowattrib $row pathName $c - incr row - } - - if {[string compare $nodeIdx "root"] == 0} { - # - # Configure the "Refresh" and "Parent" buttons - # - $top.bf.b1 configure -command [list demo::refreshView $w $tbl] - set b2 $top.bf.b2 - set p [winfo parent $w] - if {[string compare $p ""] == 0} { - $b2 configure -state disabled - } else { - $b2 configure -state normal -command \ - [list demo::putChildren $p $tbl root] - } - } -} - -#------------------------------------------------------------------------------ -# demo::expandCmd -# -# Outputs the data of the children of the widget whose leaf name is displayed -# in the first cell of the specified row of the tablelist widget tbl, as child -# items of the one identified by row. -#------------------------------------------------------------------------------ -proc demo::expandCmd {tbl row} { - if {[$tbl childcount $row] == 0} { - set w [$tbl rowattrib $row pathName] - putChildren $w $tbl $row - - # - # Apply the last sorting (if any) to the new items - # - $tbl refreshsorting $row - } -} - -#------------------------------------------------------------------------------ -# demo::formatBoolean -# -# Returns "yes" or "no", according to the specified boolean value. -#------------------------------------------------------------------------------ -proc demo::formatBoolean val { - return [expr {$val ? "yes" : "no"}] -} - -#------------------------------------------------------------------------------ -# demo::labelCmd -# -# Sorts the contents of the tablelist widget tbl by its col'th column and makes -# sure the items will be updated 500 ms later (because one of the items might -# refer to a canvas containing the arrow that displays the sort order). -#------------------------------------------------------------------------------ -proc demo::labelCmd {tbl col} { - tablelist::sortByColumn $tbl $col - updateItemsDelayed $tbl -} - -#------------------------------------------------------------------------------ -# demo::updateItemsDelayed -# -# Arranges for the items of the tablelist widget tbl to be updated 500 ms later. -#------------------------------------------------------------------------------ -proc demo::updateItemsDelayed tbl { - # - # Schedule the demo::updateItems command for execution - # 500 ms later, but only if it is not yet pending - # - if {[string compare [$tbl attrib afterId] ""] == 0} { - $tbl attrib afterId [after 500 [list demo::updateItems $tbl]] - } -} - -#------------------------------------------------------------------------------ -# demo::updateItems -# -# Updates the items of the tablelist widget tbl. -#------------------------------------------------------------------------------ -proc demo::updateItems tbl { - # - # Reset the tablelist's "afterId" attribute - # - $tbl attrib afterId "" - - # - # Update the items - # - set rowCount [$tbl size] - for {set row 0} {$row < $rowCount} {incr row} { - set c [$tbl rowattrib $row pathName] - if {![winfo exists $c]} { - continue - } - - set item {} - lappend item \ - [winfo name $c] [winfo class $c] [winfo x $c] [winfo y $c] \ - [winfo width $c] [winfo height $c] [winfo ismapped $c] \ - [winfo viewable $c] [winfo manager $c] - $tbl rowconfigure $row -text $item - } - - # - # Repeat the last sort operation (if any) - # - $tbl refreshsorting -} - -#------------------------------------------------------------------------------ -# demo::putChildrenOfSelWidget -# -# Outputs the data of the children of the selected widget into the tablelist -# widget tbl. -#------------------------------------------------------------------------------ -proc demo::putChildrenOfSelWidget tbl { - set w [$tbl rowattrib [$tbl curselection] pathName] - if {![winfo exists $w]} { - bell - tk_messageBox -title "Error" -icon error -message \ - "Bad window path name \"$w\"" -parent [winfo toplevel $tbl] - return "" - } - - if {[llength [winfo children $w]] == 0} { - bell - } else { - putChildren $w $tbl root - } -} - -#------------------------------------------------------------------------------ -# demo::dispConfigOfSelWidget -# -# Displays the configuration options of the selected widget within the -# tablelist tbl in a tablelist widget contained in a newly created top-level -# widget. -#------------------------------------------------------------------------------ -proc demo::dispConfigOfSelWidget tbl { - demo::displayConfig [$tbl rowattrib [$tbl curselection] pathName] -} - -#------------------------------------------------------------------------------ -# demo::postPopupMenu -# -# Posts the pop-up menu $top.menu at the given screen position. Before posting -# the menu, the procedure enables/disables its first entry, depending upon -# whether the selected widget has children or not. -#------------------------------------------------------------------------------ -proc demo::postPopupMenu {top rootX rootY} { - set tbl $top.tf.tbl - set w [$tbl rowattrib [$tbl curselection] pathName] - if {![winfo exists $w]} { - bell - tk_messageBox -title "Error" -icon error -message \ - "Bad window path name \"$w\"" -parent $top - return "" - } - - set menu $top.menu - if {[llength [winfo children $w]] == 0} { - $menu entryconfigure 0 -state disabled - } else { - $menu entryconfigure 0 -state normal - } - - tk_popup $menu $rootX $rootY -} - -#------------------------------------------------------------------------------ -# demo::refreshView -# -# Redisplays the data of the children of the widget w in the tablelist widget -# tbl and restores the expanded states of the items as well as the vertical -# view. -#------------------------------------------------------------------------------ -proc demo::refreshView {w tbl} { - # - # Save the vertical view and get the path names of - # the child widgets displayed in the expanded rows - # - set yView [$tbl yview] - foreach key [$tbl expandedkeys] { - set pathName [$tbl rowattrib $key pathName] - set expandedWidgets($pathName) 1 - } - - # - # Redisplay the data of the widget's (possibly changed) children and - # restore the expanded states of the children, along with the vertical view - # - putChildren $w $tbl root - restoreExpandedStates $tbl root expandedWidgets - $tbl yview moveto [lindex $yView 0] -} - -#------------------------------------------------------------------------------ -# demo::restoreExpandedStates -# -# Expands those children of the parent identified by nodeIdx that display the -# data of child widgets whose path names are the names of the elements of the -# array specified by the last argument. -#------------------------------------------------------------------------------ -proc demo::restoreExpandedStates {tbl nodeIdx expandedWidgetsName} { - upvar $expandedWidgetsName expandedWidgets - - foreach key [$tbl childkeys $nodeIdx] { - set pathName [$tbl rowattrib $key pathName] - if {[info exists expandedWidgets($pathName)]} { - $tbl expand $key -partly - restoreExpandedStates $tbl $key expandedWidgets - } - } -} - -#------------------------------------------------------------------------------ - -if {$tcl_interactive} { - return "\nTo display information about the children of an arbitrary\ - widget, enter\n\n\tdemo::displayChildren \n" -} else { - wm withdraw . - tk_messageBox -title $argv0 -icon warning -message \ - "Please source this script into\nan interactive wish session" - exit 1 -} DELETED tablelist5.13/demos/browseTree_tile.tcl Index: tablelist5.13/demos/browseTree_tile.tcl ================================================================== --- tablelist5.13/demos/browseTree_tile.tcl +++ tablelist5.13/demos/browseTree_tile.tcl @@ -1,449 +0,0 @@ -#============================================================================== -# Demonstrates how to use a tablelist widget for displaying information about -# the children of an arbitrary widget. -# -# Copyright (c) 2010-2015 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) -#============================================================================== - -package require tablelist_tile 5.13 - -namespace eval demo { - variable dir [file dirname [info script]] - - # - # Create two images, needed in the procedure putChildren - # - variable leafImg [image create bitmap -file [file join $dir leaf.xbm] \ - -background coral -foreground gray50] - variable compImg [image create bitmap -file [file join $dir comp.xbm] \ - -background yellow -foreground gray50] -} - -source [file join $demo::dir config_tile.tcl] - -# -# Work around the improper appearance of the tile scrollbars in the aqua theme -# -if {[tablelist::getCurrentTheme] eq "aqua"} { - interp alias {} ttk::scrollbar {} ::scrollbar -} - -#------------------------------------------------------------------------------ -# demo::displayChildren -# -# Displays information on the children of the widget w in a tablelist widget -# contained in a newly created top-level widget. Returns the name of the -# tablelist widget. -#------------------------------------------------------------------------------ -proc demo::displayChildren w { - if {![winfo exists $w]} { - bell - tk_messageBox -title "Error" -icon error -message \ - "Bad window path name \"$w\"" - return "" - } - - # - # Create a top-level widget of the class DemoTop - # - set top .browseTop - for {set n 2} {[winfo exists $top]} {incr n} { - set top .browseTop$n - } - toplevel $top -class DemoTop - - # - # Create a vertically scrolled tablelist widget with 9 dynamic-width - # columns and interactive sort capability within the top-level - # - set tf $top.tf - ttk::frame $tf - set tbl $tf.tbl - set vsb $tf.vsb - tablelist::tablelist $tbl \ - -columns {0 "Path Name" left - 0 "Class" left - 0 "X" right - 0 "Y" right - 0 "Width" right - 0 "Height" right - 0 "Mapped" center - 0 "Viewable" center - 0 "Manager" left} \ - -expandcommand demo::expandCmd -labelcommand demo::labelCmd \ - -yscrollcommand [list $vsb set] -setgrid no -width 0 - if {[$tbl cget -selectborderwidth] == 0} { - $tbl configure -spacing 1 - } - foreach col {2 3 4 5} { - $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 - # - foreach l [$tbl labels] { - bind $l [list demo::updateItemsDelayed $tbl] - } - bind $tbl [list demo::updateItemsDelayed $tbl] - - # - # Create a pop-up menu with two command entries; bind the script - # associated with its first entry to the event, too - # - set menu $top.menu - menu $menu -tearoff no - $menu add command -label "Display Children" \ - -command [list demo::putChildrenOfSelWidget $tbl] - $menu add command -label "Display Config" \ - -command [list demo::dispConfigOfSelWidget $tbl] - set bodyTag [$tbl bodytag] - bind $bodyTag [list demo::putChildrenOfSelWidget $tbl] - bind $bodyTag <> [bind TablelistBody ] - bind $bodyTag <> +[bind TablelistBody ] - bind $bodyTag <> +[list demo::postPopupMenu $top %X %Y] - - # - # Create three buttons within a tile frame child of the top-level widget - # - set bf $top.bf - ttk::frame $bf - set b1 $bf.b1 - set b2 $bf.b2 - set b3 $bf.b3 - ttk::button $b1 -text "Refresh" - ttk::button $b2 -text "Parent" - ttk::button $b3 -text "Close" -command [list destroy $top] - - # - # Manage the widgets - # - grid $tbl -row 0 -rowspan 2 -column 0 -sticky news - if {[tablelist::getCurrentTheme] eq "aqua"} { - grid [$tbl cornerpath] -row 0 -column 1 -sticky ew - grid $vsb -row 1 -column 1 -sticky ns - } else { - grid $vsb -row 0 -rowspan 2 -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 10 - 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 - return $tbl -} - -#------------------------------------------------------------------------------ -# demo::putChildren -# -# Outputs the data of the children of the widget w into the tablelist widget -# tbl, as child items of the one identified by nodeIdx. -#------------------------------------------------------------------------------ -proc demo::putChildren {w tbl nodeIdx} { - # - # The following check is necessary because this procedure - # is also invoked by the "Refresh" and "Parent" buttons - # - if {![winfo exists $w]} { - bell - if {[string compare $nodeIdx "root"] == 0} { - set choice [tk_messageBox -title "Error" -icon warning \ - -message "Bad window path name \"$w\" -- replacing\ - it with nearest existent ancestor" \ - -type okcancel -default ok \ - -parent [winfo toplevel $tbl]] - if {[string compare $choice "ok"] == 0} { - while {![winfo exists $w]} { - set last [string last "." $w] - if {$last != 0} { - incr last -1 - } - set w [string range $w 0 $last] - } - } else { - return "" - } - } else { - return "" - } - } - - if {[string compare $nodeIdx "root"] == 0} { - set top [winfo toplevel $tbl] - wm title $top "Children of the [winfo class $w] Widget \"$w\"" - - $tbl resetsortinfo - $tbl delete 0 end - set row 0 - } else { - set row [expr {$nodeIdx + 1}] - } - - # - # Display the data of the children of the - # widget w in the tablelist widget tbl - # - variable leafImg - variable compImg - foreach c [winfo children $w] { - # - # Insert the data of the current child into the tablelist widget - # - set item {} - lappend item \ - [winfo name $c] [winfo class $c] [winfo x $c] [winfo y $c] \ - [winfo width $c] [winfo height $c] [winfo ismapped $c] \ - [winfo viewable $c] [winfo manager $c] - $tbl insertchild $nodeIdx end $item - - # - # Insert an image into the first cell of the row; mark the - # row as collapsed if the child widget has children itself - # - if {[llength [winfo children $c]] == 0} { - $tbl cellconfigure $row,0 -image $leafImg - } else { - $tbl cellconfigure $row,0 -image $compImg - $tbl collapse $row - } - - $tbl rowattrib $row pathName $c - incr row - } - - if {[string compare $nodeIdx "root"] == 0} { - # - # Configure the "Refresh" and "Parent" buttons - # - $top.bf.b1 configure -command [list demo::refreshView $w $tbl] - set b2 $top.bf.b2 - set p [winfo parent $w] - if {[string compare $p ""] == 0} { - $b2 configure -state disabled - } else { - $b2 configure -state normal -command \ - [list demo::putChildren $p $tbl root] - } - } -} - -#------------------------------------------------------------------------------ -# demo::expandCmd -# -# Outputs the data of the children of the widget whose leaf name is displayed -# in the first cell of the specified row of the tablelist widget tbl, as child -# items of the one identified by row. -#------------------------------------------------------------------------------ -proc demo::expandCmd {tbl row} { - if {[$tbl childcount $row] == 0} { - set w [$tbl rowattrib $row pathName] - putChildren $w $tbl $row - - # - # Apply the last sorting (if any) to the new items - # - $tbl refreshsorting $row - } -} - -#------------------------------------------------------------------------------ -# demo::formatBoolean -# -# Returns "yes" or "no", according to the specified boolean value. -#------------------------------------------------------------------------------ -proc demo::formatBoolean val { - return [expr {$val ? "yes" : "no"}] -} - -#------------------------------------------------------------------------------ -# demo::labelCmd -# -# Sorts the contents of the tablelist widget tbl by its col'th column and makes -# sure the items will be updated 500 ms later (because one of the items might -# refer to a canvas containing the arrow that displays the sort order). -#------------------------------------------------------------------------------ -proc demo::labelCmd {tbl col} { - tablelist::sortByColumn $tbl $col - updateItemsDelayed $tbl -} - -#------------------------------------------------------------------------------ -# demo::updateItemsDelayed -# -# Arranges for the items of the tablelist widget tbl to be updated 500 ms later. -#------------------------------------------------------------------------------ -proc demo::updateItemsDelayed tbl { - # - # Schedule the demo::updateItems command for execution - # 500 ms later, but only if it is not yet pending - # - if {[string compare [$tbl attrib afterId] ""] == 0} { - $tbl attrib afterId [after 500 [list demo::updateItems $tbl]] - } -} - -#------------------------------------------------------------------------------ -# demo::updateItems -# -# Updates the items of the tablelist widget tbl. -#------------------------------------------------------------------------------ -proc demo::updateItems tbl { - # - # Reset the tablelist's "afterId" attribute - # - $tbl attrib afterId "" - - # - # Update the items - # - set rowCount [$tbl size] - for {set row 0} {$row < $rowCount} {incr row} { - set c [$tbl rowattrib $row pathName] - if {![winfo exists $c]} { - continue - } - - set item {} - lappend item \ - [winfo name $c] [winfo class $c] [winfo x $c] [winfo y $c] \ - [winfo width $c] [winfo height $c] [winfo ismapped $c] \ - [winfo viewable $c] [winfo manager $c] - $tbl rowconfigure $row -text $item - } - - # - # Repeat the last sort operation (if any) - # - $tbl refreshsorting -} - -#------------------------------------------------------------------------------ -# demo::putChildrenOfSelWidget -# -# Outputs the data of the children of the selected widget into the tablelist -# widget tbl. -#------------------------------------------------------------------------------ -proc demo::putChildrenOfSelWidget tbl { - set w [$tbl rowattrib [$tbl curselection] pathName] - if {![winfo exists $w]} { - bell - tk_messageBox -title "Error" -icon error -message \ - "Bad window path name \"$w\"" -parent [winfo toplevel $tbl] - return "" - } - - if {[llength [winfo children $w]] == 0} { - bell - } else { - putChildren $w $tbl root - } -} - -#------------------------------------------------------------------------------ -# demo::dispConfigOfSelWidget -# -# Displays the configuration options of the selected widget within the -# tablelist tbl in a tablelist widget contained in a newly created top-level -# widget. -#------------------------------------------------------------------------------ -proc demo::dispConfigOfSelWidget tbl { - demo::displayConfig [$tbl rowattrib [$tbl curselection] pathName] -} - -#------------------------------------------------------------------------------ -# demo::postPopupMenu -# -# Posts the pop-up menu $top.menu at the given screen position. Before posting -# the menu, the procedure enables/disables its first entry, depending upon -# whether the selected widget has children or not. -#------------------------------------------------------------------------------ -proc demo::postPopupMenu {top rootX rootY} { - set tbl $top.tf.tbl - set w [$tbl rowattrib [$tbl curselection] pathName] - if {![winfo exists $w]} { - bell - tk_messageBox -title "Error" -icon error -message \ - "Bad window path name \"$w\"" -parent $top - return "" - } - - set menu $top.menu - if {[llength [winfo children $w]] == 0} { - $menu entryconfigure 0 -state disabled - } else { - $menu entryconfigure 0 -state normal - } - - tk_popup $menu $rootX $rootY -} - -#------------------------------------------------------------------------------ -# demo::refreshView -# -# Redisplays the data of the children of the widget w in the tablelist widget -# tbl and restores the expanded states of the items as well as the vertical -# view. -#------------------------------------------------------------------------------ -proc demo::refreshView {w tbl} { - # - # Save the vertical view and get the path names of - # the child widgets displayed in the expanded rows - # - set yView [$tbl yview] - foreach key [$tbl expandedkeys] { - set pathName [$tbl rowattrib $key pathName] - set expandedWidgets($pathName) 1 - } - - # - # Redisplay the data of the widget's (possibly changed) children and - # restore the expanded states of the children, along with the vertical view - # - putChildren $w $tbl root - restoreExpandedStates $tbl root expandedWidgets - $tbl yview moveto [lindex $yView 0] -} - -#------------------------------------------------------------------------------ -# demo::restoreExpandedStates -# -# Expands those children of the parent identified by nodeIdx that display the -# data of child widgets whose path names are the names of the elements of the -# array specified by the last argument. -#------------------------------------------------------------------------------ -proc demo::restoreExpandedStates {tbl nodeIdx expandedWidgetsName} { - upvar $expandedWidgetsName expandedWidgets - - foreach key [$tbl childkeys $nodeIdx] { - set pathName [$tbl rowattrib $key pathName] - if {[info exists expandedWidgets($pathName)]} { - $tbl expand $key -partly - restoreExpandedStates $tbl $key expandedWidgets - } - } -} - -#------------------------------------------------------------------------------ - -if {$tcl_interactive} { - return "\nTo display information about the children of an arbitrary\ - widget, enter\n\n\tdemo::displayChildren \n" -} else { - wm withdraw . - tk_messageBox -title $argv0 -icon warning -message \ - "Please source this script into\nan interactive wish session" - exit 1 -} DELETED tablelist5.13/demos/browse_tile.tcl Index: tablelist5.13/demos/browse_tile.tcl ================================================================== --- tablelist5.13/demos/browse_tile.tcl +++ tablelist5.13/demos/browse_tile.tcl @@ -1,363 +0,0 @@ -#============================================================================== -# Demonstrates how to use a tablelist widget for displaying information about -# children of an arbitrary widget. -# -# Copyright (c) 2000-2015 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) -#============================================================================== - -package require tablelist_tile 5.13 - -namespace eval demo { - variable dir [file dirname [info script]] - - # - # Create two images, needed in the procedure putChildren - # - variable leafImg [image create bitmap -file [file join $dir leaf.xbm] \ - -background coral -foreground gray50] - variable compImg [image create bitmap -file [file join $dir comp.xbm] \ - -background yellow -foreground gray50] -} - -source [file join $demo::dir config_tile.tcl] - -# -# Work around the improper appearance of the tile scrollbars in the aqua theme -# -if {[tablelist::getCurrentTheme] eq "aqua"} { - interp alias {} ttk::scrollbar {} ::scrollbar -} - -#------------------------------------------------------------------------------ -# demo::displayChildren -# -# Displays information on the children of the widget w in a tablelist widget -# contained in a newly created top-level widget. Returns the name of the -# tablelist widget. -#------------------------------------------------------------------------------ -proc demo::displayChildren w { - if {![winfo exists $w]} { - bell - tk_messageBox -title "Error" -icon error -message \ - "Bad window path name \"$w\"" - return "" - } - - # - # Create a top-level widget of the class DemoTop - # - set top .browseTop - for {set n 2} {[winfo exists $top]} {incr n} { - set top .browseTop$n - } - toplevel $top -class DemoTop - - # - # Create a vertically scrolled tablelist widget with 9 dynamic-width - # columns and interactive sort capability within the top-level - # - set tf $top.tf - ttk::frame $tf - set tbl $tf.tbl - set vsb $tf.vsb - tablelist::tablelist $tbl \ - -columns {0 "Path Name" left - 0 "Class" left - 0 "X" right - 0 "Y" right - 0 "Width" right - 0 "Height" right - 0 "Mapped" center - 0 "Viewable" center - 0 "Manager" left} \ - -labelcommand demo::labelCmd -yscrollcommand [list $vsb set] -width 0 - if {[$tbl cget -selectborderwidth] == 0} { - $tbl configure -spacing 1 - } - foreach col {2 3 4 5} { - $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 - # - foreach l [$tbl labels] { - bind $l [list demo::updateItemsDelayed $tbl] - } - bind $tbl [list demo::updateItemsDelayed $tbl] - - # - # Create a pop-up menu with two command entries; bind the script - # associated with its first entry to the event, too - # - set menu $top.menu - menu $menu -tearoff no - $menu add command -label "Display Children" \ - -command [list demo::putChildrenOfSelWidget $tbl] - $menu add command -label "Display Config" \ - -command [list demo::dispConfigOfSelWidget $tbl] - set bodyTag [$tbl bodytag] - bind $bodyTag [list demo::putChildrenOfSelWidget $tbl] - bind $bodyTag <> [bind TablelistBody ] - bind $bodyTag <> +[bind TablelistBody ] - bind $bodyTag <> +[list demo::postPopupMenu $top %X %Y] - - # - # Create three buttons within a tile frame child of the top-level widget - # - set bf $top.bf - ttk::frame $bf - set b1 $bf.b1 - set b2 $bf.b2 - set b3 $bf.b3 - ttk::button $b1 -text "Refresh" - ttk::button $b2 -text "Parent" - ttk::button $b3 -text "Close" -command [list destroy $top] - - # - # Manage the widgets - # - grid $tbl -row 0 -rowspan 2 -column 0 -sticky news - if {[tablelist::getCurrentTheme] eq "aqua"} { - grid [$tbl cornerpath] -row 0 -column 1 -sticky ew - grid $vsb -row 1 -column 1 -sticky ns - } else { - grid $vsb -row 0 -rowspan 2 -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 10 - 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 - return $tbl -} - -#------------------------------------------------------------------------------ -# demo::putChildren -# -# Outputs the data of the children of the widget w into the tablelist widget -# tbl. -#------------------------------------------------------------------------------ -proc demo::putChildren {w tbl} { - # - # The following check is necessary because this procedure - # is also invoked by the "Refresh" and "Parent" buttons - # - if {![winfo exists $w]} { - bell - set choice [tk_messageBox -title "Error" -icon warning \ - -message "Bad window path name \"$w\" -- replacing\ - it with nearest existent ancestor" \ - -type okcancel -default ok -parent [winfo toplevel $tbl]] - if {[string compare $choice "ok"] == 0} { - while {![winfo exists $w]} { - set last [string last "." $w] - if {$last != 0} { - incr last -1 - } - set w [string range $w 0 $last] - } - } else { - return "" - } - } - - set top [winfo toplevel $tbl] - wm title $top "Children of the [winfo class $w] Widget \"$w\"" - - $tbl resetsortinfo - $tbl delete 0 end - - # - # Display the data of the children of the - # widget w in the tablelist widget tbl - # - variable leafImg - variable compImg - foreach c [winfo children $w] { - # - # Insert the data of the current child into the tablelist widget - # - set item {} - lappend item $c [winfo class $c] [winfo x $c] [winfo y $c] \ - [winfo width $c] [winfo height $c] [winfo ismapped $c] \ - [winfo viewable $c] [winfo manager $c] - $tbl insert end $item - - # - # Insert an image into the first cell of the row - # - if {[llength [winfo children $c]] == 0} { - $tbl cellconfigure end,0 -image $leafImg - } else { - $tbl cellconfigure end,0 -image $compImg - } - } - - # - # Configure the "Refresh" and "Parent" buttons - # - $top.bf.b1 configure -command [list demo::putChildren $w $tbl] - set b2 $top.bf.b2 - set p [winfo parent $w] - if {[string compare $p ""] == 0} { - $b2 configure -state disabled - } else { - $b2 configure -state normal -command [list demo::putChildren $p $tbl] - } -} - -#------------------------------------------------------------------------------ -# demo::formatBoolean -# -# Returns "yes" or "no", according to the specified boolean value. -#------------------------------------------------------------------------------ -proc demo::formatBoolean val { - return [expr {$val ? "yes" : "no"}] -} - -#------------------------------------------------------------------------------ -# demo::labelCmd -# -# Sorts the contents of the tablelist widget tbl by its col'th column and makes -# sure the items will be updated 500 ms later (because one of the items might -# refer to a canvas containing the arrow that displays the sort order). -#------------------------------------------------------------------------------ -proc demo::labelCmd {tbl col} { - tablelist::sortByColumn $tbl $col - updateItemsDelayed $tbl -} - -#------------------------------------------------------------------------------ -# demo::updateItemsDelayed -# -# Arranges for the items of the tablelist widget tbl to be updated 500 ms later. -#------------------------------------------------------------------------------ -proc demo::updateItemsDelayed tbl { - # - # Schedule the demo::updateItems command for execution - # 500 ms later, but only if it is not yet pending - # - if {[string compare [$tbl attrib afterId] ""] == 0} { - $tbl attrib afterId [after 500 [list demo::updateItems $tbl]] - } -} - -#------------------------------------------------------------------------------ -# demo::updateItems -# -# Updates the items of the tablelist widget tbl. -#------------------------------------------------------------------------------ -proc demo::updateItems tbl { - # - # Reset the tablelist's "afterId" attribute - # - $tbl attrib afterId "" - - # - # Update the items - # - set rowCount [$tbl size] - for {set row 0} {$row < $rowCount} {incr row} { - set c [$tbl cellcget $row,0 -text] - if {![winfo exists $c]} { - continue - } - - set item {} - lappend item $c [winfo class $c] [winfo x $c] [winfo y $c] \ - [winfo width $c] [winfo height $c] [winfo ismapped $c] \ - [winfo viewable $c] [winfo manager $c] - $tbl rowconfigure $row -text $item - } - - # - # Repeat the last sort operation (if any) - # - $tbl refreshsorting -} - -#------------------------------------------------------------------------------ -# demo::putChildrenOfSelWidget -# -# Outputs the data of the children of the selected widget into the tablelist -# widget tbl. -#------------------------------------------------------------------------------ -proc demo::putChildrenOfSelWidget tbl { - set w [$tbl cellcget [$tbl curselection],0 -text] - if {![winfo exists $w]} { - bell - tk_messageBox -title "Error" -icon error -message \ - "Bad window path name \"$w\"" -parent [winfo toplevel $tbl] - return "" - } - - if {[llength [winfo children $w]] == 0} { - bell - } else { - putChildren $w $tbl - } -} - -#------------------------------------------------------------------------------ -# demo::dispConfigOfSelWidget -# -# Displays the configuration options of the selected widget within the -# tablelist tbl in a tablelist widget contained in a newly created top-level -# widget. -#------------------------------------------------------------------------------ -proc demo::dispConfigOfSelWidget tbl { - demo::displayConfig [$tbl cellcget [$tbl curselection],0 -text] -} - -#------------------------------------------------------------------------------ -# demo::postPopupMenu -# -# Posts the pop-up menu $top.menu at the given screen position. Before posting -# the menu, the procedure enables/disables its first entry, depending upon -# whether the selected widget has children or not. -#------------------------------------------------------------------------------ -proc demo::postPopupMenu {top rootX rootY} { - set tbl $top.tf.tbl - set w [$tbl cellcget [$tbl curselection],0 -text] - if {![winfo exists $w]} { - bell - tk_messageBox -title "Error" -icon error -message \ - "Bad window path name \"$w\"" -parent $top - return "" - } - - set menu $top.menu - if {[llength [winfo children $w]] == 0} { - $menu entryconfigure 0 -state disabled - } else { - $menu entryconfigure 0 -state normal - } - - tk_popup $menu $rootX $rootY -} - -#------------------------------------------------------------------------------ - -if {$tcl_interactive} { - return "\nTo display information about the children of an arbitrary\ - widget, enter\n\n\tdemo::displayChildren \n" -} else { - wm withdraw . - tk_messageBox -title $argv0 -icon warning -message \ - "Please source this script into\nan interactive wish session" - exit 1 -} DELETED tablelist5.13/demos/bwidget.tcl Index: tablelist5.13/demos/bwidget.tcl ================================================================== --- tablelist5.13/demos/bwidget.tcl +++ tablelist5.13/demos/bwidget.tcl @@ -1,291 +0,0 @@ -#!/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-2015 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) -#============================================================================== - -package require Tk 8.4 ;# because of "-compound" -package require tablelist 5.13 -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*Checkbutton.background white -option add *Tablelist*Checkbutton.activeBackground white -option add *Tablelist*Entry.background white - -# -# Register some widgets from the BWidget package for interactive cell editing -# -tablelist::addBWidgetEntry -tablelist::addBWidgetSpinBox -tablelist::addBWidgetComboBox - -# -# 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] - -# -# Create a tablelist widget with editable columns (except the first one) -# -set tbl .tbl -tablelist::tablelist $tbl \ - -columns {0 "No." right - 0 "Available" center - 0 "Name" left - 0 "Baud Rate" right - 0 "Data Bits" center - 0 "Parity" left - 0 "Stop Bits" center - 0 "Handshake" left - 0 "Activation Date" center - 0 "Activation Time" center - 0 "Cable Color" center} \ - -editstartcommand editStartCmd -editendcommand editEndCmd \ - -height 0 -width 0 -if {[$tbl cget -selectborderwidth] == 0} { - $tbl configure -spacing 1 -} -$tbl columnconfigure 0 -sortmode integer -$tbl columnconfigure 1 -name available -editable yes -editwindow checkbutton \ - -formatcommand emptyStr -$tbl columnconfigure 2 -name lineName -editable yes -editwindow Entry \ - -sortmode dictionary -$tbl columnconfigure 3 -name baudRate -editable yes -editwindow ComboBox \ - -sortmode integer -$tbl columnconfigure 4 -name dataBits -editable yes -editwindow SpinBox -$tbl columnconfigure 5 -name parity -editable yes -editwindow ComboBox -$tbl columnconfigure 6 -name stopBits -editable yes -editwindow ComboBox -$tbl columnconfigure 7 -name handshake -editable yes -editwindow ComboBox -$tbl columnconfigure 8 -name actDate -editable yes -editwindow Entry \ - -formatcommand formatDate -sortmode integer -$tbl columnconfigure 9 -name actTime -editable yes -editwindow Entry \ - -formatcommand formatTime -sortmode integer -$tbl columnconfigure 10 -name color -editable yes -editwindow menubutton \ - -formatcommand emptyStr - -proc emptyStr val { return "" } -proc formatDate val { return [clock format $val -format "%Y-%m-%d"] } -proc formatTime val { return [clock format $val -format "%H:%M:%S"] } - -# -# Populate the tablelist widget; set the activation -# date & time to 10 minutes past the current clock value -# -set clock [expr {[clock seconds] + 600}] -for {set i 0; set n 1} {$i < 16} {set i $n; incr n} { - $tbl insert end [list $n [expr {$i < 8}] "Line $n" 9600 8 None 1 XON/XOFF \ - $clock $clock [lindex $colorNames $i]] - - set availImg [expr {($i < 8) ? "checkedImg" : "uncheckedImg"}] - $tbl cellconfigure end,available -image $availImg - $tbl cellconfigure end,color -image img[lindex $colorValues $i] -} - -set btn [button .btn -text "Close" -command exit] - -# -# Manage the widgets -# -pack $btn -side bottom -pady 10 -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] - - switch [$tbl columncget $col -name] { - lineName { - # - # Set an upper limit of 20 for the number of characters - # - $w configure -invalidcommand bell -validate key \ - -validatecommand {expr {[string length %P] <= 20}} - } - - baudRate { - # - # Populate the ComboBox and allow no more - # than 6 digits in its Entry component - # - $w configure -values {50 75 110 300 1200 2400 4800 9600 19200 38400 - 57600 115200 230400 460800 921600} - $w configure -invalidcommand bell -validate key -validatecommand \ - {expr {[string length %P] <= 6 && [regexp {^[0-9]*$} %S]}} - } - - dataBits { - # - # Configure the SpinBox - # - $w configure -range {5 8 1} -editable no - } - - parity { - # - # Populate the ComboBox and make it non-editable - # - $w configure -values {None Even Odd Mark Space} -editable no - } - - stopBits { - # - # Populate the ComboBox and make it non-editable - # - $w configure -values {1 1.5 2} -editable no - } - - handshake { - # - # Populate the ComboBox and make it non-editable - # - $w configure -values {XON/XOFF RTS/CTS None} -editable no - } - - actDate { - # - # Set an upper limit of 10 for the number of characters - # and allow only digits and the "-" character in it - # - $w configure -invalidcommand bell -validate key -validatecommand \ - {expr {[string length %P] <= 10 && [regexp {^[0-9-]*$} %S]}} - } - - actTime { - # - # Set an upper limit of 8 for the number of characters - # and allow only digits and the ":" character in it - # - $w configure -invalidcommand bell -validate key -validatecommand \ - {expr {[string length %P] <= 8 && [regexp {^[0-9:]*$} %S]}} - } - - color { - # - # Populate the menu and make sure the menubutton will display the - # color name rather than $text, which is "", due to -formatcommand - # - set menu [$w cget -menu] - foreach name $::colorNames { - $menu add radiobutton -compound left \ - -image img$::colors($name) -label $name - } - $menu entryconfigure 8 -columnbreak 1 - return [$tbl cellcget $row,$col -text] - } - } - - return $text -} - -#------------------------------------------------------------------------------ -# editEndCmd -# -# Performs a final validation of the text contained in the edit window and gets -# the cell's internal contents. -#------------------------------------------------------------------------------ -proc editEndCmd {tbl row col text} { - switch [$tbl columncget $col -name] { - available { - # - # Update the image contained in the cell - # - set img [expr {$text ? "checkedImg" : "uncheckedImg"}] - $tbl cellconfigure $row,$col -image $img - } - - baudRate { - # - # Check whether the baud rate is an integer in the range 50..921600 - # - if {![regexp {^[0-9]+$} $text] || $text < 50 || $text > 921600} { - bell - tk_messageBox -title "Error" -icon error -message \ - "The baud rate must be an integer in the range 50..921600" - $tbl rejectinput - } - } - - actDate { - # - # Get the activation date in seconds from the last argument - # - if {[catch {clock scan $text} actDate] != 0} { - bell - tk_messageBox -title "Error" -icon error -message "Invalid date" - $tbl rejectinput - return "" - } - - # - # Check whether the activation clock value is later than the - # current one; if this is the case then make sure the cells - # "actDate" and "actTime" will have the same internal value - # - set actTime [$tbl cellcget $row,actTime -text] - set actClock [clock scan [formatTime $actTime] -base $actDate] - if {$actClock <= [clock seconds]} { - bell - tk_messageBox -title "Error" -icon error -message \ - "The activation date & time must be in the future" - $tbl rejectinput - } else { - $tbl cellconfigure $row,actTime -text $actClock - return $actClock - } - } - - actTime { - # - # Get the activation clock value in seconds from the last argument - # - set actDate [$tbl cellcget $row,actDate -text] - if {[catch {clock scan $text -base $actDate} actClock] != 0} { - bell - tk_messageBox -title "Error" -icon error -message "Invalid time" - $tbl rejectinput - return "" - } - - # - # Check whether the activation clock value is later than the - # current one; if this is the case then make sure the cells - # "actDate" and "actTime" will have the same internal value - # - if {$actClock <= [clock seconds]} { - bell - tk_messageBox -title "Error" -icon error -message \ - "The activation date & time must be in the future" - $tbl rejectinput - } else { - $tbl cellconfigure $row,actDate -text $actClock - return $actClock - } - } - - color { - # - # Update the image contained in the cell - # - $tbl cellconfigure $row,$col -image img$::colors($text) - } - } - - return $text -} DELETED tablelist5.13/demos/bwidget_tile.tcl Index: tablelist5.13/demos/bwidget_tile.tcl ================================================================== --- tablelist5.13/demos/bwidget_tile.tcl +++ tablelist5.13/demos/bwidget_tile.tcl @@ -1,297 +0,0 @@ -#!/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-2015 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) -#============================================================================== - -package require tablelist_tile 5.13 -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*Checkbutton.background white -option add *Tablelist*Checkbutton.activeBackground white -option add *Tablelist*Entry.background white - -# -# Register some widgets from the BWidget package for interactive cell editing -# -tablelist::addBWidgetEntry -tablelist::addBWidgetSpinBox -tablelist::addBWidgetComboBox - -# -# 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] - -# -# Improve the window's appearance by using a tile -# frame as a container for the other widgets -# -set f [ttk::frame .f] - -# -# Create a tablelist widget with editable columns (except the first one) -# -set tbl $f.tbl -tablelist::tablelist $tbl \ - -columns {0 "No." right - 0 "Available" center - 0 "Name" left - 0 "Baud Rate" right - 0 "Data Bits" center - 0 "Parity" left - 0 "Stop Bits" center - 0 "Handshake" left - 0 "Activation Date" center - 0 "Activation Time" center - 0 "Cable Color" center} \ - -editstartcommand editStartCmd -editendcommand editEndCmd \ - -height 0 -width 0 -if {[$tbl cget -selectborderwidth] == 0} { - $tbl configure -spacing 1 -} -$tbl columnconfigure 0 -sortmode integer -$tbl columnconfigure 1 -name available -editable yes -editwindow checkbutton \ - -formatcommand emptyStr -$tbl columnconfigure 2 -name lineName -editable yes -editwindow Entry \ - -sortmode dictionary -$tbl columnconfigure 3 -name baudRate -editable yes -editwindow ComboBox \ - -sortmode integer -$tbl columnconfigure 4 -name dataBits -editable yes -editwindow SpinBox -$tbl columnconfigure 5 -name parity -editable yes -editwindow ComboBox -$tbl columnconfigure 6 -name stopBits -editable yes -editwindow ComboBox -$tbl columnconfigure 7 -name handshake -editable yes -editwindow ComboBox -$tbl columnconfigure 8 -name actDate -editable yes -editwindow Entry \ - -formatcommand formatDate -sortmode integer -$tbl columnconfigure 9 -name actTime -editable yes -editwindow Entry \ - -formatcommand formatTime -sortmode integer -$tbl columnconfigure 10 -name color -editable yes -editwindow menubutton \ - -formatcommand emptyStr - -proc emptyStr val { return "" } -proc formatDate val { return [clock format $val -format "%Y-%m-%d"] } -proc formatTime val { return [clock format $val -format "%H:%M:%S"] } - -# -# Populate the tablelist widget; set the activation -# date & time to 10 minutes past the current clock value -# -set clock [expr {[clock seconds] + 600}] -for {set i 0; set n 1} {$i < 16} {set i $n; incr n} { - $tbl insert end [list $n [expr {$i < 8}] "Line $n" 9600 8 None 1 XON/XOFF \ - $clock $clock [lindex $colorNames $i]] - - set availImg [expr {($i < 8) ? "checkedImg" : "uncheckedImg"}] - $tbl cellconfigure end,available -image $availImg - $tbl cellconfigure end,color -image img[lindex $colorValues $i] -} - -set btn [ttk::button $f.btn -text "Close" -command exit] - -# -# Manage the widgets -# -pack $btn -side bottom -pady 10 -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] - - switch [$tbl columncget $col -name] { - lineName { - # - # Set an upper limit of 20 for the number of characters - # - $w configure -invalidcommand bell -validate key \ - -validatecommand {expr {[string length %P] <= 20}} - } - - baudRate { - # - # Populate the ComboBox and allow no more - # than 6 digits in its Entry component - # - $w configure -values {50 75 110 300 1200 2400 4800 9600 19200 38400 - 57600 115200 230400 460800 921600} - $w configure -invalidcommand bell -validate key -validatecommand \ - {expr {[string length %P] <= 6 && [regexp {^[0-9]*$} %S]}} - } - - dataBits { - # - # Configure the SpinBox - # - $w configure -range {5 8 1} -editable no - } - - parity { - # - # Populate the ComboBox and make it non-editable - # - $w configure -values {None Even Odd Mark Space} -editable no - } - - stopBits { - # - # Populate the ComboBox and make it non-editable - # - $w configure -values {1 1.5 2} -editable no - } - - handshake { - # - # Populate the ComboBox and make it non-editable - # - $w configure -values {XON/XOFF RTS/CTS None} -editable no - } - - actDate { - # - # Set an upper limit of 10 for the number of characters - # and allow only digits and the "-" character in it - # - $w configure -invalidcommand bell -validate key -validatecommand \ - {expr {[string length %P] <= 10 && [regexp {^[0-9-]*$} %S]}} - } - - actTime { - # - # Set an upper limit of 8 for the number of characters - # and allow only digits and the ":" character in it - # - $w configure -invalidcommand bell -validate key -validatecommand \ - {expr {[string length %P] <= 8 && [regexp {^[0-9:]*$} %S]}} - } - - color { - # - # Populate the menu and make sure the menubutton will display the - # color name rather than $text, which is "", due to -formatcommand - # - set menu [$w cget -menu] - foreach name $::colorNames { - $menu add radiobutton -compound left \ - -image img$::colors($name) -label $name - } - $menu entryconfigure 8 -columnbreak 1 - return [$tbl cellcget $row,$col -text] - } - } - - return $text -} - -#------------------------------------------------------------------------------ -# editEndCmd -# -# Performs a final validation of the text contained in the edit window and gets -# the cell's internal contents. -#------------------------------------------------------------------------------ -proc editEndCmd {tbl row col text} { - switch [$tbl columncget $col -name] { - available { - # - # Update the image contained in the cell - # - set img [expr {$text ? "checkedImg" : "uncheckedImg"}] - $tbl cellconfigure $row,$col -image $img - } - - baudRate { - # - # Check whether the baud rate is an integer in the range 50..921600 - # - if {![regexp {^[0-9]+$} $text] || $text < 50 || $text > 921600} { - bell - tk_messageBox -title "Error" -icon error -message \ - "The baud rate must be an integer in the range 50..921600" - $tbl rejectinput - } - } - - actDate { - # - # Get the activation date in seconds from the last argument - # - if {[catch {clock scan $text} actDate] != 0} { - bell - tk_messageBox -title "Error" -icon error -message "Invalid date" - $tbl rejectinput - return "" - } - - # - # Check whether the activation clock value is later than the - # current one; if this is the case then make sure the cells - # "actDate" and "actTime" will have the same internal value - # - set actTime [$tbl cellcget $row,actTime -text] - set actClock [clock scan [formatTime $actTime] -base $actDate] - if {$actClock <= [clock seconds]} { - bell - tk_messageBox -title "Error" -icon error -message \ - "The activation date & time must be in the future" - $tbl rejectinput - } else { - $tbl cellconfigure $row,actTime -text $actClock - return $actClock - } - } - - actTime { - # - # Get the activation clock value in seconds from the last argument - # - set actDate [$tbl cellcget $row,actDate -text] - if {[catch {clock scan $text -base $actDate} actClock] != 0} { - bell - tk_messageBox -title "Error" -icon error -message "Invalid time" - $tbl rejectinput - return "" - } - - # - # Check whether the activation clock value is later than the - # current one; if this is the case then make sure the cells - # "actDate" and "actTime" will have the same internal value - # - if {$actClock <= [clock seconds]} { - bell - tk_messageBox -title "Error" -icon error -message \ - "The activation date & time must be in the future" - $tbl rejectinput - } else { - $tbl cellconfigure $row,actDate -text $actClock - return $actClock - } - } - - color { - # - # Update the image contained in the cell - # - $tbl cellconfigure $row,$col -image img$::colors($text) - } - } - - return $text -} DELETED tablelist5.13/demos/checked.gif Index: tablelist5.13/demos/checked.gif ================================================================== --- tablelist5.13/demos/checked.gif +++ tablelist5.13/demos/checked.gif cannot compute difference between binary files DELETED tablelist5.13/demos/clsdFolder.gif Index: tablelist5.13/demos/clsdFolder.gif ================================================================== --- tablelist5.13/demos/clsdFolder.gif +++ tablelist5.13/demos/clsdFolder.gif cannot compute difference between binary files DELETED tablelist5.13/demos/comp.xbm Index: tablelist5.13/demos/comp.xbm ================================================================== --- tablelist5.13/demos/comp.xbm +++ tablelist5.13/demos/comp.xbm @@ -1,5 +0,0 @@ -#define comp_width 14 -#define comp_height 12 -static unsigned char comp_bits[] = { - 0xff, 0x3f, 0x01, 0x20, 0xfd, 0x3f, 0x05, 0x20, 0xf5, 0x3f, 0x15, 0x20, - 0xd5, 0x3f, 0x55, 0x20, 0x55, 0x3f, 0x55, 0x21, 0x55, 0x21, 0xff, 0x3f}; DELETED tablelist5.13/demos/config.tcl Index: tablelist5.13/demos/config.tcl ================================================================== --- tablelist5.13/demos/config.tcl +++ tablelist5.13/demos/config.tcl @@ -1,268 +0,0 @@ -#============================================================================== -# Demonstrates how to use a tablelist widget for displaying and editing the -# configuration options of an arbitrary widget. -# -# Copyright (c) 2000-2015 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) -#============================================================================== - -package require tablelist 5.13 - -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 top-level widget of the class DemoTop: - # - # Name Class - # ----------------------------- - # tf Frame - # tbl Tabellist - # vsb, hsb Scrollbar - # bf Frame - # b1, b2, b3 Button - # - variable winSys - if {[catch {tk windowingsystem} winSys] != 0} { - switch $::tcl_platform(platform) { - unix { set winSys x11 } - windows { set winSys win32 } - macintosh { set winSys classic } - } - } - if {[string compare $winSys "x11"] == 0} { - # - # Create the font TkDefaultFont if not yet present - # - catch {font create TkDefaultFont -family Helvetica -size -12} - - option add *DemoTop*Font TkDefaultFont - option add *DemoTop*selectBackground #678db2 - option add *DemoTop*selectForeground white - } else { - option add *DemoTop.tf.borderWidth 1 - option add *DemoTop.tf.relief sunken - option add *DemoTop.tf.tbl.borderWidth 0 - option add *DemoTop.tf.tbl.highlightThickness 0 - } - option add *DemoTop.tf.tbl.background white - option add *DemoTop.tf.tbl.stripeBackground #e4e8ec - option add *DemoTop.tf.tbl.setGrid yes - option add *DemoTop.tf.tbl*Entry.background white - option add *DemoTop.bf.Button.width 10 -} - -#------------------------------------------------------------------------------ -# demo::displayConfig -# -# Displays the configuration options of the widget w in a tablelist widget -# contained in a newly created top-level widget. Returns the name of the -# tablelist widget. -#------------------------------------------------------------------------------ -proc demo::displayConfig w { - if {![winfo exists $w]} { - bell - tk_messageBox -title "Error" -icon error -message \ - "Bad window path name \"$w\"" - return "" - } - - # - # Create a top-level widget of the class DemoTop - # - set top .configTop - for {set n 2} {[winfo exists $top]} {incr n} { - set top .configTop$n - } - toplevel $top -class DemoTop - wm title $top "Configuration Options of the [winfo class $w] Widget \"$w\"" - - # - # Create a scrolled tablelist widget with 5 dynamic-width - # columns and interactive sort capability within the top-level - # - set tf $top.tf - frame $tf - set tbl $tf.tbl - set vsb $tf.vsb - set hsb $tf.hsb - tablelist::tablelist $tbl \ - -columns {0 "Command-Line Name" - 0 "Database/Alias Name" - 0 "Database Class" - 0 "Default Value" - 0 "Current Value"} \ - -labelcommand tablelist::sortByColumn -sortcommand demo::compareAsSet \ - -editendcommand demo::applyValue -height 15 -width 100 -stretch all \ - -xscrollcommand [list $hsb set] -yscrollcommand [list $vsb set] - if {[$tbl cget -selectborderwidth] == 0} { - $tbl configure -spacing 1 - } - $tbl columnconfigure 3 -maxwidth 30 - $tbl columnconfigure 4 -maxwidth 30 -editable yes - scrollbar $vsb -orient vertical -command [list $tbl yview] - scrollbar $hsb -orient horizontal -command [list $tbl xview] - - # - # Create three buttons within a frame child of the top-level widget - # - set bf $top.bf - frame $bf - set b1 $bf.b1 - set b2 $bf.b2 - set b3 $bf.b3 - button $b1 -text "Refresh" -command [list demo::putConfig $w $tbl] - button $b2 -text "Sort as Set" -command [list $tbl sort] - button $b3 -text "Close" -command [list destroy $top] - - # - # Manage the widgets - # - grid $tbl -row 0 -rowspan 2 -column 0 -sticky news - variable winSys - if {[string compare $winSys "aqua"] == 0} { - grid [$tbl cornerpath] -row 0 -column 1 -sticky ew - grid $vsb -row 1 -column 1 -sticky ns - } else { - grid $vsb -row 0 -rowspan 2 -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 10 - 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 - return $tbl -} - -#------------------------------------------------------------------------------ -# demo::putConfig -# -# Outputs the configuration options of the widget w into the tablelist widget -# tbl. -#------------------------------------------------------------------------------ -proc demo::putConfig {w tbl} { - if {![winfo exists $w]} { - bell - tk_messageBox -title "Error" -icon error -message \ - "Bad window path name \"$w\"" -parent [winfo toplevel $tbl] - return "" - } - - # - # Display the configuration options of w in the tablelist widget tbl - # - $tbl delete 0 end - foreach configSet [$w configure] { - # - # Insert the list configSet into the tablelist widget - # - $tbl insert end $configSet - - if {[llength $configSet] == 2} { - $tbl rowconfigure end -foreground gray50 -selectforeground gray75 - $tbl cellconfigure end -editable no - } else { - # - # Change the colors of the first and last cell of the row - # if the current value is different from the default one - # - set default [lindex $configSet 3] - set current [lindex $configSet 4] - if {[string compare $default $current] != 0} { - foreach col {0 4} { - $tbl cellconfigure end,$col \ - -foreground red -selectforeground yellow - } - } - } - } - - $tbl sortbycolumn 0 - $tbl activate 0 - $tbl attrib widget $w -} - -#------------------------------------------------------------------------------ -# demo::compareAsSet -# -# Compares two items of a tablelist widget used to display the configuration -# options of an arbitrary widget. The item in which the current value is -# different from the default one is considered to be less than the other; if -# both items fulfil this condition or its negation then string comparison is -# applied to the two option names. -#------------------------------------------------------------------------------ -proc demo::compareAsSet {item1 item2} { - foreach {opt1 dbName1 dbClass1 default1 current1} $item1 \ - {opt2 dbName2 dbClass2 default2 current2} $item2 { - set changed1 [expr {[string compare $default1 $current1] != 0}] - set changed2 [expr {[string compare $default2 $current2] != 0}] - if {$changed1 == $changed2} { - return [string compare $opt1 $opt2] - } elseif {$changed1} { - return -1 - } else { - return 1 - } - } -} - -#------------------------------------------------------------------------------ -# demo::applyValue -# -# Applies the new value of the configuraton option contained in the given row -# of the tablelist widget tbl to the widget whose options are displayed in it, -# and updates the colors of the first and last cell of the row. -#------------------------------------------------------------------------------ -proc demo::applyValue {tbl row col text} { - # - # Try to apply the new value of the option contained in - # the given row to the widget whose options are displayed - # in the tablelist; reject the value if the attempt fails - # - set w [$tbl attrib widget] - set opt [$tbl cellcget $row,0 -text] - if {[catch {$w configure $opt $text} result] != 0} { - bell - tk_messageBox -title "Error" -icon error -message $result \ - -parent [winfo toplevel $tbl] - $tbl rejectinput - return "" - } - - # - # Replace the new option value with its canonical form and - # update the colors of the first and last cell of the row - # - set text [$w cget $opt] - set default [$tbl cellcget $row,3 -text] - if {[string compare $default $text] == 0} { - foreach col {0 4} { - $tbl cellconfigure $row,$col \ - -foreground "" -selectforeground "" - } - } else { - foreach col {0 4} { - $tbl cellconfigure $row,$col \ - -foreground red -selectforeground yellow - } - } - - return $text -} - -#------------------------------------------------------------------------------ - -if {$tcl_interactive} { - return "\nTo display the configuration options of an arbitrary\ - widget, enter\n\n\tdemo::displayConfig \n" -} else { - wm withdraw . - tk_messageBox -title $argv0 -icon warning -message \ - "Please source this script into\nan interactive wish session" - exit 1 -} DELETED tablelist5.13/demos/config_tile.tcl Index: tablelist5.13/demos/config_tile.tcl ================================================================== --- tablelist5.13/demos/config_tile.tcl +++ tablelist5.13/demos/config_tile.tcl @@ -1,279 +0,0 @@ -#============================================================================== -# Demonstrates how to use a tablelist widget for displaying and editing the -# configuration options of an arbitrary widget. -# -# Copyright (c) 2000-2015 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) -#============================================================================== - -package require tablelist_tile 5.13 - -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 top-level widget of the class DemoTop: - # - # Name Class - # ----------------------------- - # tf TFrame - # tbl Tabellist - # vsb, hsb TScrollbar - # bf TFrame - # b1, b2, b3 TButton - # - if {[tk windowingsystem] eq "x11"} { - option add *DemoTop*Font TkDefaultFont - } else { - option add *DemoTop.tf.borderWidth 1 - option add *DemoTop.tf.relief sunken - option add *DemoTop.tf.tbl.borderWidth 0 - } - tablelist::setThemeDefaults - set foreground [winfo rgb . $tablelist::themeDefaults(-foreground)] - set selectFg [winfo rgb . $tablelist::themeDefaults(-selectforeground)] - set selectFgEqForeground [expr {$selectFg eq $foreground}] - variable currentTheme [tablelist::getCurrentTheme] - if {$currentTheme ne "aqua"} { - option add *DemoTop*selectBackground \ - $tablelist::themeDefaults(-selectbackground) - option add *DemoTop*selectForeground \ - $tablelist::themeDefaults(-selectforeground) - option add *DemoTop*selectBorderWidth \ - $tablelist::themeDefaults(-selectborderwidth) - } - option add *DemoTop.tf.tbl.background white - option add *DemoTop.tf.tbl.stripeBackground #e4e8ec - option add *DemoTop.tf.tbl.setGrid yes - option add *DemoTop.tf.tbl*Entry.background white - option add *DemoTop.bf.TButton.width 10 -} - -# -# Work around the improper appearance of the tile scrollbars in the aqua theme -# -if {$demo::currentTheme eq "aqua"} { - interp alias {} ttk::scrollbar {} ::scrollbar -} - -#------------------------------------------------------------------------------ -# demo::displayConfig -# -# Displays the configuration options of the widget w in a tablelist widget -# contained in a newly created top-level widget. Returns the name of the -# tablelist widget. -#------------------------------------------------------------------------------ -proc demo::displayConfig w { - if {![winfo exists $w]} { - bell - tk_messageBox -title "Error" -icon error -message \ - "Bad window path name \"$w\"" - return "" - } - - # - # Create a top-level widget of the class DemoTop - # - set top .configTop - for {set n 2} {[winfo exists $top]} {incr n} { - set top .configTop$n - } - toplevel $top -class DemoTop - wm title $top "Configuration Options of the [winfo class $w] Widget \"$w\"" - - # - # Create a scrolled tablelist widget with 5 dynamic-width - # columns and interactive sort capability within the top-level - # - set tf $top.tf - ttk::frame $tf - set tbl $tf.tbl - set vsb $tf.vsb - set hsb $tf.hsb - tablelist::tablelist $tbl \ - -columns {0 "Command-Line Name" - 0 "Database/Alias Name" - 0 "Database Class" - 0 "Default Value" - 0 "Current Value"} \ - -labelcommand tablelist::sortByColumn -sortcommand demo::compareAsSet \ - -editendcommand demo::applyValue -height 15 -width 100 -stretch all \ - -xscrollcommand [list $hsb set] -yscrollcommand [list $vsb set] - if {[$tbl cget -selectborderwidth] == 0} { - $tbl configure -spacing 1 - } - $tbl columnconfigure 3 -maxwidth 30 - $tbl columnconfigure 4 -maxwidth 30 -editable yes - ttk::scrollbar $vsb -orient vertical -command [list $tbl yview] - ttk::scrollbar $hsb -orient horizontal -command [list $tbl xview] - - # - # Create three buttons within a tile frame child of the top-level widget - # - set bf $top.bf - ttk::frame $bf - set b1 $bf.b1 - set b2 $bf.b2 - set b3 $bf.b3 - ttk::button $b1 -text "Refresh" -command [list demo::putConfig $w $tbl] - ttk::button $b2 -text "Sort as Set" -command [list $tbl sort] - ttk::button $b3 -text "Close" -command [list destroy $top] - - # - # Manage the widgets - # - grid $tbl -row 0 -rowspan 2 -column 0 -sticky news - if {[tablelist::getCurrentTheme] eq "aqua"} { - grid [$tbl cornerpath] -row 0 -column 1 -sticky ew - grid $vsb -row 1 -column 1 -sticky ns - } else { - grid $vsb -row 0 -rowspan 2 -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 10 - 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 - return $tbl -} - -#------------------------------------------------------------------------------ -# demo::putConfig -# -# Outputs the configuration options of the widget w into the tablelist widget -# tbl. -#------------------------------------------------------------------------------ -proc demo::putConfig {w tbl} { - if {![winfo exists $w]} { - bell - tk_messageBox -title "Error" -icon error -message \ - "Bad window path name \"$w\"" -parent [winfo toplevel $tbl] - return "" - } - - # - # Display the configuration options of w in the tablelist widget tbl - # - $tbl delete 0 end - foreach configSet [$w configure] { - # - # Insert the list configSet into the tablelist widget - # - $tbl insert end $configSet - - if {[llength $configSet] == 2} { - $tbl rowconfigure end -foreground gray50 -selectforeground gray75 - $tbl cellconfigure end -editable no - } else { - # - # Change the colors of the first and last cell of the row - # if the current value is different from the default one - # - set default [lindex $configSet 3] - set current [lindex $configSet 4] - if {[string compare $default $current] != 0} { - foreach col {0 4} { - $tbl cellconfigure end,$col -foreground red - if {$demo::selectFgEqForeground} { - $tbl cellconfigure end,$col -selectforeground red - } else { - $tbl cellconfigure end,$col -selectforeground yellow - } - } - } - } - } - - $tbl sortbycolumn 0 - $tbl activate 0 - $tbl attrib widget $w -} - -#------------------------------------------------------------------------------ -# demo::compareAsSet -# -# Compares two items of a tablelist widget used to display the configuration -# options of an arbitrary widget. The item in which the current value is -# different from the default one is considered to be less than the other; if -# both items fulfil this condition or its negation then string comparison is -# applied to the two option names. -#------------------------------------------------------------------------------ -proc demo::compareAsSet {item1 item2} { - foreach {opt1 dbName1 dbClass1 default1 current1} $item1 \ - {opt2 dbName2 dbClass2 default2 current2} $item2 { - set changed1 [expr {[string compare $default1 $current1] != 0}] - set changed2 [expr {[string compare $default2 $current2] != 0}] - if {$changed1 == $changed2} { - return [string compare $opt1 $opt2] - } elseif {$changed1} { - return -1 - } else { - return 1 - } - } -} - -#------------------------------------------------------------------------------ -# demo::applyValue -# -# Applies the new value of the configuraton option contained in the given row -# of the tablelist widget tbl to the widget whose options are displayed in it, -# and updates the colors of the first and last cell of the row. -#------------------------------------------------------------------------------ -proc demo::applyValue {tbl row col text} { - # - # Try to apply the new value of the option contained in - # the given row to the widget whose options are displayed - # in the tablelist; reject the value if the attempt fails - # - set w [$tbl attrib widget] - set opt [$tbl cellcget $row,0 -text] - if {[catch {$w configure $opt $text} result] != 0} { - bell - tk_messageBox -title "Error" -icon error -message $result \ - -parent [winfo toplevel $tbl] - $tbl rejectinput - return "" - } - - # - # Replace the new option value with its canonical form and - # update the colors of the first and last cell of the row - # - set text [$w cget $opt] - set default [$tbl cellcget $row,3 -text] - if {[string compare $default $text] == 0} { - foreach col {0 4} { - $tbl cellconfigure $row,$col \ - -foreground "" -selectforeground "" - } - } else { - foreach col {0 4} { - $tbl cellconfigure $row,$col -foreground red - if {$demo::selectFgEqForeground} { - $tbl cellconfigure $row,$col -selectforeground red - } else { - $tbl cellconfigure $row,$col -selectforeground yellow - } - } - } - - return $text -} - -#------------------------------------------------------------------------------ - -if {$tcl_interactive} { - return "\nTo display the configuration options of an arbitrary\ - widget, enter\n\n\tdemo::displayConfig \n" -} else { - wm withdraw . - tk_messageBox -title $argv0 -icon warning -message \ - "Please source this script into\nan interactive wish session" - exit 1 -} DELETED tablelist5.13/demos/dirViewer.tcl Index: tablelist5.13/demos/dirViewer.tcl ================================================================== --- tablelist5.13/demos/dirViewer.tcl +++ tablelist5.13/demos/dirViewer.tcl @@ -1,397 +0,0 @@ -#!/usr/bin/env wish - -#============================================================================== -# Demonstrates how to use a tablelist widget for displaying the contents of a -# directory. -# -# Copyright (c) 2010-2015 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) -#============================================================================== - -package require Tk 8.3 -package require tablelist 5.13 - -# -# Add some entries to the Tk option database -# -set dir [file dirname [info script]] -source [file join $dir option.tcl] - -# -# Create three images -# -image create photo clsdFolderImg -file [file join $dir clsdFolder.gif] -image create photo openFolderImg -file [file join $dir openFolder.gif] -image create photo fileImg -file [file join $dir file.gif] - -#------------------------------------------------------------------------------ -# displayContents -# -# Displays the contents of the directory dir in a tablelist widget. -#------------------------------------------------------------------------------ -proc displayContents dir { - # - # Create a scrolled tablelist widget with 3 dynamic- - # width columns and interactive sort capability - # - set tf .tf - frame $tf -class ScrollArea - set tbl $tf.tbl - set vsb $tf.vsb - set hsb $tf.hsb - tablelist::tablelist $tbl \ - -columns {0 "Name" left - 0 "Size" right - 0 "Date Modified" left} \ - -expandcommand expandCmd -collapsecommand collapseCmd \ - -xscrollcommand [list $hsb set] -yscrollcommand [list $vsb set] \ - -movablecolumns no -setgrid no -showseparators yes -height 18 -width 80 - if {[$tbl cget -selectborderwidth] == 0} { - $tbl configure -spacing 1 - } - $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] - - # - # Create a pop-up menu with one command entry; bind the script - # associated with its entry to the event, too - # - set menu .menu - menu $menu -tearoff no - $menu add command -label "Display Contents" \ - -command [list putContentsOfSelFolder $tbl] - set bodyTag [$tbl bodytag] - bind $bodyTag <> [bind TablelistBody ] - bind $bodyTag <> +[bind TablelistBody ] - bind $bodyTag <> +[list postPopupMenu %X %Y] - bind $bodyTag [list putContentsOfSelFolder $tbl] - - # - # Create three buttons within a frame child of the main widget - # - set bf .bf - frame $bf - set b1 $bf.b1 - set b2 $bf.b2 - set b3 $bf.b3 - button $b1 -width 10 -text "Refresh" - button $b2 -width 10 -text "Parent" - button $b3 -width 10 -text "Close" -command exit - - # - # Manage the widgets - # - grid $tbl -row 0 -rowspan 2 -column 0 -sticky news - global winSys - if {[string compare $winSys "aqua"] == 0} { - grid [$tbl cornerpath] -row 0 -column 1 -sticky ew - grid $vsb -row 1 -column 1 -sticky ns - } else { - grid $vsb -row 0 -rowspan 2 -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 10 - pack $bf -side bottom -fill x - pack $tf -side top -expand yes -fill both - - # - # Populate the tablelist with the contents of the given directory - # - $tbl sortbycolumn 0 - putContents $dir $tbl root -} - -#------------------------------------------------------------------------------ -# putContents -# -# Outputs the contents of the directory dir into the tablelist widget tbl, as -# child items of the one identified by nodeIdx. -#------------------------------------------------------------------------------ -proc putContents {dir tbl nodeIdx} { - # - # The following check is necessary because this procedure - # is also invoked by the "Refresh" and "Parent" buttons - # - if {[string compare $dir ""] != 0 && - (![file isdirectory $dir] || ![file readable $dir])} { - bell - if {[string compare $nodeIdx "root"] == 0} { - set choice [tk_messageBox -title "Error" -icon warning -message \ - "Cannot read directory \"[file nativename $dir]\"\ - -- replacing it with nearest existent ancestor" \ - -type okcancel -default ok] - if {[string compare $choice "ok"] == 0} { - while {![file isdirectory $dir] || ![file readable $dir]} { - set dir [file dirname $dir] - } - } else { - return "" - } - } else { - return "" - } - } - - if {[string compare $nodeIdx "root"] == 0} { - if {[string compare $dir ""] == 0} { - if {[llength [file volumes]] == 1} { - wm title . "Contents of the File System" - } else { - wm title . "Contents of the File Systems" - } - } else { - wm title . "Contents of the Directory \"[file nativename $dir]\"" - } - - $tbl delete 0 end - set row 0 - } else { - set row [expr {$nodeIdx + 1}] - } - - # - # Build a list from the data of the subdirectories and - # files of the directory dir. Prepend a "D" or "F" to - # each entry's name and modification date & time, for - # sorting purposes (it will be removed by formatString). - # - set itemList {} - if {[string compare $dir ""] == 0} { - foreach volume [file volumes] { - lappend itemList [list D[file nativename $volume] -1 D $volume] - } - } else { - foreach entry [glob -nocomplain -types {d f} -directory $dir *] { - if {[catch {file mtime $entry} modTime] != 0} { - continue - } - - if {[file isdirectory $entry]} { - lappend itemList [list D[file tail $entry] -1 \ - D[clock format $modTime -format "%Y-%m-%d %H:%M"] $entry] - } else { - lappend itemList [list F[file tail $entry] [file size $entry] \ - F[clock format $modTime -format "%Y-%m-%d %H:%M"] ""] - } - } - } - - # - # Sort the above list and insert it into the tablelist widget - # tbl as list of children of the row identified by nodeIdx - # - set itemList [$tbl applysorting $itemList] - $tbl insertchildlist $nodeIdx end $itemList - - # - # Insert an image into the first cell of each newly inserted row - # - foreach item $itemList { - set name [lindex $item end] - if {[string compare $name ""] == 0} { ;# file - $tbl cellconfigure $row,0 -image fileImg - } else { ;# directory - $tbl cellconfigure $row,0 -image clsdFolderImg - $tbl rowattrib $row pathName $name - - # - # Mark the row as collapsed if the directory is non-empty - # - if {[file readable $name] && [llength \ - [glob -nocomplain -types {d f} -directory $name *]] != 0} { - $tbl collapse $row - } - } - - incr row - } - - if {[string compare $nodeIdx "root"] == 0} { - # - # Configure the "Refresh" and "Parent" buttons - # - .bf.b1 configure -command [list refreshView $dir $tbl] - set b2 .bf.b2 - if {[string compare $dir ""] == 0} { - $b2 configure -state disabled - } else { - $b2 configure -state normal - set p [file dirname $dir] - if {[string compare $p $dir] == 0} { - $b2 configure -command [list putContents "" $tbl root] - } else { - $b2 configure -command [list putContents $p $tbl root] - } - } - } -} - -#------------------------------------------------------------------------------ -# formatString -# -# Returns the substring obtained from the specified value by removing its first -# character. -#------------------------------------------------------------------------------ -proc formatString val { - return [string range $val 1 end] -} - -#------------------------------------------------------------------------------ -# formatSize -# -# Returns an empty string if the specified value is negative and the value -# itself in user-friendly format otherwise. -#------------------------------------------------------------------------------ -proc formatSize val { - if {$val < 0} { - return "" - } elseif {$val < 1024} { - return "$val bytes" - } elseif {$val < 1048576} { - return [format "%.1f KB" [expr {$val / 1024.0}]] - } elseif {$val < 1073741824} { - return [format "%.1f MB" [expr {$val / 1048576.0}]] - } else { - return [format "%.1f GB" [expr {$val / 1073741824.0}]] - } -} - -#------------------------------------------------------------------------------ -# expandCmd -# -# Outputs the contents of the directory whose leaf name is displayed in the -# first cell of the specified row of the tablelist widget tbl, as child items -# of the one identified by row, and updates the image displayed in that cell. -#------------------------------------------------------------------------------ -proc expandCmd {tbl row} { - if {[$tbl childcount $row] == 0} { - set dir [$tbl rowattrib $row pathName] - putContents $dir $tbl $row - } - - if {[$tbl childcount $row] != 0} { - $tbl cellconfigure $row,0 -image openFolderImg - } -} - -#------------------------------------------------------------------------------ -# collapseCmd -# -# Updates the image displayed in the first cell of the specified row of the -# tablelist widget tbl. -#------------------------------------------------------------------------------ -proc collapseCmd {tbl row} { - $tbl cellconfigure $row,0 -image clsdFolderImg -} - -#------------------------------------------------------------------------------ -# putContentsOfSelFolder -# -# Outputs the contents of the selected folder into the tablelist widget tbl. -#------------------------------------------------------------------------------ -proc putContentsOfSelFolder tbl { - set row [$tbl curselection] - if {[$tbl hasrowattrib $row pathName]} { ;# directory item - set dir [$tbl rowattrib $row pathName] - if {[file isdirectory $dir] && [file readable $dir]} { - if {[llength [glob -nocomplain -types {d f} -directory $dir *]] - == 0} { - bell - } else { - putContents $dir $tbl root - } - } else { - bell - tk_messageBox -title "Error" -icon error -message \ - "Cannot read directory \"[file nativename $dir]\"" - return "" - } - } else { ;# file item - bell - } -} - -#------------------------------------------------------------------------------ -# postPopupMenu -# -# Posts the pop-up menu .menu at the given screen position. Before posting -# the menu, the procedure enables/disables its only entry, depending upon -# whether the selected item represents a readable directory or not. -#------------------------------------------------------------------------------ -proc postPopupMenu {rootX rootY} { - set tbl .tf.tbl - set row [$tbl curselection] - set menu .menu - if {[$tbl hasrowattrib $row pathName]} { ;# directory item - set dir [$tbl rowattrib $row pathName] - if {[file isdirectory $dir] && [file readable $dir]} { - if {[llength [glob -nocomplain -types {d f} -directory $dir *]] - == 0} { - $menu entryconfigure 0 -state disabled - } else { - $menu entryconfigure 0 -state normal - } - } else { - bell - tk_messageBox -title "Error" -icon error -message \ - "Cannot read directory \"[file nativename $dir]\"" - return "" - } - } else { ;# file item - $menu entryconfigure 0 -state disabled - } - - tk_popup $menu $rootX $rootY -} - -#------------------------------------------------------------------------------ -# refreshView -# -# Redisplays the contents of the directory dir in the tablelist widget tbl and -# restores the expanded states of the folders as well as the vertical view. -#------------------------------------------------------------------------------ -proc refreshView {dir tbl} { - # - # Save the vertical view and get the path names - # of the folders displayed in the expanded rows - # - set yView [$tbl yview] - foreach key [$tbl expandedkeys] { - set pathName [$tbl rowattrib $key pathName] - set expandedFolders($pathName) 1 - } - - # - # Redisplay the directory's (possibly changed) contents and restore - # the expanded states of the folders, along with the vertical view - # - putContents $dir $tbl root - restoreExpandedStates $tbl root expandedFolders - $tbl yview moveto [lindex $yView 0] -} - -#------------------------------------------------------------------------------ -# restoreExpandedStates -# -# Expands those children of the parent identified by nodeIdx that display -# folders whose path names are the names of the elements of the array specified -# by the last argument. -#------------------------------------------------------------------------------ -proc restoreExpandedStates {tbl nodeIdx expandedFoldersName} { - upvar $expandedFoldersName expandedFolders - - foreach key [$tbl childkeys $nodeIdx] { - set pathName [$tbl rowattrib $key pathName] - if {[string compare $pathName ""] != 0 && - [info exists expandedFolders($pathName)]} { - $tbl expand $key -partly - restoreExpandedStates $tbl $key expandedFolders - } - } -} - -displayContents "" DELETED tablelist5.13/demos/dirViewer_tile.tcl Index: tablelist5.13/demos/dirViewer_tile.tcl ================================================================== --- tablelist5.13/demos/dirViewer_tile.tcl +++ tablelist5.13/demos/dirViewer_tile.tcl @@ -1,402 +0,0 @@ -#!/usr/bin/env wish - -#============================================================================== -# Demonstrates how to use a tablelist widget for displaying the contents of a -# directory. -# -# Copyright (c) 2010-2015 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) -#============================================================================== - -package require tablelist_tile 5.13 - -# -# Add some entries to the Tk option database -# -set dir [file dirname [info script]] -source [file join $dir option_tile.tcl] - -# -# Create three images -# -image create photo clsdFolderImg -file [file join $dir clsdFolder.gif] -image create photo openFolderImg -file [file join $dir openFolder.gif] -image create photo fileImg -file [file join $dir file.gif] - -# -# Work around the improper appearance of the tile scrollbars in the aqua theme -# -if {[tablelist::getCurrentTheme] eq "aqua"} { - interp alias {} ttk::scrollbar {} ::scrollbar -} - -#------------------------------------------------------------------------------ -# displayContents -# -# Displays the contents of the directory dir in a tablelist widget. -#------------------------------------------------------------------------------ -proc displayContents dir { - # - # Create a scrolled tablelist widget with 3 dynamic- - # width columns and interactive sort capability - # - set tf .tf - ttk::frame $tf -class ScrollArea - set tbl $tf.tbl - set vsb $tf.vsb - set hsb $tf.hsb - tablelist::tablelist $tbl \ - -columns {0 "Name" left - 0 "Size" right - 0 "Date Modified" left} \ - -expandcommand expandCmd -collapsecommand collapseCmd \ - -xscrollcommand [list $hsb set] -yscrollcommand [list $vsb set] \ - -movablecolumns no -setgrid no -showseparators yes -height 18 -width 80 - if {[$tbl cget -selectborderwidth] == 0} { - $tbl configure -spacing 1 - } - $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] - - # - # Create a pop-up menu with one command entry; bind the script - # associated with its entry to the event, too - # - set menu .menu - menu $menu -tearoff no - $menu add command -label "Display Contents" \ - -command [list putContentsOfSelFolder $tbl] - set bodyTag [$tbl bodytag] - bind $bodyTag <> [bind TablelistBody ] - bind $bodyTag <> +[bind TablelistBody ] - bind $bodyTag <> +[list postPopupMenu %X %Y] - bind $bodyTag [list putContentsOfSelFolder $tbl] - - # - # Create three buttons within a frame child of the main widget - # - set bf .bf - ttk::frame $bf - set b1 $bf.b1 - set b2 $bf.b2 - set b3 $bf.b3 - ttk::button $b1 -width 10 -text "Refresh" - ttk::button $b2 -width 10 -text "Parent" - ttk::button $b3 -width 10 -text "Close" -command exit - - # - # Manage the widgets - # - grid $tbl -row 0 -rowspan 2 -column 0 -sticky news - if {[tablelist::getCurrentTheme] eq "aqua"} { - grid [$tbl cornerpath] -row 0 -column 1 -sticky ew - grid $vsb -row 1 -column 1 -sticky ns - } else { - grid $vsb -row 0 -rowspan 2 -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 10 - pack $bf -side bottom -fill x - pack $tf -side top -expand yes -fill both - - # - # Populate the tablelist with the contents of the given directory - # - $tbl sortbycolumn 0 - putContents $dir $tbl root -} - -#------------------------------------------------------------------------------ -# putContents -# -# Outputs the contents of the directory dir into the tablelist widget tbl, as -# child items of the one identified by nodeIdx. -#------------------------------------------------------------------------------ -proc putContents {dir tbl nodeIdx} { - # - # The following check is necessary because this procedure - # is also invoked by the "Refresh" and "Parent" buttons - # - if {[string compare $dir ""] != 0 && - (![file isdirectory $dir] || ![file readable $dir])} { - bell - if {[string compare $nodeIdx "root"] == 0} { - set choice [tk_messageBox -title "Error" -icon warning -message \ - "Cannot read directory \"[file nativename $dir]\"\ - -- replacing it with nearest existent ancestor" \ - -type okcancel -default ok] - if {[string compare $choice "ok"] == 0} { - while {![file isdirectory $dir] || ![file readable $dir]} { - set dir [file dirname $dir] - } - } else { - return "" - } - } else { - return "" - } - } - - if {[string compare $nodeIdx "root"] == 0} { - if {[string compare $dir ""] == 0} { - if {[llength [file volumes]] == 1} { - wm title . "Contents of the File System" - } else { - wm title . "Contents of the File Systems" - } - } else { - wm title . "Contents of the Directory \"[file nativename $dir]\"" - } - - $tbl delete 0 end - set row 0 - } else { - set row [expr {$nodeIdx + 1}] - } - - # - # Build a list from the data of the subdirectories and - # files of the directory dir. Prepend a "D" or "F" to - # each entry's name and modification date & time, for - # sorting purposes (it will be removed by formatString). - # - set itemList {} - if {[string compare $dir ""] == 0} { - foreach volume [file volumes] { - lappend itemList [list D[file nativename $volume] -1 D $volume] - } - } else { - foreach entry [glob -nocomplain -types {d f} -directory $dir *] { - if {[catch {file mtime $entry} modTime] != 0} { - continue - } - - if {[file isdirectory $entry]} { - lappend itemList [list D[file tail $entry] -1 \ - D[clock format $modTime -format "%Y-%m-%d %H:%M"] $entry] - } else { - lappend itemList [list F[file tail $entry] [file size $entry] \ - F[clock format $modTime -format "%Y-%m-%d %H:%M"] ""] - } - } - } - - # - # Sort the above list and insert it into the tablelist widget - # tbl as list of children of the row identified by nodeIdx - # - set itemList [$tbl applysorting $itemList] - $tbl insertchildlist $nodeIdx end $itemList - - # - # Insert an image into the first cell of each newly inserted row - # - foreach item $itemList { - set name [lindex $item end] - if {[string compare $name ""] == 0} { ;# file - $tbl cellconfigure $row,0 -image fileImg - } else { ;# directory - $tbl cellconfigure $row,0 -image clsdFolderImg - $tbl rowattrib $row pathName $name - - # - # Mark the row as collapsed if the directory is non-empty - # - if {[file readable $name] && [llength \ - [glob -nocomplain -types {d f} -directory $name *]] != 0} { - $tbl collapse $row - } - } - - incr row - } - - if {[string compare $nodeIdx "root"] == 0} { - # - # Configure the "Refresh" and "Parent" buttons - # - .bf.b1 configure -command [list refreshView $dir $tbl] - set b2 .bf.b2 - if {[string compare $dir ""] == 0} { - $b2 configure -state disabled - } else { - $b2 configure -state normal - set p [file dirname $dir] - if {[string compare $p $dir] == 0} { - $b2 configure -command [list putContents "" $tbl root] - } else { - $b2 configure -command [list putContents $p $tbl root] - } - } - } -} - -#------------------------------------------------------------------------------ -# formatString -# -# Returns the substring obtained from the specified value by removing its first -# character. -#------------------------------------------------------------------------------ -proc formatString val { - return [string range $val 1 end] -} - -#------------------------------------------------------------------------------ -# formatSize -# -# Returns an empty string if the specified value is negative and the value -# itself in user-friendly format otherwise. -#------------------------------------------------------------------------------ -proc formatSize val { - if {$val < 0} { - return "" - } elseif {$val < 1024} { - return "$val bytes" - } elseif {$val < 1048576} { - return [format "%.1f KB" [expr {$val / 1024.0}]] - } elseif {$val < 1073741824} { - return [format "%.1f MB" [expr {$val / 1048576.0}]] - } else { - return [format "%.1f GB" [expr {$val / 1073741824.0}]] - } -} - -#------------------------------------------------------------------------------ -# expandCmd -# -# Outputs the contents of the directory whose leaf name is displayed in the -# first cell of the specified row of the tablelist widget tbl, as child items -# of the one identified by row, and updates the image displayed in that cell. -#------------------------------------------------------------------------------ -proc expandCmd {tbl row} { - if {[$tbl childcount $row] == 0} { - set dir [$tbl rowattrib $row pathName] - putContents $dir $tbl $row - } - - if {[$tbl childcount $row] != 0} { - $tbl cellconfigure $row,0 -image openFolderImg - } -} - -#------------------------------------------------------------------------------ -# collapseCmd -# -# Updates the image displayed in the first cell of the specified row of the -# tablelist widget tbl. -#------------------------------------------------------------------------------ -proc collapseCmd {tbl row} { - $tbl cellconfigure $row,0 -image clsdFolderImg -} - -#------------------------------------------------------------------------------ -# putContentsOfSelFolder -# -# Outputs the contents of the selected folder into the tablelist widget tbl. -#------------------------------------------------------------------------------ -proc putContentsOfSelFolder tbl { - set row [$tbl curselection] - if {[$tbl hasrowattrib $row pathName]} { ;# directory item - set dir [$tbl rowattrib $row pathName] - if {[file isdirectory $dir] && [file readable $dir]} { - if {[llength [glob -nocomplain -types {d f} -directory $dir *]] - == 0} { - bell - } else { - putContents $dir $tbl root - } - } else { - bell - tk_messageBox -title "Error" -icon error -message \ - "Cannot read directory \"[file nativename $dir]\"" - return "" - } - } else { ;# file item - bell - } -} - -#------------------------------------------------------------------------------ -# postPopupMenu -# -# Posts the pop-up menu .menu at the given screen position. Before posting -# the menu, the procedure enables/disables its only entry, depending upon -# whether the selected item represents a readable directory or not. -#------------------------------------------------------------------------------ -proc postPopupMenu {rootX rootY} { - set tbl .tf.tbl - set row [$tbl curselection] - set menu .menu - if {[$tbl hasrowattrib $row pathName]} { ;# directory item - set dir [$tbl rowattrib $row pathName] - if {[file isdirectory $dir] && [file readable $dir]} { - if {[llength [glob -nocomplain -types {d f} -directory $dir *]] - == 0} { - $menu entryconfigure 0 -state disabled - } else { - $menu entryconfigure 0 -state normal - } - } else { - bell - tk_messageBox -title "Error" -icon error -message \ - "Cannot read directory \"[file nativename $dir]\"" - return "" - } - } else { ;# file item - $menu entryconfigure 0 -state disabled - } - - tk_popup $menu $rootX $rootY -} - -#------------------------------------------------------------------------------ -# refreshView -# -# Redisplays the contents of the directory dir in the tablelist widget tbl and -# restores the expanded states of the folders as well as the vertical view. -#------------------------------------------------------------------------------ -proc refreshView {dir tbl} { - # - # Save the vertical view and get the path names - # of the folders displayed in the expanded rows - # - set yView [$tbl yview] - foreach key [$tbl expandedkeys] { - set pathName [$tbl rowattrib $key pathName] - set expandedFolders($pathName) 1 - } - - # - # Redisplay the directory's (possibly changed) contents and restore - # the expanded states of the folders, along with the vertical view - # - putContents $dir $tbl root - restoreExpandedStates $tbl root expandedFolders - $tbl yview moveto [lindex $yView 0] -} - -#------------------------------------------------------------------------------ -# restoreExpandedStates -# -# Expands those children of the parent identified by nodeIdx that display -# folders whose path names are the names of the elements of the array specified -# by the last argument. -#------------------------------------------------------------------------------ -proc restoreExpandedStates {tbl nodeIdx expandedFoldersName} { - upvar $expandedFoldersName expandedFolders - - foreach key [$tbl childkeys $nodeIdx] { - set pathName [$tbl rowattrib $key pathName] - if {[string compare $pathName ""] != 0 && - [info exists expandedFolders($pathName)]} { - $tbl expand $key -partly - restoreExpandedStates $tbl $key expandedFolders - } - } -} - -displayContents "" DELETED tablelist5.13/demos/embeddedWindows.tcl Index: tablelist5.13/demos/embeddedWindows.tcl ================================================================== --- tablelist5.13/demos/embeddedWindows.tcl +++ tablelist5.13/demos/embeddedWindows.tcl @@ -1,194 +0,0 @@ -#!/usr/bin/env wish - -#============================================================================== -# Demonstrates the use of embedded windows in tablelist widgets. -# -# Copyright (c) 2004-2015 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) -#============================================================================== - -package require tablelist 5.13 - -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 to be displayed in buttons embedded in a tablelist widget -# -image create photo openImg -file [file join $dir open.gif] - -# -# Create a vertically scrolled tablelist widget with 5 -# dynamic-width columns and interactive sort capability -# -set tf .tf -frame $tf -class ScrollArea -set tbl $tf.tbl -set vsb $tf.vsb -tablelist::tablelist $tbl \ - -columns {0 "File Name" left - 0 "Bar Chart" center - 0 "File Size" right - 0 "View" center - 0 "Seen" center} \ - -setgrid no -yscrollcommand [list $vsb set] -width 0 -if {[$tbl cget -selectborderwidth] == 0} { - $tbl configure -spacing 1 -} -$tbl columnconfigure 0 -name fileName -$tbl columnconfigure 1 -formatcommand emptyStr -sortmode integer -$tbl columnconfigure 2 -name fileSize -sortmode integer -$tbl columnconfigure 4 -name seen -scrollbar $vsb -orient vertical -command [list $tbl yview] - -proc emptyStr val { return "" } - -eval font create BoldFont [font actual [$tbl cget -font]] -weight bold - -# -# Populate the tablelist widget -# -cd $tk_library -set maxFileSize 0 -foreach fileName [lsort [glob *.tcl]] { - set fileSize [file size $fileName] - $tbl insert end [list $fileName $fileSize $fileSize "" no] - - if {$fileSize > $maxFileSize} { - set maxFileSize $fileSize - } -} - -#------------------------------------------------------------------------------ -# createFrame -# -# Creates a frame widget w to be embedded into the specified cell of the -# tablelist widget tbl, as well as a child frame representing the size of the -# 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 - # - frame $w -width 102 -height 14 -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 -height 12 -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 -relwidth [expr {double($fileSize) / $::maxFileSize}] -} - -#------------------------------------------------------------------------------ -# createButton -# -# Creates a button widget w to be embedded into the specified cell of the -# tablelist widget tbl. -#------------------------------------------------------------------------------ -proc createButton {tbl row col w} { - set key [$tbl getkeys $row] - button $w -image openImg -highlightthickness 0 -takefocus 0 \ - -command [list viewFile $tbl $key] -} - -#------------------------------------------------------------------------------ -# viewFile -# -# Displays the contents of the file whose name is contained in the row with the -# given key of the tablelist widget tbl. -#------------------------------------------------------------------------------ -proc viewFile {tbl key} { - set top .top$key - if {[winfo exists $top]} { - raise $top - return "" - } - - toplevel $top - set fileName [$tbl cellcget k$key,fileName -text] - wm title $top "File \"$fileName\"" - - # - # Create a vertically scrolled text widget as a grandchild of the toplevel - # - set tf $top.tf - frame $tf -class ScrollArea - set txt $tf.txt - set vsb $tf.vsb - text $txt -background white -font TkFixedFont -setgrid yes \ - -yscrollcommand [list $vsb set] - catch {$txt configure -tabstyle wordprocessor} ;# for Tk 8.5 and above - scrollbar $vsb -orient vertical -command [list $txt yview] - - # - # Insert the file's contents into the text widget - # - set chan [open $fileName] - $txt insert end [read $chan] - close $chan - - set btn [button $top.btn -text "Close" -command [list destroy $top]] - - # - # 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 10 - 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 -} - -#------------------------------------------------------------------------------ - -# -# Create embedded windows in the columns no. 1 and 3 -# -set rowCount [$tbl size] -for {set row 0} {$row < $rowCount} {incr row} { - $tbl cellconfigure $row,1 -window createFrame -stretchwindow yes - $tbl cellconfigure $row,3 -window createButton -} - -set btn [button .btn -text "Close" -command exit] - -# -# Manage the widgets -# -grid $tbl -row 0 -rowspan 2 -column 0 -sticky news -if {[string compare $winSys "aqua"] == 0} { - grid [$tbl cornerpath] -row 0 -column 1 -sticky ew - grid $vsb -row 1 -column 1 -sticky ns -} else { - grid $vsb -row 0 -rowspan 2 -column 1 -sticky ns -} -grid rowconfigure $tf 1 -weight 1 -grid columnconfigure $tf 0 -weight 1 -pack $btn -side bottom -pady 10 -pack $tf -side top -expand yes -fill both DELETED tablelist5.13/demos/embeddedWindows_tile.tcl Index: tablelist5.13/demos/embeddedWindows_tile.tcl ================================================================== --- tablelist5.13/demos/embeddedWindows_tile.tcl +++ tablelist5.13/demos/embeddedWindows_tile.tcl @@ -1,229 +0,0 @@ -#!/usr/bin/env wish - -#============================================================================== -# Demonstrates the use of embedded windows in tablelist widgets. -# -# Copyright (c) 2004-2015 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) -#============================================================================== - -package require tablelist_tile 5.13 - -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 to be displayed in buttons embedded in a tablelist widget -# -image create photo openImg -file [file join $dir open.gif] - -if {[tablelist::getCurrentTheme] eq "aqua"} { - # - # Work around the improper appearance of the tile scrollbars - # - interp alias {} ttk::scrollbar {} ::scrollbar -} else { - # - # Make the embedded buttons as small as possible. Recall that in most - # themes, the tile buttons consist of the following element hierarchy: - # - # Button.border - # Button.focus (one of its options is -focusthickness) - # Button.padding (two of its options are -padding and -shiftrelief) - # Button.label - # - if {[info commands "::ttk::style"] ne ""} { - interp alias {} styleConfig {} ttk::style configure - } elseif {[string compare $tile::version "0.7"] >= 0} { - interp alias {} styleConfig {} style configure - } else { - interp alias {} styleConfig {} style default - } - styleConfig Embedded.TButton -focusthickness 0 -padding 0 -shiftrelief 0 -} - -# -# Create a vertically scrolled tablelist widget with 5 -# dynamic-width columns and interactive sort capability -# -set tf .tf -ttk::frame $tf -class ScrollArea -set tbl $tf.tbl -set vsb $tf.vsb -tablelist::tablelist $tbl \ - -columns {0 "File Name" left - 0 "Bar Chart" center - 0 "File Size" right - 0 "View" center - 0 "Seen" center} \ - -setgrid no -yscrollcommand [list $vsb set] -width 0 -if {[$tbl cget -selectborderwidth] == 0} { - $tbl configure -spacing 1 -} -$tbl columnconfigure 0 -name fileName -$tbl columnconfigure 1 -formatcommand emptyStr -sortmode integer -$tbl columnconfigure 2 -name fileSize -sortmode integer -$tbl columnconfigure 4 -name seen -ttk::scrollbar $vsb -orient vertical -command [list $tbl yview] - -proc emptyStr val { return "" } - -eval font create BoldFont [font actual [$tbl cget -font]] -weight bold - -# -# Populate the tablelist widget -# -if {[info exists ttk::library]} { - cd $ttk::library -} else { - cd $tile::library -} -set maxFileSize 0 -foreach fileName [lsort [glob *.tcl]] { - set fileSize [file size $fileName] - $tbl insert end [list $fileName $fileSize $fileSize "" no] - - if {$fileSize > $maxFileSize} { - set maxFileSize $fileSize - } -} - -#------------------------------------------------------------------------------ -# createFrame -# -# Creates a frame widget w to be embedded into the specified cell of the -# tablelist widget tbl, as well as a child frame representing the size of the -# 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 - # - frame $w -width 102 -height 14 -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 -height 12 -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 -relwidth [expr {double($fileSize) / $::maxFileSize}] -} - -#------------------------------------------------------------------------------ -# createButton -# -# Creates a button widget w to be embedded into the specified cell of the -# tablelist widget tbl. -#------------------------------------------------------------------------------ -proc createButton {tbl row col w} { - set key [$tbl getkeys $row] - ttk::button $w -style Embedded.TButton -image openImg -takefocus 0 \ - -command [list viewFile $tbl $key] -} - -#------------------------------------------------------------------------------ -# viewFile -# -# Displays the contents of the file whose name is contained in the row with the -# given key of the tablelist widget tbl. -#------------------------------------------------------------------------------ -proc viewFile {tbl key} { - set top .top$key - if {[winfo exists $top]} { - raise $top - return "" - } - - toplevel $top - set fileName [$tbl cellcget k$key,fileName -text] - wm title $top "File \"$fileName\"" - - # - # Create a vertically scrolled text widget as a grandchild of the toplevel - # - set tf $top.tf - ttk::frame $tf -class ScrollArea - set txt $tf.txt - set vsb $tf.vsb - text $txt -background white -font TkFixedFont -highlightthickness 0 \ - -setgrid yes -yscrollcommand [list $vsb set] - catch {$txt configure -tabstyle wordprocessor} ;# for Tk 8.5 and above - ttk::scrollbar $vsb -orient vertical -command [list $txt yview] - - # - # Insert the file's contents into the text widget - # - set chan [open $fileName] - $txt insert end [read $chan] - close $chan - - set bf $top.bf - ttk::frame $bf - set btn [ttk::button $bf.btn -text "Close" -command [list destroy $top]] - - # - # 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 10 - 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 - $tbl cellconfigure k$key,seen -text yes -} - -#------------------------------------------------------------------------------ - -# -# Create embedded windows in the columns no. 1 and 3 -# -set rowCount [$tbl size] -for {set row 0} {$row < $rowCount} {incr row} { - $tbl cellconfigure $row,1 -window createFrame -stretchwindow yes - $tbl cellconfigure $row,3 -window createButton -} - -set bf .bf -ttk::frame $bf -set btn [ttk::button $bf.btn -text "Close" -command exit] - -# -# Manage the widgets -# -grid $tbl -row 0 -rowspan 2 -column 0 -sticky news -if {[tablelist::getCurrentTheme] eq "aqua"} { - grid [$tbl cornerpath] -row 0 -column 1 -sticky ew - grid $vsb -row 1 -column 1 -sticky ns -} else { - grid $vsb -row 0 -rowspan 2 -column 1 -sticky ns -} -grid rowconfigure $tf 1 -weight 1 -grid columnconfigure $tf 0 -weight 1 -pack $btn -pady 10 -pack $bf -side bottom -fill x -pack $tf -side top -expand yes -fill both DELETED tablelist5.13/demos/file.gif Index: tablelist5.13/demos/file.gif ================================================================== --- tablelist5.13/demos/file.gif +++ tablelist5.13/demos/file.gif cannot compute difference between binary files DELETED tablelist5.13/demos/images.tcl Index: tablelist5.13/demos/images.tcl ================================================================== --- tablelist5.13/demos/images.tcl +++ tablelist5.13/demos/images.tcl @@ -1,38 +0,0 @@ -#============================================================================== -# Creates some images. -# -# Copyright (c) 2011-2015 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) -#============================================================================== - -# -# Create two images, to be displayed in tablelist cells with boolean values -# -image create photo checkedImg -file [file join $dir checked.gif] -image create photo uncheckedImg -file [file join $dir unchecked.gif] - -# -# Create 16 images representing different colors -# -set colorNames { - "red" "green" "blue" "magenta" - "yellow" "cyan" "white" "light gray" - "dark red" "dark green" "dark blue" "dark magenta" - "dark yellow" "dark cyan" "dark gray" "black" -} -set colorValues { - #FF0000 #00FF00 #0000FF #FF00FF - #FFFF00 #00FFFF #FFFFFF #C0C0C0 - #800000 #008000 #000080 #800080 - #808000 #008080 #808080 #000000 -} -foreach name $colorNames value $colorValues { - set colors($name) $value -} -foreach value $colorValues { - image create photo img$value -height 13 -width 13 - img$value put gray50 -to 0 0 13 1 ;# top edge - img$value put gray50 -to 0 1 1 12 ;# left edge - img$value put gray75 -to 0 12 13 13 ;# bottom edge - img$value put gray75 -to 12 1 13 12 ;# right edge - img$value put $value -to 1 1 12 12 -} DELETED tablelist5.13/demos/iwidgets.tcl Index: tablelist5.13/demos/iwidgets.tcl ================================================================== --- tablelist5.13/demos/iwidgets.tcl +++ tablelist5.13/demos/iwidgets.tcl @@ -1,288 +0,0 @@ -#!/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-2015 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) -#============================================================================== - -package require Tk 8.4 ;# because of "-compound" -package require tablelist 5.13 -package require Iwidgets - -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*Checkbutton.background white -option add *Tablelist*Checkbutton.activeBackground white -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 - -# -# 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 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] - -# -# Create a tablelist widget with editable columns (except the first one) -# -set tbl .tbl -tablelist::tablelist $tbl \ - -columns {0 "No." right - 0 "Available" center - 0 "Name" left - 0 "Baud Rate" right - 0 "Data Bits" center - 0 "Parity" left - 0 "Stop Bits" center - 0 "Handshake" left - 0 "Activation Date" center - 0 "Activation Time" center - 0 "Cable Color" center} \ - -editstartcommand editStartCmd -editendcommand editEndCmd \ - -height 0 -width 0 -if {[$tbl cget -selectborderwidth] == 0} { - $tbl configure -spacing 1 -} -$tbl columnconfigure 0 -sortmode integer -$tbl columnconfigure 1 -name available -editable yes -editwindow checkbutton \ - -formatcommand emptyStr -$tbl columnconfigure 2 -name lineName -editable yes -editwindow entryfield \ - -sortmode dictionary -$tbl columnconfigure 3 -name baudRate -editable yes -editwindow combobox \ - -sortmode integer -$tbl columnconfigure 4 -name dataBits -editable yes -editwindow spinint -$tbl columnconfigure 5 -name parity -editable yes -editwindow combobox -$tbl columnconfigure 6 -name stopBits -editable yes -editwindow combobox -$tbl columnconfigure 7 -name handshake -editable yes -editwindow combobox -$tbl columnconfigure 8 -name actDate -editable yes -editwindow dateentry \ - -formatcommand formatDate -sortmode integer -$tbl columnconfigure 9 -name actTime -editable yes -editwindow timeentry \ - -formatcommand formatTime -sortmode integer -$tbl columnconfigure 10 -name color -editable yes -editwindow menubutton \ - -formatcommand emptyStr - -proc emptyStr val { return "" } -proc formatDate val { return [clock format $val -format "%Y-%m-%d"] } -proc formatTime val { return [clock format $val -format "%H:%M:%S"] } - -# -# Populate the tablelist widget; set the activation -# date & time to 10 minutes past the current clock value -# -set clock [expr {[clock seconds] + 600}] -for {set i 0; set n 1} {$i < 16} {set i $n; incr n} { - $tbl insert end [list $n [expr {$i < 8}] "Line $n" 9600 8 None 1 XON/XOFF \ - $clock $clock [lindex $colorNames $i]] - - set availImg [expr {($i < 8) ? "checkedImg" : "uncheckedImg"}] - $tbl cellconfigure end,available -image $availImg - $tbl cellconfigure end,color -image img[lindex $colorValues $i] -} - -set btn [button .btn -text "Close" -command exit] - -# -# Manage the widgets -# -pack $btn -side bottom -pady 10 -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] - - switch [$tbl columncget $col -name] { - lineName { - # - # Set an upper limit of 20 for the number of characters - # - $w configure -pasting no -fixed 20 - } - - baudRate { - # - # Populate the combobox and allow no more - # than 6 digits in its entry component - # - $w insert list end 50 75 110 300 1200 2400 4800 9600 19200 38400 \ - 57600 115200 230400 460800 921600 - $w configure -pasting no -fixed 6 -validate numeric - } - - dataBits { - # - # Configure the spinint widget - # - $w configure -range {5 8} -wrap no -pasting no -fixed 1 \ - -validate {regexp {^[5-8]$} %c} - } - - parity { - # - # Populate the combobox and make it non-editable - # - $w insert list end None Even Odd Mark Space - $w configure -editable no -listheight 120 - } - - stopBits { - # - # Populate the combobox and make it non-editable - # - $w insert list end 1 1.5 2 - $w configure -editable no -listheight 90 - } - - handshake { - # - # Populate the combobox and make it non-editable - # - $w insert list end XON/XOFF RTS/CTS None - $w configure -editable no -listheight 90 - } - - actDate { - # - # Set the date format "%Y-%m-%d" - # - $w configure -int yes - } - - actTime { - # - # Set the time format "%H:%M:%S" - # - $w configure -format military - } - - color { - # - # Populate the menu and make sure the menubutton will display the - # color name rather than $text, which is "", due to -formatcommand - # - set menu [$w cget -menu] - foreach name $::colorNames { - $menu add radiobutton -compound left \ - -image img$::colors($name) -label $name - } - $menu entryconfigure 8 -columnbreak 1 - return [$tbl cellcget $row,$col -text] - } - } - - return $text -} - -#------------------------------------------------------------------------------ -# editEndCmd -# -# Performs a final validation of the text contained in the edit window and gets -# the cell's internal contents. -#------------------------------------------------------------------------------ -proc editEndCmd {tbl row col text} { - switch [$tbl columncget $col -name] { - available { - # - # Update the image contained in the cell - # - set img [expr {$text ? "checkedImg" : "uncheckedImg"}] - $tbl cellconfigure $row,$col -image $img - } - - baudRate { - # - # Check whether the baud rate is an integer in the range 50..921600 - # - if {![regexp {^[0-9]+$} $text] || $text < 50 || $text > 921600} { - bell - tk_messageBox -title "Error" -icon error -message \ - "The baud rate must be an integer in the range 50..921600" - $tbl rejectinput - } - } - - dataBits { - # - # Check whether the # of data bits is an integer in the range 5..8 - # - if {![regexp {^[5-8]$} $text]} { - bell - tk_messageBox -title "Error" -icon error -message \ - "The # of data bits must be an integer in the range 5..8" - $tbl rejectinput - } - } - - actDate { - # - # Check whether the activation clock value is later than the - # current one; if this is the case then make sure the cells - # "actDate" and "actTime" will have the same internal value - # - set actTime [$tbl cellcget $row,actTime -text] - set actClock [clock scan [formatTime $actTime] -base $text] - if {$actClock <= [clock seconds]} { - bell - tk_messageBox -title "Error" -icon error -message \ - "The activation date & time must be in the future" - $tbl rejectinput - } else { - $tbl cellconfigure $row,actTime -text $actClock - return $actClock - } - } - - actTime { - # - # Check whether the activation clock value is later than the - # current one; if this is the case then make sure the cells - # "actDate" and "actTime" will have the same internal value - # - set actDate [$tbl cellcget $row,actDate -text] - set actClock [clock scan [formatTime $text] -base $actDate] - if {$actClock <= [clock seconds]} { - bell - tk_messageBox -title "Error" -icon error -message \ - "The activation date & time must be in the future" - $tbl rejectinput - } else { - $tbl cellconfigure $row,actDate -text $actClock - return $actClock - } - } - - color { - # - # Update the image contained in the cell - # - $tbl cellconfigure $row,$col -image img$::colors($text) - } - } - - return $text -} DELETED tablelist5.13/demos/iwidgets_tile.tcl Index: tablelist5.13/demos/iwidgets_tile.tcl ================================================================== --- tablelist5.13/demos/iwidgets_tile.tcl +++ tablelist5.13/demos/iwidgets_tile.tcl @@ -1,294 +0,0 @@ -#!/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-2015 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) -#============================================================================== - -package require tablelist_tile 5.13 -package require Iwidgets - -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*Checkbutton.background white -option add *Tablelist*Checkbutton.activeBackground white -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 - -# -# 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 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] - -# -# Improve the window's appearance by using a tile -# frame as a container for the other widgets -# -set f [ttk::frame .f] - -# -# Create a tablelist widget with editable columns (except the first one) -# -set tbl $f.tbl -tablelist::tablelist $tbl \ - -columns {0 "No." right - 0 "Available" center - 0 "Name" left - 0 "Baud Rate" right - 0 "Data Bits" center - 0 "Parity" left - 0 "Stop Bits" center - 0 "Handshake" left - 0 "Activation Date" center - 0 "Activation Time" center - 0 "Cable Color" center} \ - -editstartcommand editStartCmd -editendcommand editEndCmd \ - -height 0 -width 0 -if {[$tbl cget -selectborderwidth] == 0} { - $tbl configure -spacing 1 -} -$tbl columnconfigure 0 -sortmode integer -$tbl columnconfigure 1 -name available -editable yes -editwindow checkbutton \ - -formatcommand emptyStr -$tbl columnconfigure 2 -name lineName -editable yes -editwindow entryfield \ - -sortmode dictionary -$tbl columnconfigure 3 -name baudRate -editable yes -editwindow combobox \ - -sortmode integer -$tbl columnconfigure 4 -name dataBits -editable yes -editwindow spinint -$tbl columnconfigure 5 -name parity -editable yes -editwindow combobox -$tbl columnconfigure 6 -name stopBits -editable yes -editwindow combobox -$tbl columnconfigure 7 -name handshake -editable yes -editwindow combobox -$tbl columnconfigure 8 -name actDate -editable yes -editwindow dateentry \ - -formatcommand formatDate -sortmode integer -$tbl columnconfigure 9 -name actTime -editable yes -editwindow timeentry \ - -formatcommand formatTime -sortmode integer -$tbl columnconfigure 10 -name color -editable yes -editwindow menubutton \ - -formatcommand emptyStr - -proc emptyStr val { return "" } -proc formatDate val { return [clock format $val -format "%Y-%m-%d"] } -proc formatTime val { return [clock format $val -format "%H:%M:%S"] } - -# -# Populate the tablelist widget; set the activation -# date & time to 10 minutes past the current clock value -# -set clock [expr {[clock seconds] + 600}] -for {set i 0; set n 1} {$i < 16} {set i $n; incr n} { - $tbl insert end [list $n [expr {$i < 8}] "Line $n" 9600 8 None 1 XON/XOFF \ - $clock $clock [lindex $colorNames $i]] - - set availImg [expr {($i < 8) ? "checkedImg" : "uncheckedImg"}] - $tbl cellconfigure end,available -image $availImg - $tbl cellconfigure end,color -image img[lindex $colorValues $i] -} - -set btn [ttk::button $f.btn -text "Close" -command exit] - -# -# Manage the widgets -# -pack $btn -side bottom -pady 10 -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] - - switch [$tbl columncget $col -name] { - lineName { - # - # Set an upper limit of 20 for the number of characters - # - $w configure -pasting no -fixed 20 - } - - baudRate { - # - # Populate the combobox and allow no more - # than 6 digits in its entry component - # - $w insert list end 50 75 110 300 1200 2400 4800 9600 19200 38400 \ - 57600 115200 230400 460800 921600 - $w configure -pasting no -fixed 6 -validate numeric - } - - dataBits { - # - # Configure the spinint widget - # - $w configure -range {5 8} -wrap no -pasting no -fixed 1 \ - -validate {regexp {^[5-8]$} %c} - } - - parity { - # - # Populate the combobox and make it non-editable - # - $w insert list end None Even Odd Mark Space - $w configure -editable no -listheight 120 - } - - stopBits { - # - # Populate the combobox and make it non-editable - # - $w insert list end 1 1.5 2 - $w configure -editable no -listheight 90 - } - - handshake { - # - # Populate the combobox and make it non-editable - # - $w insert list end XON/XOFF RTS/CTS None - $w configure -editable no -listheight 90 - } - - actDate { - # - # Set the date format "%Y-%m-%d" - # - $w configure -int yes - } - - actTime { - # - # Set the time format "%H:%M:%S" - # - $w configure -format military - } - - color { - # - # Populate the menu and make sure the menubutton will display the - # color name rather than $text, which is "", due to -formatcommand - # - set menu [$w cget -menu] - foreach name $::colorNames { - $menu add radiobutton -compound left \ - -image img$::colors($name) -label $name - } - $menu entryconfigure 8 -columnbreak 1 - return [$tbl cellcget $row,$col -text] - } - } - - return $text -} - -#------------------------------------------------------------------------------ -# editEndCmd -# -# Performs a final validation of the text contained in the edit window and gets -# the cell's internal contents. -#------------------------------------------------------------------------------ -proc editEndCmd {tbl row col text} { - switch [$tbl columncget $col -name] { - available { - # - # Update the image contained in the cell - # - set img [expr {$text ? "checkedImg" : "uncheckedImg"}] - $tbl cellconfigure $row,$col -image $img - } - - baudRate { - # - # Check whether the baud rate is an integer in the range 50..921600 - # - if {![regexp {^[0-9]+$} $text] || $text < 50 || $text > 921600} { - bell - tk_messageBox -title "Error" -icon error -message \ - "The baud rate must be an integer in the range 50..921600" - $tbl rejectinput - } - } - - dataBits { - # - # Check whether the # of data bits is an integer in the range 5..8 - # - if {![regexp {^[5-8]$} $text]} { - bell - tk_messageBox -title "Error" -icon error -message \ - "The # of data bits must be an integer in the range 5..8" - $tbl rejectinput - } - } - - actDate { - # - # Check whether the activation clock value is later than the - # current one; if this is the case then make sure the cells - # "actDate" and "actTime" will have the same internal value - # - set actTime [$tbl cellcget $row,actTime -text] - set actClock [clock scan [formatTime $actTime] -base $text] - if {$actClock <= [clock seconds]} { - bell - tk_messageBox -title "Error" -icon error -message \ - "The activation date & time must be in the future" - $tbl rejectinput - } else { - $tbl cellconfigure $row,actTime -text $actClock - return $actClock - } - } - - actTime { - # - # Check whether the activation clock value is later than the - # current one; if this is the case then make sure the cells - # "actDate" and "actTime" will have the same internal value - # - set actDate [$tbl cellcget $row,actDate -text] - set actClock [clock scan [formatTime $text] -base $actDate] - if {$actClock <= [clock seconds]} { - bell - tk_messageBox -title "Error" -icon error -message \ - "The activation date & time must be in the future" - $tbl rejectinput - } else { - $tbl cellconfigure $row,actDate -text $actClock - return $actClock - } - } - - color { - # - # Update the image contained in the cell - # - $tbl cellconfigure $row,$col -image img$::colors($text) - } - } - - return $text -} DELETED tablelist5.13/demos/leaf.xbm Index: tablelist5.13/demos/leaf.xbm ================================================================== --- tablelist5.13/demos/leaf.xbm +++ tablelist5.13/demos/leaf.xbm @@ -1,5 +0,0 @@ -#define leaf_width 14 -#define leaf_height 12 -static unsigned char leaf_bits[] = { - 0xff, 0x3f, 0x01, 0x20, 0x01, 0x20, 0x01, 0x20, 0x01, 0x20, 0x01, 0x20, - 0x01, 0x20, 0x01, 0x20, 0x01, 0x20, 0x01, 0x20, 0x01, 0x20, 0xff, 0x3f}; DELETED tablelist5.13/demos/miscWidgets.tcl Index: tablelist5.13/demos/miscWidgets.tcl ================================================================== --- tablelist5.13/demos/miscWidgets.tcl +++ tablelist5.13/demos/miscWidgets.tcl @@ -1,302 +0,0 @@ -#!/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-2015 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) -#============================================================================== - -package require Tk 8.4 ;# because of "-compound" and the spinbox widget -package require tablelist 5.13 -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*Checkbutton.background white -option add *Tablelist*Checkbutton.activeBackground white -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 - -# -# 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 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] - -# -# Create a tablelist widget with editable columns (except the first one) -# -set tbl .tbl -tablelist::tablelist $tbl \ - -columns {0 "No." right - 0 "Available" center - 0 "Name" left - 0 "Baud Rate" right - 0 "Data Bits" center - 0 "Parity" left - 0 "Stop Bits" center - 0 "Handshake" left - 0 "Activation Date" center - 0 "Activation Time" center - 0 "Cable Color" center} \ - -editstartcommand editStartCmd -editendcommand editEndCmd \ - -height 0 -width 0 -if {[$tbl cget -selectborderwidth] == 0} { - $tbl configure -spacing 1 -} -$tbl columnconfigure 0 -sortmode integer -$tbl columnconfigure 1 -name available -editable yes -editwindow checkbutton \ - -formatcommand emptyStr -$tbl columnconfigure 2 -name lineName -editable yes -editwindow entry \ - -sortmode dictionary -$tbl columnconfigure 3 -name baudRate -editable yes -editwindow combobox \ - -sortmode integer -$tbl columnconfigure 4 -name dataBits -editable yes -editwindow spinbox -$tbl columnconfigure 5 -name parity -editable yes -editwindow combobox -$tbl columnconfigure 6 -name stopBits -editable yes -editwindow combobox -$tbl columnconfigure 7 -name handshake -editable yes -editwindow combobox -$tbl columnconfigure 8 -name actDate -editable yes -editwindow dateMentry \ - -formatcommand formatDate -sortmode integer -$tbl columnconfigure 9 -name actTime -editable yes -editwindow timeMentry \ - -formatcommand formatTime -sortmode integer -$tbl columnconfigure 10 -name color -editable yes -editwindow menubutton \ - -formatcommand emptyStr - -proc emptyStr val { return "" } -proc formatDate val { return [clock format $val -format "%Y-%m-%d"] } -proc formatTime val { return [clock format $val -format "%H:%M:%S"] } - -# -# Populate the tablelist widget; set the activation -# date & time to 10 minutes past the current clock value -# -set clock [expr {[clock seconds] + 600}] -for {set i 0; set n 1} {$i < 16} {set i $n; incr n} { - $tbl insert end [list $n [expr {$i < 8}] "Line $n" 9600 8 None 1 XON/XOFF \ - $clock $clock [lindex $colorNames $i]] - - set availImg [expr {($i < 8) ? "checkedImg" : "uncheckedImg"}] - $tbl cellconfigure end,available -image $availImg - $tbl cellconfigure end,color -image img[lindex $colorValues $i] -} - -set btn [button .btn -text "Close" -command exit] - -# -# Manage the widgets -# -pack $btn -side bottom -pady 10 -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] - - switch [$tbl columncget $col -name] { - lineName { - # - # Set an upper limit of 20 for the number of characters - # - wcb::callback $w before insert {wcb::checkEntryLen 20} - } - - baudRate { - # - # Populate the combobox and allow no more - # than 6 digits in its entry component - # - $w list insert end 50 75 110 300 1200 2400 4800 9600 19200 38400 \ - 57600 115200 230400 460800 921600 - wcb::callback [$tbl entrypath] before insert \ - {wcb::checkEntryLen 6} {wcb::checkStrForRegExp {^[0-9]*$}} - } - - dataBits { - # - # Configure the spinbox - # - $w configure -from 5 -to 8 -state readonly - } - - parity { - # - # Populate the combobox and make it non-editable - # - $w list insert end None Even Odd Mark Space - $w configure -editable no - } - - stopBits { - # - # Populate the combobox and make it non-editable - # - $w list insert end 1 1.5 2 - $w configure -editable no - } - - handshake { - # - # Populate the combobox and make it non-editable - # - $w list insert end XON/XOFF RTS/CTS None - $w configure -editable no - } - - actDate - - actTime { - # - # Configure the mentry widget - # - $w configure -justify center - } - - color { - # - # Populate the menu and make sure the menubutton will display the - # color name rather than $text, which is "", due to -formatcommand - # - set menu [$w cget -menu] - foreach name $::colorNames { - $menu add radiobutton -compound left \ - -image img$::colors($name) -label $name - } - $menu entryconfigure 8 -columnbreak 1 - return [$tbl cellcget $row,$col -text] - } - } - - return $text -} - -# -# Message strings corresponding to the values -# returned by mentry::getClockVal on failure -# -array set msgs { - EMPTY "Field value missing" - BAD "Invalid field value" - BAD_DATE "Invalid date" - BAD_YEAR "Unsupported year" -} - -#------------------------------------------------------------------------------ -# editEndCmd -# -# Performs a final validation of the text contained in the edit window and gets -# the cell's internal contents. -#------------------------------------------------------------------------------ -proc editEndCmd {tbl row col text} { - switch [$tbl columncget $col -name] { - available { - # - # Update the image contained in the cell - # - set img [expr {$text ? "checkedImg" : "uncheckedImg"}] - $tbl cellconfigure $row,$col -image $img - } - - baudRate { - # - # Check whether the baud rate is an integer in the range 50..921600 - # - if {![regexp {^[0-9]+$} $text] || $text < 50 || $text > 921600} { - bell - tk_messageBox -title "Error" -icon error -message \ - "The baud rate must be an integer in the range 50..921600" - $tbl rejectinput - } - } - - actDate { - # - # Check whether the last argument is a clock value in seconds - # - if {![string is digit $text]} { - bell - tk_messageBox -title "Error" -icon error -message $::msgs($text) - $tbl rejectinput - return "" - } - - # - # Check whether the activation clock value is later than the - # current one; if this is the case then make sure the cells - # "actDate" and "actTime" will have the same internal value - # - set actTime [$tbl cellcget $row,actTime -text] - set actClock [clock scan [formatTime $actTime] -base $text] - if {$actClock <= [clock seconds]} { - bell - tk_messageBox -title "Error" -icon error -message \ - "The activation date & time must be in the future" - $tbl rejectinput - } else { - $tbl cellconfigure $row,actTime -text $actClock - return $actClock - } - } - - actTime { - # - # Check whether the last argument is a clock value in seconds - # - if {![string is digit $text]} { - bell - tk_messageBox -title "Error" -icon error -message $::msgs($text) - $tbl rejectinput - return "" - } - - # - # Check whether the activation clock value is later than the - # current one; if this is the case then make sure the cells - # "actDate" and "actTime" will have the same internal value - # - set actDate [$tbl cellcget $row,actDate -text] - set actClock [clock scan [formatTime $text] -base $actDate] - if {$actClock <= [clock seconds]} { - bell - tk_messageBox -title "Error" -icon error -message \ - "The activation date & time must be in the future" - $tbl rejectinput - } else { - $tbl cellconfigure $row,actDate -text $actClock - return $actClock - } - } - - color { - # - # Update the image contained in the cell - # - $tbl cellconfigure $row,$col -image img$::colors($text) - } - } - - return $text -} DELETED tablelist5.13/demos/miscWidgets_tile.tcl Index: tablelist5.13/demos/miscWidgets_tile.tcl ================================================================== --- tablelist5.13/demos/miscWidgets_tile.tcl +++ tablelist5.13/demos/miscWidgets_tile.tcl @@ -1,308 +0,0 @@ -#!/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-2015 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) -#============================================================================== - -package require tablelist_tile 5.13 -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*Checkbutton.background white -option add *Tablelist*Checkbutton.activeBackground white -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 - -# -# 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 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] - -# -# Improve the window's appearance by using a tile -# frame as a container for the other widgets -# -set f [ttk::frame .f] - -# -# Create a tablelist widget with editable columns (except the first one) -# -set tbl $f.tbl -tablelist::tablelist $tbl \ - -columns {0 "No." right - 0 "Available" center - 0 "Name" left - 0 "Baud Rate" right - 0 "Data Bits" center - 0 "Parity" left - 0 "Stop Bits" center - 0 "Handshake" left - 0 "Activation Date" center - 0 "Activation Time" center - 0 "Cable Color" center} \ - -editstartcommand editStartCmd -editendcommand editEndCmd \ - -height 0 -width 0 -if {[$tbl cget -selectborderwidth] == 0} { - $tbl configure -spacing 1 -} -$tbl columnconfigure 0 -sortmode integer -$tbl columnconfigure 1 -name available -editable yes -editwindow checkbutton \ - -formatcommand emptyStr -$tbl columnconfigure 2 -name lineName -editable yes -editwindow entry \ - -sortmode dictionary -$tbl columnconfigure 3 -name baudRate -editable yes -editwindow combobox \ - -sortmode integer -$tbl columnconfigure 4 -name dataBits -editable yes -editwindow spinbox -$tbl columnconfigure 5 -name parity -editable yes -editwindow combobox -$tbl columnconfigure 6 -name stopBits -editable yes -editwindow combobox -$tbl columnconfigure 7 -name handshake -editable yes -editwindow combobox -$tbl columnconfigure 8 -name actDate -editable yes -editwindow dateMentry \ - -formatcommand formatDate -sortmode integer -$tbl columnconfigure 9 -name actTime -editable yes -editwindow timeMentry \ - -formatcommand formatTime -sortmode integer -$tbl columnconfigure 10 -name color -editable yes -editwindow menubutton \ - -formatcommand emptyStr - -proc emptyStr val { return "" } -proc formatDate val { return [clock format $val -format "%Y-%m-%d"] } -proc formatTime val { return [clock format $val -format "%H:%M:%S"] } - -# -# Populate the tablelist widget; set the activation -# date & time to 10 minutes past the current clock value -# -set clock [expr {[clock seconds] + 600}] -for {set i 0; set n 1} {$i < 16} {set i $n; incr n} { - $tbl insert end [list $n [expr {$i < 8}] "Line $n" 9600 8 None 1 XON/XOFF \ - $clock $clock [lindex $colorNames $i]] - - set availImg [expr {($i < 8) ? "checkedImg" : "uncheckedImg"}] - $tbl cellconfigure end,available -image $availImg - $tbl cellconfigure end,color -image img[lindex $colorValues $i] -} - -set btn [ttk::button $f.btn -text "Close" -command exit] - -# -# Manage the widgets -# -pack $btn -side bottom -pady 10 -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] - - switch [$tbl columncget $col -name] { - lineName { - # - # Set an upper limit of 20 for the number of characters - # - wcb::callback $w before insert {wcb::checkEntryLen 20} - } - - baudRate { - # - # Populate the combobox and allow no more - # than 6 digits in its entry component - # - $w list insert end 50 75 110 300 1200 2400 4800 9600 19200 38400 \ - 57600 115200 230400 460800 921600 - wcb::callback [$tbl entrypath] before insert \ - {wcb::checkEntryLen 6} {wcb::checkStrForRegExp {^[0-9]*$}} - } - - dataBits { - # - # Configure the spinbox - # - $w configure -from 5 -to 8 -state readonly - } - - parity { - # - # Populate the combobox and make it non-editable - # - $w list insert end None Even Odd Mark Space - $w configure -editable no - } - - stopBits { - # - # Populate the combobox and make it non-editable - # - $w list insert end 1 1.5 2 - $w configure -editable no - } - - handshake { - # - # Populate the combobox and make it non-editable - # - $w list insert end XON/XOFF RTS/CTS None - $w configure -editable no - } - - actDate - - actTime { - # - # Configure the mentry widget - # - $w configure -justify center - } - - color { - # - # Populate the menu and make sure the menubutton will display the - # color name rather than $text, which is "", due to -formatcommand - # - set menu [$w cget -menu] - foreach name $::colorNames { - $menu add radiobutton -compound left \ - -image img$::colors($name) -label $name - } - $menu entryconfigure 8 -columnbreak 1 - return [$tbl cellcget $row,$col -text] - } - } - - return $text -} - -# -# Message strings corresponding to the values -# returned by mentry::getClockVal on failure -# -array set msgs { - EMPTY "Field value missing" - BAD "Invalid field value" - BAD_DATE "Invalid date" - BAD_YEAR "Unsupported year" -} - -#------------------------------------------------------------------------------ -# editEndCmd -# -# Performs a final validation of the text contained in the edit window and gets -# the cell's internal contents. -#------------------------------------------------------------------------------ -proc editEndCmd {tbl row col text} { - switch [$tbl columncget $col -name] { - available { - # - # Update the image contained in the cell - # - set img [expr {$text ? "checkedImg" : "uncheckedImg"}] - $tbl cellconfigure $row,$col -image $img - } - - baudRate { - # - # Check whether the baud rate is an integer in the range 50..921600 - # - if {![regexp {^[0-9]+$} $text] || $text < 50 || $text > 921600} { - bell - tk_messageBox -title "Error" -icon error -message \ - "The baud rate must be an integer in the range 50..921600" - $tbl rejectinput - } - } - - actDate { - # - # Check whether the last argument is a clock value in seconds - # - if {![string is digit $text]} { - bell - tk_messageBox -title "Error" -icon error -message $::msgs($text) - $tbl rejectinput - return "" - } - - # - # Check whether the activation clock value is later than the - # current one; if this is the case then make sure the cells - # "actDate" and "actTime" will have the same internal value - # - set actTime [$tbl cellcget $row,actTime -text] - set actClock [clock scan [formatTime $actTime] -base $text] - if {$actClock <= [clock seconds]} { - bell - tk_messageBox -title "Error" -icon error -message \ - "The activation date & time must be in the future" - $tbl rejectinput - } else { - $tbl cellconfigure $row,actTime -text $actClock - return $actClock - } - } - - actTime { - # - # Check whether the last argument is a clock value in seconds - # - if {![string is digit $text]} { - bell - tk_messageBox -title "Error" -icon error -message $::msgs($text) - $tbl rejectinput - return "" - } - - # - # Check whether the activation clock value is later than the - # current one; if this is the case then make sure the cells - # "actDate" and "actTime" will have the same internal value - # - set actDate [$tbl cellcget $row,actDate -text] - set actClock [clock scan [formatTime $text] -base $actDate] - if {$actClock <= [clock seconds]} { - bell - tk_messageBox -title "Error" -icon error -message \ - "The activation date & time must be in the future" - $tbl rejectinput - } else { - $tbl cellconfigure $row,actDate -text $actClock - return $actClock - } - } - - color { - # - # Update the image contained in the cell - # - $tbl cellconfigure $row,$col -image img$::colors($text) - } - } - - return $text -} DELETED tablelist5.13/demos/open.gif Index: tablelist5.13/demos/open.gif ================================================================== --- tablelist5.13/demos/open.gif +++ tablelist5.13/demos/open.gif cannot compute difference between binary files DELETED tablelist5.13/demos/openFolder.gif Index: tablelist5.13/demos/openFolder.gif ================================================================== --- tablelist5.13/demos/openFolder.gif +++ tablelist5.13/demos/openFolder.gif cannot compute difference between binary files DELETED tablelist5.13/demos/option.tcl Index: tablelist5.13/demos/option.tcl ================================================================== --- tablelist5.13/demos/option.tcl +++ tablelist5.13/demos/option.tcl @@ -1,43 +0,0 @@ -#============================================================================== -# Contains some Tk option database settings. -# -# Copyright (c) 2004-2015 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) -#============================================================================== - -# -# Get the current windowing system ("x11", "win32", "classic", or "aqua") -# -if {[catch {tk windowingsystem} winSys] != 0} { - switch $::tcl_platform(platform) { - unix { set winSys x11 } - windows { set winSys win32 } - macintosh { set winSys classic } - } -} - -# -# Add some entries to the Tk option database -# -if {[string compare $winSys "x11"] == 0} { - # - # Create the font TkDefaultFont if not yet present - # - catch {font create TkDefaultFont -family Helvetica -size -12} - - option add *Font TkDefaultFont - option add *selectBackground #678db2 - option add *selectForeground white -} else { - option add *ScrollArea.borderWidth 1 - option add *ScrollArea.relief sunken - option add *ScrollArea.Tablelist.borderWidth 0 - option add *ScrollArea.Tablelist.highlightThickness 0 - option add *ScrollArea.Text.borderWidth 0 - option add *ScrollArea.Text.highlightThickness 0 -} -option add *Tablelist.background white -option add *Tablelist.stripeBackground #e4e8ec -option add *Tablelist.setGrid yes -option add *Tablelist.movableColumns yes -option add *Tablelist.labelCommand tablelist::sortByColumn -option add *Tablelist.labelCommand2 tablelist::addToSortColumns DELETED tablelist5.13/demos/option_tile.tcl Index: tablelist5.13/demos/option_tile.tcl ================================================================== --- tablelist5.13/demos/option_tile.tcl +++ tablelist5.13/demos/option_tile.tcl @@ -1,36 +0,0 @@ -#============================================================================== -# Contains some Tk option database settings. -# -# Copyright (c) 2004-2015 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) -#============================================================================== - -# -# Get the current windowing system ("x11", "win32", or -# "aqua") and add some entries to the Tk option database -# -if {[tk windowingsystem] eq "x11"} { - option add *Font TkDefaultFont -} else { - option add *ScrollArea.borderWidth 1 - option add *ScrollArea.relief sunken - option add *ScrollArea.Tablelist.borderWidth 0 - option add *ScrollArea.Text.borderWidth 0 - option add *ScrollArea.Text.highlightThickness 0 -} -tablelist::setThemeDefaults -if {[tablelist::getCurrentTheme] eq "aqua"} { - option add *Listbox.selectBackground \ - $tablelist::themeDefaults(-selectbackground) - option add *Listbox.selectForeground \ - $tablelist::themeDefaults(-selectforeground) -} else { - option add *selectBackground $tablelist::themeDefaults(-selectbackground) - option add *selectForeground $tablelist::themeDefaults(-selectforeground) -} -option add *selectBorderWidth $tablelist::themeDefaults(-selectborderwidth) -option add *Tablelist.background white -option add *Tablelist.stripeBackground #e4e8ec -option add *Tablelist.setGrid yes -option add *Tablelist.movableColumns yes -option add *Tablelist.labelCommand tablelist::sortByColumn -option add *Tablelist.labelCommand2 tablelist::addToSortColumns DELETED tablelist5.13/demos/styles.tcl Index: tablelist5.13/demos/styles.tcl ================================================================== --- tablelist5.13/demos/styles.tcl +++ tablelist5.13/demos/styles.tcl @@ -1,102 +0,0 @@ -#!/usr/bin/env wish - -#============================================================================== -# Demonstrates some ways of improving the look & feel of a tablelist widget. -# -# Copyright (c) 2002-2015 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) -#============================================================================== - -package require tablelist 5.13 - -wm title . "Tablelist Styles" - -# -# Get the current windowing system ("x11", "win32", "classic", -# or "aqua") and add some entries to the Tk option database -# -if {[catch {tk windowingsystem} winSys] != 0} { - switch $::tcl_platform(platform) { - unix { set winSys x11 } - windows { set winSys win32 } - macintosh { set winSys classic } - } -} -if {[string compare $winSys "x11"] == 0} { - # - # Create the font TkDefaultFont if not yet present - # - catch {font create TkDefaultFont -family Helvetica -size -12} - - option add *Font TkDefaultFont - option add *selectBackground #678db2 - option add *selectForeground white -} - -# -# Create, configure, and populate 8 tablelist widgets -# -frame .f -for {set n 0} { $n < 8} {incr n} { - set tbl .f.tbl$n - tablelist::tablelist $tbl \ - -columntitles {"Label 0" "Label 1" "Label 2" "Label 3"} \ - -background white -height 4 -width 40 -stretch all - if {[$tbl cget -selectborderwidth] == 0} { - $tbl configure -spacing 1 - } - - switch $n { - 1 { - $tbl configure -showseparators yes - } - 2 { - $tbl configure -stripebackground #e4e8ec - } - 3 { - $tbl configure -stripebackground #e4e8ec -showseparators yes - } - 4 { - $tbl columnconfigure 1 -background LightYellow - $tbl columnconfigure 3 -background LightCyan - } - 5 { - $tbl configure -showseparators yes - $tbl columnconfigure 1 -background LightYellow - $tbl columnconfigure 3 -background LightCyan - } - 6 { - $tbl configure -stripebackground #e4e8ec - $tbl columnconfigure 1 -background LightYellow \ - -stripebackground #e5e5c9 - $tbl columnconfigure 3 -background LightCyan \ - -stripebackground #c9e5e5 - } - 7 { - $tbl configure -stripebackground #e4e8ec -showseparators yes - $tbl columnconfigure 1 -background LightYellow \ - -stripebackground #e5e5c9 - $tbl columnconfigure 3 -background LightCyan \ - -stripebackground #c9e5e5 - } - } - - 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 -frame .bottom -height 10 - -# -# Manage the widgets -# -grid .f.tbl0 .f.tbl1 -sticky news -padx 5 -pady 5 -grid .f.tbl2 .f.tbl3 -sticky news -padx 5 -pady 5 -grid .f.tbl4 .f.tbl5 -sticky news -padx 5 -pady 5 -grid .f.tbl6 .f.tbl7 -sticky news -padx 5 -pady 5 -grid rowconfigure .f {0 1 2 3} -weight 1 -grid columnconfigure .f {0 1} -weight 1 -pack .bottom .close -side bottom -pack .f -side top -expand yes -fill both -padx 5 -pady 5 DELETED tablelist5.13/demos/styles_tile.tcl Index: tablelist5.13/demos/styles_tile.tcl ================================================================== --- tablelist5.13/demos/styles_tile.tcl +++ tablelist5.13/demos/styles_tile.tcl @@ -1,87 +0,0 @@ -#!/usr/bin/env wish - -#============================================================================== -# Demonstrates some ways of improving the look & feel of a tablelist widget. -# -# Copyright (c) 2002-2015 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) -#============================================================================== - -package require tablelist_tile 5.13 - -wm title . "Tablelist Styles" - -# -# Improve the window's appearance by using a tile -# frame as a container for the other widgets -# -set f [ttk::frame .f] - -# -# Create, configure, and populate 8 tablelist widgets -# -ttk::frame $f.f -for {set n 0} { $n < 8} {incr n} { - set tbl $f.f.tbl$n - tablelist::tablelist $tbl \ - -columntitles {"Label 0" "Label 1" "Label 2" "Label 3"} \ - -background white -stripebackground "" -height 4 -width 40 -stretch all - if {[$tbl cget -selectborderwidth] == 0} { - $tbl configure -spacing 1 - } - - switch $n { - 1 { - $tbl configure -showseparators yes - } - 2 { - $tbl configure -stripebackground #e4e8ec - } - 3 { - $tbl configure -stripebackground #e4e8ec -showseparators yes - } - 4 { - $tbl columnconfigure 1 -background LightYellow - $tbl columnconfigure 3 -background LightCyan - } - 5 { - $tbl configure -showseparators yes - $tbl columnconfigure 1 -background LightYellow - $tbl columnconfigure 3 -background LightCyan - } - 6 { - $tbl configure -stripebackground #e4e8ec - $tbl columnconfigure 1 -background LightYellow \ - -stripebackground #e5e5c9 - $tbl columnconfigure 3 -background LightCyan \ - -stripebackground #c9e5e5 - } - 7 { - $tbl configure -stripebackground #e4e8ec -showseparators yes - $tbl columnconfigure 1 -background LightYellow \ - -stripebackground #e5e5c9 - $tbl columnconfigure 3 -background LightCyan \ - -stripebackground #c9e5e5 - } - } - - 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 -ttk::frame $f.bottom -height 10 - -# -# Manage the widgets -# -grid $f.f.tbl0 $f.f.tbl1 -sticky news -padx 5 -pady 5 -grid $f.f.tbl2 $f.f.tbl3 -sticky news -padx 5 -pady 5 -grid $f.f.tbl4 $f.f.tbl5 -sticky news -padx 5 -pady 5 -grid $f.f.tbl6 $f.f.tbl7 -sticky news -padx 5 -pady 5 -grid rowconfigure $f.f {0 1 2 3} -weight 1 -grid columnconfigure $f.f {0 1} -weight 1 -pack $f.bottom $f.close -side bottom -pack $f.f -side top -expand yes -fill both -padx 5 -pady 5 -pack $f -expand yes -fill both DELETED tablelist5.13/demos/tileWidgets.tcl Index: tablelist5.13/demos/tileWidgets.tcl ================================================================== --- tablelist5.13/demos/tileWidgets.tcl +++ tablelist5.13/demos/tileWidgets.tcl @@ -1,298 +0,0 @@ -#!/usr/bin/env wish - -#============================================================================== -# Demonstrates the interactive tablelist cell editing with the aid of some -# widgets from the tile package and of the Tk core spinbox widget. -# -# Copyright (c) 2005-2015 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) -#============================================================================== - -package require tablelist_tile 5.13 - -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*Spinbox.background white -option add *Tablelist*Spinbox.readonlyBackground 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] - -# -# Improve the window's appearance by using a tile -# frame as a container for the other widgets -# -set f [ttk::frame .f] - -# -# Work around the improper appearance of the tile scrollbars in the aqua theme -# -if {[tablelist::getCurrentTheme] eq "aqua"} { - interp alias {} ttk::scrollbar {} ::scrollbar -} - -# -# Create a tablelist widget with editable columns (except the first one) -# -set tbl $f.tbl -tablelist::tablelist $tbl \ - -columns {0 "No." right - 0 "Available" center - 0 "Name" left - 0 "Baud Rate" right - 0 "Data Bits" center - 0 "Parity" left - 0 "Stop Bits" center - 0 "Handshake" left - 0 "Activation Date" center - 0 "Activation Time" center - 0 "Cable Color" center} \ - -editstartcommand editStartCmd -editendcommand editEndCmd \ - -height 0 -width 0 -if {[$tbl cget -selectborderwidth] == 0} { - $tbl configure -spacing 1 -} -$tbl columnconfigure 0 -sortmode integer -$tbl columnconfigure 1 -name available -editable yes \ - -editwindow ttk::checkbutton -formatcommand emptyStr -$tbl columnconfigure 2 -name lineName -editable yes -editwindow ttk::entry \ - -sortmode dictionary -$tbl columnconfigure 3 -name baudRate -editable yes -editwindow ttk::combobox \ - -sortmode integer -if {[info commands ttk::spinbox] eq ""} { - $tbl columnconfigure 4 -name dataBits -editable yes -editwindow spinbox -} else { - $tbl columnconfigure 4 -name dataBits -editable yes -editwindow ttk::spinbox -} -$tbl columnconfigure 5 -name parity -editable yes -editwindow ttk::combobox -$tbl columnconfigure 6 -name stopBits -editable yes -editwindow ttk::combobox -$tbl columnconfigure 7 -name handshake -editable yes -editwindow ttk::combobox -$tbl columnconfigure 8 -name actDate -editable yes -editwindow ttk::entry \ - -formatcommand formatDate -sortmode integer -$tbl columnconfigure 9 -name actTime -editable yes -editwindow ttk::entry \ - -formatcommand formatTime -sortmode integer -$tbl columnconfigure 10 -name color -editable yes \ - -editwindow ttk::menubutton -formatcommand emptyStr - -proc emptyStr val { return "" } -proc formatDate val { return [clock format $val -format "%Y-%m-%d"] } -proc formatTime val { return [clock format $val -format "%H:%M:%S"] } - -# -# Populate the tablelist widget; set the activation -# date & time to 10 minutes past the current clock value -# -set clock [expr {[clock seconds] + 600}] -for {set i 0; set n 1} {$i < 16} {set i $n; incr n} { - $tbl insert end [list $n [expr {$i < 8}] "Line $n" 9600 8 None 1 XON/XOFF \ - $clock $clock [lindex $colorNames $i]] - - set availImg [expr {($i < 8) ? "checkedImg" : "uncheckedImg"}] - $tbl cellconfigure end,available -image $availImg - $tbl cellconfigure end,color -image img[lindex $colorValues $i] -} - -set btn [ttk::button $f.btn -text "Close" -command exit] - -# -# Manage the widgets -# -pack $btn -side bottom -pady 10 -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] - - switch [$tbl columncget $col -name] { - lineName { - # - # Set an upper limit of 20 for the number of characters - # - $w configure -invalidcommand bell -validate key \ - -validatecommand {expr {[string length %P] <= 20}} - } - - baudRate { - # - # Populate the combobox and allow no more - # than 6 digits in its entry component - # - $w configure -values {50 75 110 300 1200 2400 4800 9600 19200 38400 - 57600 115200 230400 460800 921600} - $w configure -invalidcommand bell -validate key -validatecommand \ - {expr {[string length %P] <= 6 && [regexp {^[0-9]*$} %S]}} - } - - dataBits { - # - # Configure the spinbox - # - $w configure -from 5 -to 8 -state readonly - } - - parity { - # - # Populate the combobox and make it non-editable - # - $w configure -values {None Even Odd Mark Space} -state readonly - } - - stopBits { - # - # Populate the combobox and make it non-editable - # - $w configure -values {1 1.5 2} -state readonly - } - - handshake { - # - # Populate the combobox and make it non-editable - # - $w configure -values {XON/XOFF RTS/CTS None} -state readonly - } - - actDate { - # - # Set an upper limit of 10 for the number of characters - # and allow only digits and the "-" character in it - # - $w configure -invalidcommand bell -validate key -validatecommand \ - {expr {[string length %P] <= 10 && [regexp {^[0-9-]*$} %S]}} - } - - actTime { - # - # Set an upper limit of 8 for the number of characters - # and allow only digits and the ":" character in it - # - $w configure -invalidcommand bell -validate key -validatecommand \ - {expr {[string length %P] <= 8 && [regexp {^[0-9:]*$} %S]}} - } - - color { - # - # Populate the menu and make sure the menubutton will display the - # color name rather than $text, which is "", due to -formatcommand - # - set menu [$w cget -menu] - foreach name $::colorNames { - $menu add radiobutton -compound left \ - -image img$::colors($name) -label $name - } - $menu entryconfigure 8 -columnbreak 1 - return [$tbl cellcget $row,$col -text] - } - } - - return $text -} - -#------------------------------------------------------------------------------ -# editEndCmd -# -# Performs a final validation of the text contained in the edit window and gets -# the cell's internal contents. -#------------------------------------------------------------------------------ -proc editEndCmd {tbl row col text} { - switch [$tbl columncget $col -name] { - available { - # - # Update the image contained in the cell - # - set img [expr {$text ? "checkedImg" : "uncheckedImg"}] - $tbl cellconfigure $row,$col -image $img - } - - baudRate { - # - # Check whether the baud rate is an integer in the range 50..921600 - # - if {![regexp {^[0-9]+$} $text] || $text < 50 || $text > 921600} { - bell - tk_messageBox -title "Error" -icon error -message \ - "The baud rate must be an integer in the range 50..921600" - $tbl rejectinput - } - } - - actDate { - # - # Get the activation date in seconds from the last argument - # - if {[catch {clock scan $text} actDate] != 0} { - bell - tk_messageBox -title "Error" -icon error -message "Invalid date" - $tbl rejectinput - return "" - } - - # - # Check whether the activation clock value is later than the - # current one; if this is the case then make sure the cells - # "actDate" and "actTime" will have the same internal value - # - set actTime [$tbl cellcget $row,actTime -text] - set actClock [clock scan [formatTime $actTime] -base $actDate] - if {$actClock <= [clock seconds]} { - bell - tk_messageBox -title "Error" -icon error -message \ - "The activation date & time must be in the future" - $tbl rejectinput - } else { - $tbl cellconfigure $row,actTime -text $actClock - return $actClock - } - } - - actTime { - # - # Get the activation clock value in seconds from the last argument - # - set actDate [$tbl cellcget $row,actDate -text] - if {[catch {clock scan $text -base $actDate} actClock] != 0} { - bell - tk_messageBox -title "Error" -icon error -message "Invalid time" - $tbl rejectinput - return "" - } - - # - # Check whether the activation clock value is later than the - # current one; if this is the case then make sure the cells - # "actDate" and "actTime" will have the same internal value - # - if {$actClock <= [clock seconds]} { - bell - tk_messageBox -title "Error" -icon error -message \ - "The activation date & time must be in the future" - $tbl rejectinput - } else { - $tbl cellconfigure $row,actDate -text $actClock - return $actClock - } - } - - color { - # - # Update the image contained in the cell - # - $tbl cellconfigure $row,$col -image img$::colors($text) - } - } - - return $text -} DELETED tablelist5.13/demos/unchecked.gif Index: tablelist5.13/demos/unchecked.gif ================================================================== --- tablelist5.13/demos/unchecked.gif +++ tablelist5.13/demos/unchecked.gif cannot compute difference between binary files DELETED tablelist5.13/doc/adwaita.png Index: tablelist5.13/doc/adwaita.png ================================================================== --- tablelist5.13/doc/adwaita.png +++ tablelist5.13/doc/adwaita.png cannot compute difference between binary files DELETED tablelist5.13/doc/ambiance.png Index: tablelist5.13/doc/ambiance.png ================================================================== --- tablelist5.13/doc/ambiance.png +++ tablelist5.13/doc/ambiance.png cannot compute difference between binary files DELETED tablelist5.13/doc/aqua.png Index: tablelist5.13/doc/aqua.png ================================================================== --- tablelist5.13/doc/aqua.png +++ tablelist5.13/doc/aqua.png cannot compute difference between binary files DELETED tablelist5.13/doc/arrowStyles.png Index: tablelist5.13/doc/arrowStyles.png ================================================================== --- tablelist5.13/doc/arrowStyles.png +++ tablelist5.13/doc/arrowStyles.png cannot compute difference between binary files DELETED tablelist5.13/doc/baghira.png Index: tablelist5.13/doc/baghira.png ================================================================== --- tablelist5.13/doc/baghira.png +++ tablelist5.13/doc/baghira.png cannot compute difference between binary files DELETED tablelist5.13/doc/browse.png Index: tablelist5.13/doc/browse.png ================================================================== --- tablelist5.13/doc/browse.png +++ tablelist5.13/doc/browse.png cannot compute difference between binary files DELETED tablelist5.13/doc/browseTree.png Index: tablelist5.13/doc/browseTree.png ================================================================== --- tablelist5.13/doc/browseTree.png +++ tablelist5.13/doc/browseTree.png cannot compute difference between binary files DELETED tablelist5.13/doc/bwidget.png Index: tablelist5.13/doc/bwidget.png ================================================================== --- tablelist5.13/doc/bwidget.png +++ tablelist5.13/doc/bwidget.png cannot compute difference between binary files DELETED tablelist5.13/doc/config.png Index: tablelist5.13/doc/config.png ================================================================== --- tablelist5.13/doc/config.png +++ tablelist5.13/doc/config.png cannot compute difference between binary files DELETED tablelist5.13/doc/dirViewer.png Index: tablelist5.13/doc/dirViewer.png ================================================================== --- tablelist5.13/doc/dirViewer.png +++ tablelist5.13/doc/dirViewer.png cannot compute difference between binary files DELETED tablelist5.13/doc/dust.png Index: tablelist5.13/doc/dust.png ================================================================== --- tablelist5.13/doc/dust.png +++ tablelist5.13/doc/dust.png cannot compute difference between binary files DELETED tablelist5.13/doc/dustSand.png Index: tablelist5.13/doc/dustSand.png ================================================================== --- tablelist5.13/doc/dustSand.png +++ tablelist5.13/doc/dustSand.png cannot compute difference between binary files DELETED tablelist5.13/doc/embeddedWindows.png Index: tablelist5.13/doc/embeddedWindows.png ================================================================== --- tablelist5.13/doc/embeddedWindows.png +++ tablelist5.13/doc/embeddedWindows.png cannot compute difference between binary files DELETED tablelist5.13/doc/embeddedWindows_tile.png Index: tablelist5.13/doc/embeddedWindows_tile.png ================================================================== --- tablelist5.13/doc/embeddedWindows_tile.png +++ tablelist5.13/doc/embeddedWindows_tile.png cannot compute difference between binary files DELETED tablelist5.13/doc/gtk.png Index: tablelist5.13/doc/gtk.png ================================================================== --- tablelist5.13/doc/gtk.png +++ tablelist5.13/doc/gtk.png cannot compute difference between binary files DELETED tablelist5.13/doc/index.html Index: tablelist5.13/doc/index.html ================================================================== --- tablelist5.13/doc/index.html +++ tablelist5.13/doc/index.html @@ -1,62 +0,0 @@ - - - The Multi-Column Listbox and Tree Widget Package Tablelist - 5.13 - - - - - - -

-

The Multi-Column Listbox and Tree Widget Package Tablelist 5.13

- -

by

- -

Csaba Nemethi

- -
- csaba.nemethi@t-online.de -
-
- -
- -

Contents

- -

Tablelist Programmer's Guide

- -

The tablelist::tablelist - Command

- -

Commands for Interactive Sorting by One or - More Columns

- -

Helper Commands Used in Tablelist Binding - Scripts

- -

Interactive Tablelist Cell Editing Using Tk - Core Widgets

- -

Interactive Tablelist Cell Editing Using Tile - Widgets

- -

Interactive Tablelist Cell Editing Using - the BWidget Package

- -

Interactive Tablelist Cell Editing Using - the Iwidgets Package

- -

Interactive Tablelist Cell Editing Using - the combobox Package

- -

Interactive Tablelist Cell Editing Using - the ctext Package

- -

Interactive Tablelist Cell Editing Using - the Mentry Package

- -

Commands Related to Tile Themes

- - DELETED tablelist5.13/doc/klearlooks.png Index: tablelist5.13/doc/klearlooks.png ================================================================== --- tablelist5.13/doc/klearlooks.png +++ tablelist5.13/doc/klearlooks.png cannot compute difference between binary files DELETED tablelist5.13/doc/mate.png Index: tablelist5.13/doc/mate.png ================================================================== --- tablelist5.13/doc/mate.png +++ tablelist5.13/doc/mate.png cannot compute difference between binary files DELETED tablelist5.13/doc/mint.png Index: tablelist5.13/doc/mint.png ================================================================== --- tablelist5.13/doc/mint.png +++ tablelist5.13/doc/mint.png cannot compute difference between binary files DELETED tablelist5.13/doc/newWave.png Index: tablelist5.13/doc/newWave.png ================================================================== --- tablelist5.13/doc/newWave.png +++ tablelist5.13/doc/newWave.png cannot compute difference between binary files DELETED tablelist5.13/doc/oxygen1.png Index: tablelist5.13/doc/oxygen1.png ================================================================== --- tablelist5.13/doc/oxygen1.png +++ tablelist5.13/doc/oxygen1.png cannot compute difference between binary files DELETED tablelist5.13/doc/oxygen2.png Index: tablelist5.13/doc/oxygen2.png ================================================================== --- tablelist5.13/doc/oxygen2.png +++ tablelist5.13/doc/oxygen2.png cannot compute difference between binary files DELETED tablelist5.13/doc/phase.png Index: tablelist5.13/doc/phase.png ================================================================== --- tablelist5.13/doc/phase.png +++ tablelist5.13/doc/phase.png cannot compute difference between binary files DELETED tablelist5.13/doc/plastik.png Index: tablelist5.13/doc/plastik.png ================================================================== --- tablelist5.13/doc/plastik.png +++ tablelist5.13/doc/plastik.png cannot compute difference between binary files DELETED tablelist5.13/doc/plastique.png Index: tablelist5.13/doc/plastique.png ================================================================== --- tablelist5.13/doc/plastique.png +++ tablelist5.13/doc/plastique.png cannot compute difference between binary files DELETED tablelist5.13/doc/radiance.png Index: tablelist5.13/doc/radiance.png ================================================================== --- tablelist5.13/doc/radiance.png +++ tablelist5.13/doc/radiance.png cannot compute difference between binary files DELETED tablelist5.13/doc/styles.png Index: tablelist5.13/doc/styles.png ================================================================== --- tablelist5.13/doc/styles.png +++ tablelist5.13/doc/styles.png cannot compute difference between binary files DELETED tablelist5.13/doc/stylesheet.css Index: tablelist5.13/doc/stylesheet.css ================================================================== --- tablelist5.13/doc/stylesheet.css +++ tablelist5.13/doc/stylesheet.css @@ -1,8 +0,0 @@ -/* generic class defining a top margin whose height equals the font size */ -.tm {margin-top: 1em} - -/* background and border for the
 tag */
-pre {background: #F7F7F7; border: silver solid 1px}
-
-/* color for the  tag */
-span {color: #E00000}

DELETED tablelist5.13/doc/tablelist.html
Index: tablelist5.13/doc/tablelist.html
==================================================================
--- tablelist5.13/doc/tablelist.html
+++ tablelist5.13/doc/tablelist.html
@@ -1,2684 +0,0 @@
-
-
-  Tablelist Programmer's Guide
-
-  
-  
-
-  
-
-
-
-  
-

Tablelist Programmer's Guide

- -

For Tablelist Version 5.13

- -

by

- -

Csaba Nemethi

- -
- csaba.nemethi@t-online.de -
-
-
- -

Contents

- -

Overview

- - - -

Examples

- - - - -
- -

Overview

- -

What is Tablelist?

- -

Tablelist is a library package for Tcl/Tk versions 8.0 or higher, written - in pure Tcl/Tk code.  It contains:

- -
    -
  • the implementation of the tablelist mega-widget, including a - general utility module for mega-widgets;
  • - -
  • a demo script containing a useful procedure that displays the - configuration options of an arbitrary widget in a tablelist and enables you - to edit their values interactively;
  • - -
  • a demo script implementing a widget browser based on a tablelist used - as multi-column listbox;
  • - -
  • a demo script implementing a widget browser based on a tablelist used - as multi-column tree widget;
  • - -
  • a demo script implementing a directory viewer based on a tablelist used - as multi-column tree widget;
  • - -
  • a demo script showing several ways to improve the appearance of a - tablelist widget;
  • - -
  • four further demo scripts, illustrating the interactive cell editing - with the aid of various widgets from the Tk core and from the packages - tile, BWidget, Iwidgets, combobox (by Bryan Oakley), and Mentry;
  • - -
  • one further demo script, with a tablelist widget containing embedded - windows;
  • - -
  • tile-based counterparts of the above-mentioned demo scripts;
  • - -
  • this tutorial;
  • - -
  • reference pages in HTML format.
  • -
- -

A tablelist is a multi-column listbox and tree widget.  The width of - each column can be dynamic (i.e., just large enough to hold all its elements, - including the header) or static (specified in characters or pixels).  - The columns are, per default, resizable.  The alignment of each column - can be specified as left, right, or - center.

- -

The columns, rows, and cells can be configured individually.  Several - of the global and column-specific options refer to the headers, implemented - as label widgets.  For instance, the -labelcommand option - specifies a Tcl command to be invoked when mouse button 1 is released over a - label.  The most common value of this option sorts the items based on - the respective column.

- -

The Tablelist package provides a great variety of tree styles controlling - the look & feel of the column that displays the tree hierarchy with the - aid of indentations and expand/collapse controls.

- -

Interactive editing of the elements of a tablelist widget can be enabled - for individual cells and for entire columns.  A great variety of widgets - from the Tk core and from the packages tile, BWidget, Iwidgets, combobox, - ctext, and Mentry (or Mentry_tile) is supported for being used as embedded - edit window.  In addition, a rich set of keyboard bindings is provided - for a comfortable navigation between the editable cells.

- -

The Tcl command corresponding to a tablelist widget is very similar to the - one associated with a normal listbox.  There are column-, row-, and - cell-specific counterparts of the configure and - cget subcommands (columnconfigure, - rowconfigure, cellconfigure, ...).  They can - be used, among others, to insert images into the cells and the header labels, - or to insert embedded windows into the cells.  The index, - nearest, and see command options refer to the rows, - but similar subcommands are provided for the columns and cells - (columnindex, cellindex, ...).  The items can - be sorted with the sort, sortbycolumn, and - sortbycolumnlist command options.

- -

The bindings defined for the body of a tablelist widget make it behave - just like a normal listbox.  This includes the support for the virtual - event <<ListboxSelect>> (which is equivalent to - <<TablelistSelect>>).  In addition, versions - 2.3 or higher of the widget callback package Wcb (written in pure Tcl/Tk code - as well) can be used to define callbacks for the activate,  - selection set,  and  selection - clear  commands, and Wcb versions 3.0 or higher also support - callbacks for the activatecellcellselection - set,  and  cellselection clear  - commands.  The download location of Wcb is

- -
-
- http://www.nemethi.de -
-
- -

How to Get It?

- -

Tablelist is available for free download from the same URL as Wcb.  - The distribution file is tablelist5.13.tar.gz for UNIX and - tablelist5_13.zip for Windows.  These files contain the - same information, except for the additional carriage return character - preceding the linefeed at the end of each line in the text files for - Windows.

- -

Tablelist is also included in tklib, which has the address

- -
-
- http://core.tcl.tk/tklib -
-
- -

How to Install It?

- -

Install the package as a subdirectory of one of the directories given by - the auto_path variable.  For example, you can install it as - a directory at the same level as the Tcl and Tk script libraries.  The - locations of these library directories are given by the - tcl_library and tk_library variables, - respectively.

- -

To install Tablelist on UNIX, cd to the desired - directory and unpack the distribution file - tablelist5.13.tar.gz:

- -
-
-gunzip -c tablelist5.13.tar.gz | tar -xf -
-
-
- -

This command will create a directory named tablelist5.13, - with the subdirectories demos, doc, and - scripts.

- -

On Windows, use WinZip or some other program capable of unpacking - the distribution file tablelist5_13.zip into the directory - tablelist5.13, with the subdirectories demos, - doc, and scripts.

- -

The file tablelistEdit.tcl in the scripts - directory is only needed for applications making use of interactive cell - editing.  Similarly, the file tablelistMove.tcl in the same - directory is only required for scripts invoking the move or - movecolumn command.  Finally, the file - tablelistThemes.tcl is only needed for applications using the - package Tablelist_tile (see next section).

- -

Next, you should check the exact version number of your Tcl/Tk - distribution, given by the tcl_patchLevel and - tk_patchLevel variables.  If you are using Tcl/Tk version - 8.2.X, 8.3.0 - 8.3.2, or 8.4a1, then you should upgrade your Tcl/Tk - distribution to a higher release.  This is because a bug in these Tcl - versions (fixed in Tcl 8.3.3 and 8.4a2) causes excessive memory use when - calling  info exists  on non-existent array elements, - and Tablelist makes a lot of invocations of this command.

- -

If for some reason you cannot upgrade your Tcl/Tk version, then you should - execute the Tcl script repair.tcl in the directory - scripts.  This script makes backup copies of several files - contained in this directory, and then creates new versions of them by - replacing all invocations of  info exists  for array - elements with a call to the helper procedure - arrElemExists.  The patched files work with all Tcl/Tk - releases starting with 8.0, but the original ones have a much better - performance.

- -

Notice that in tklib the Tablelist demos directory is - replaced with the subdirectory tablelist of the - examples directory.  Please take this into account when - reading the examples below.

- -

How to Use It?

- -

The Tablelist distribution provides two packages, called Tablelist - and Tablelist_tile.  The main difference between the two is that - Tablelist_tile enables the tile-based, theme-specific appearance of tablelist - widgets; this package requires Tcl/Tk 8.4 or higher and tile 0.6 or - higher.  It is not possible to use both packages in one and the same - application, because both are implemented in the same tablelist - namespace and provide identical commands.

- -

To be able to access the commands and variables defined in the package - Tablelist, your scripts must contain one of the lines

- -
-
-package require tablelist ?version?
-package require Tablelist ?version?
-
-
- -

You can use either one of the two statements above because the file - tablelist.tcl contains both lines

- -
-
-package provide tablelist ...
-package provide Tablelist ...
-
-
- -

Likewise, to be able to access the commands and variables defined in the - package Tablelist_tile, your scripts must contain one of the lines

- -
-
-package require tablelist_tile ?version?
-package require Tablelist_tile ?version?
-
-
- -

Again, you can use either one of the two statements above because the file - tablelist_tile.tcl contains both lines

- -
-
-package provide tablelist_tile ...
-package provide Tablelist_tile ...
-
-
- -

You are free to remove one of the above lines from - tablelist.tcl and tablelist_tile.tcl, respectively, - if you want to prevent the corresponding packages from making themselves - known under two different names each.  Of course, by doing so you - restrict the argument of  package require  to a single - name per package.

- -

Please note that ActiveTcl versions 8.5 and later use a modified - package mechanism, which only exports the all-lowercase names - tablelist and tablelist_tile.

- -

REMARK:  If you have an earlier Tablelist version as part of - ActiveTcl 8.5 or above and the new Tablelist release 5.13, then it is highly - recommended to specify the version number 5.13 in the  - package require  command, because otherwise the interpreter - will load the old Tablelist version included in ActiveTcl as Tcl - Module.  The examples below use the - statement  package require tablelist 5.13,  and their - tile-based counterparts invoke the command  package require - tablelist_tile 5.13.

- -

Since the packages Tablelist and Tablelist_tile are implemented in the - tablelist namespace, you must either invoke the

- -
-
-namespace import tablelist::pattern ?tablelist::pattern ...?
-
-
- -

command to import the procedures you need, or use qualified names - like tablelist::tablelist.  In the examples below we have - chosen the latter approach.

- -

To access Tablelist variables, you must use qualified - names.  There are only three Tablelist variables (and one more when - using Tablelist_tile) that are designed to be accessed outside the namespace - tablelist:

- -
    -
  • The variable tablelist::version holds the current version - number of the Tablelist and Tablelist_tile packages.
  • - -
  • The variable tablelist::library holds the location of the - Tablelist installation directory.
  • - -
  • The read-only variable tablelist::usingTile has the value - 0 in the package Tablelist and the value 1 in - Tablelist_tile.
  • - -
  • In Tablelist_tile the array tablelist::themeDefaults holds - the theme-specific default values of a series of Tablelist configuration - options.
  • -
- -

More on Tablelist_tile

- -

A tablelist widget consists of a body (containing the items) and a header - (displaying the column titles).  Both components are contained in a - hull, implemented as a frame.  The header has a rather complex - structure, consisting mainly of frame and label widgets.  While in the - Tablelist package all of these components are Tk widgets, the Tablelist_tile - package uses both Tk and tile frame and label widgets.  Due to several - incompatibilities between Tk and tile, it is currently not possible to - replace all Tk widgets making up a tablelist with their tile - counterparts.

- -

From the above it follows that the package Tablelist_tile will only - work as expected if the Tk frame and label commands - haven't been overridden by using  namespace import -force - ttk::*  at global scope.  While earlier tile releases - suggested using this command at global scope for the really adventurous, in - newer tile versions this is considered a Really Bad Idea, causing many things - to break.  Instead, you should explicitly invoke - ttk::frame, ttk::label, etc. whenever you want to - use a tile widget.

- -

Overriding some other Tk widgets at global scope may be equally - dangerous when using various widgets from the Tk core and from the packages - BWidget, Iwidgets, combobox (by Bryan Oakley), ctext, and Mentry for - interactive cell editing, because these packages expect Tk widgets, which - may not always be replaced by their tile counterparts.

- -

Another restriction to be taken into account (as of tile version 0.8) is - due to the fact that the  (ttk::)style theme use  - command can only be used to set the current theme, but not to retrieve - it.  For this reason, the package Tablelist_tile makes use of the - variable ttk::currentTheme or tile::currentTheme - (depending on the tile version), which is set by the - ttk::setTheme or tile::setTheme procedure.  - From this it follows that the tile-based tablelist widgets will only have - the expected appearance if the platform-specific default theme is either left - unchanged or replaced with another theme by invoking the procedure - ttk::setTheme or tile::setTheme, depending on the - current tile version.  (See also the tablelist::setTheme command.)

- -

After these cautions concerning the use of tile, the rest of this section - describes the differences between the packages Tablelist and - Tablelist_tile.

- -

The Tablelist_tile package checks whether the required Tcl, Tk, and tile - versions are present, by executing the commands

- -
-
-package require Tcl 8.4
-package require Tk  8.4
-if {$::tk_version < 8.5 || [regexp {^8\.5a[1-5]$} $::tk_patchLevel]} {
-    package require tile 0.6
-}
-
-
- -

The last command above reflects the fact that, beginning with Tk 8.5a6, - tile is integrated into the Tk core and therefore it should only be loaded - explicitly when using an earlier Tk version.

- -

Apart from this and the _tile suffix in the  - package require  command, the only difference (from the - programmer's point of view) between the packages Tablelist and Tablelist_tile - is related to the supported configuration options:  The - -highlightbackground, -highlightcolor, - -highlightthickness, -labelbackground, - -labelactivebackground, -labelactiveforeground, - -labeldisabledforeground, and -labelheight options - (the latter at both widget and column levels), present in the Tablelist - package, are not supported by Tablelist_tile.  The first three are - standard Tk widget options that are not available for tile widgets.  The - -labelbackground option stands for the -background - option of the column labels, and current versions of the tile engine don't - support setting the background color for these widgets with a special header - layout.  The remaining options stand for the - -activebackground, -activeforeground, - -disabledforeground, and -height options of the - column labels, and these configuration options are not supported for tile - label widgets.

- -

Also, take into account that in some themes, setting the - -labelborderwidth option (at widget or column level) to a value - other than the default might be ignored by tile and thus could cause - alignment problems.  This is because the border of tile widgets is drawn - with theme-specific methods, which will not always produce the results known - from Tk widgets.

- -

Finally, notice that, when using the tileqt theme, the - version number of the tile::theme::tileqt package must be 0.4 or - higher, and tileqt itself won't work with tile versions earlier - than 0.7.

- -
-

Contents     Start page

-
-
- -

Examples

- -

A tablelist Widget for Displaying and Editing - Configuration Options

- -

The file config.tcl in the demos directory - contains a procedure demo::displayConfig that displays the - configuration options of an arbitrary widget in a tablelist contained in a - newly created top-level widget and allows you to edit these options.  - This procedure can prove to be quite useful during interactive GUI - development.  To test it, start wish and evaluate the file - by using the source command as follows:

- -
    -
  • If wish was started in the demos directory - then it is sufficient to enter - -
    -
    -source config.tcl
    -
    -
    -
  • - -
  • If wish was started in some other directory then you can - use the tablelist::library variable to find the location of - the file.  For example, assuming that your Tablelist installation has - the directory structure described in the How to - install it? section, the required commands are: - -
    -
    -package require tablelist 5.13
    -source [file join $tablelist::library demos config.tcl]
    -
    -
    -
  • -
- -

In both cases, the script will print the following message to - stdout:

- -
-
-To display the configuration options of an arbitrary widget, enter
-
-        demo::displayConfig <widgetName>
-
-
- -

The result looks like in the following figure:

- -
- Configuration Options -
- -

It is assumed that the Tcl command associated with the widget specified by - <widgetName> has a configure subcommand - which, when invoked without any argument, returns a list describing all of - the available configuration options for the widget, in the common format - known from the standard Tk widgets.  The - demo::displayConfig procedure inserts the items of this list - into a scrolled tablelist with 5 dynamic-width columns and interactive sort - capability, and returns the name of the newly created tablelist widget:

- -
-
-package require tablelist 5.13
-
-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 top-level widget of the class DemoTop:
-    #
-    # Name              Class
-    # -----------------------------
-    # tf                Frame
-    #   tbl               Tabellist
-    #   vsb, hsb          Scrollbar
-    # bf                Frame
-    #   b1, b2, b3        Button
-    #
-    variable winSys
-    if {[catch {tk windowingsystem} winSys] != 0} {
-        switch $::tcl_platform(platform) {
-            unix        { set winSys x11 }
-            windows     { set winSys win32 }
-            macintosh   { set winSys classic }
-        }
-    }
-    if {[string compare $winSys "x11"] == 0} {
-        #
-        # Create the font TkDefaultFont if not yet present
-        #
-        catch {font create TkDefaultFont -family Helvetica -size -12}
-
-        option add *DemoTop*Font                        TkDefaultFont
-        option add *DemoTop*selectBackground            #678db2
-        option add *DemoTop*selectForeground            white
-    } else {
-        option add *DemoTop.tf.borderWidth              1
-        option add *DemoTop.tf.relief                   sunken
-        option add *DemoTop.tf.tbl.borderWidth          0
-        option add *DemoTop.tf.tbl.highlightThickness   0
-    }
-    option add *DemoTop.tf.tbl.background               white
-    option add *DemoTop.tf.tbl.stripeBackground         #e4e8ec
-    option add *DemoTop.tf.tbl.setGrid                  yes
-    option add *DemoTop.tf.tbl*Entry.background         white
-    option add *DemoTop.bf.Button.width                 10
-}
-
-#------------------------------------------------------------------------------
-# demo::displayConfig
-#
-# Displays the configuration options of the widget w in a tablelist widget
-# contained in a newly created top-level widget.  Returns the name of the
-# tablelist widget.
-#------------------------------------------------------------------------------
-proc demo::displayConfig w {
-    if {![winfo exists $w]} {
-        bell
-        tk_messageBox -title "Error" -icon error -message \
-            "Bad window path name \"$w\""
-        return ""
-    }
-
-    #
-    # Create a top-level widget of the class DemoTop
-    #
-    set top .configTop
-    for {set n 2} {[winfo exists $top]} {incr n} {
-        set top .configTop$n
-    }
-    toplevel $top -class DemoTop
-    wm title $top "Configuration Options of the [winfo class $w] Widget \"$w\""
-
-    #
-    # Create a scrolled tablelist widget with 5 dynamic-width
-    # columns and interactive sort capability within the top-level
-    #
-    set tf $top.tf
-    frame $tf
-    set tbl $tf.tbl
-    set vsb $tf.vsb
-    set hsb $tf.hsb
-    tablelist::tablelist $tbl \
-        -columns {0 "Command-Line Name"
-                  0 "Database/Alias Name"
-                  0 "Database Class"
-                  0 "Default Value"
-                  0 "Current Value"} \
-        -labelcommand tablelist::sortByColumn -sortcommand demo::compareAsSet \
-        -editendcommand demo::applyValue -height 15 -width 100 -stretch all \
-        -xscrollcommand [list $hsb set] -yscrollcommand [list $vsb set]
-    if {[$tbl cget -selectborderwidth] == 0} {
-        $tbl configure -spacing 1
-    }
-    $tbl columnconfigure 3 -maxwidth 30
-    $tbl columnconfigure 4 -maxwidth 30 -editable yes
-    scrollbar $vsb -orient vertical   -command [list $tbl yview]
-    scrollbar $hsb -orient horizontal -command [list $tbl xview]
-
-    #
-    # Create three buttons within a frame child of the top-level widget
-    #
-    set bf $top.bf
-    frame $bf
-    set b1 $bf.b1
-    set b2 $bf.b2
-    set b3 $bf.b3
-    button $b1 -text "Refresh"     -command [list demo::putConfig $w $tbl]
-    button $b2 -text "Sort as Set" -command [list $tbl sort]
-    button $b3 -text "Close"       -command [list destroy $top]
-
-    #
-    # Manage the widgets
-    #
-    grid $tbl -row 0 -rowspan 2 -column 0 -sticky news
-    variable winSys
-    if {[string compare $winSys "aqua"] == 0} {
-        grid [$tbl cornerpath] -row 0 -column 1 -sticky ew
-        grid $vsb              -row 1 -column 1 -sticky ns
-    } else {
-        grid $vsb -row 0 -rowspan 2 -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 10
-    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
-    return $tbl
-}
-
-
- -

The procedure invokes the tablelist::tablelist command to create a - tablelist widget.  The value of the -columns option passed to this - command specifies the widths, titles, and alignments of the 5 columns.  - The width of each column is given as 0, specifying that the - column's width is to be made just large enough to hold all the elements in - the column, including its title, which is the string following the - width.  We have omitted the alignment specifications (which can - optionally follow the titles), because the columns shall all be - left-justified.

- -

Since all columns are of dynamic width and left-aligned, instead of - -columns we could have used the -columntitles option as - follows:

- -
-
-    tablelist::tablelist $tbl \
-        -columntitles {"Command-Line Name"
-                       "Database/Alias Name"
-                       "Database Class"
-                       "Default Value"
-                       "Current Value"} \
-        . . .
-
-
- -

The command tablelist::sortByColumn, - specified as the value of the -labelcommand option, will be - invoked whenever mouse button 1 is released over one of the labels.  - This command sorts the items based on the column corresponding to that label, - in the right order, by invoking the sortbycolumn subcommand of the - Tcl command associated with the tablelist widget.

- -

As seen from the creation of the button displaying the text  - "Sort as Set",  the items will also be sorted by invoking - the sort - subcommand.  This makes it necessary to specify a command to be used for - the comparison of the items, as the value of the -sortcommand option.  In - our example this is the demo::compareAsSet procedure shown - below.

- -

The -editendcommand option - specifies the command to be invoked automatically whenever the interactive - editing of a cell's contents is finished and the final contents of the - temporary embedded entry widget used for the editing are different from its - original one.  Per default, the elements of a tablelist widget can only - be edited programmatically, but we enable the interactive editing for the - cells of the last column with the aid of the -editable column configuration - option.

- -

By specifying the value all for the -stretch configuration option we - make sure that all of the columns will be stretched to eliminate the blank - space that might appear at the right of the table.

- -

If the default value of the -selectborderwidth option is - 0 (this is the case on the Windows and Macintosh platforms, and - also in an X11 envronment with Tk 8.5 or above) then we use the - -spacing option to - provide some additional space above and below the rows.

- -

For the last two columns of the tablelist we use the -maxwidth column configuration - option, to make sure that the dynamic widths of these columns won't exceed 30 - average-width characters.

- -

Besides the options given on the command line, our tablelist widget will - automatically inherit the ones contained in the Tk option database entries - specified in the namespace initialization preceding the - demo::displayConfig procedure.  The database name - stripeBackground corresponds to the -stripebackground - configuration option.  According to this entry, every other row of the - tablelist widget will be displayed in the background color - #e4e8ec, which improves the readability of the items and gives - the widget a nice appearance.

- -

The option database entries given for the windowing systems other than - x11 are implicitly used when managing the tablelist widget and - the two scrollbars with the aid of grid.  Notice how the - cornerpath - subcommand enables us to achieve a native look & feel with respect to the - vertical scrollbar on the windowing system aqua.

- -

We populate the tablelist by invoking the demo::putConfig - procedure discussed below.  The same script is associated with the - Refresh button, as the value of its -command - configuration option.  This procedure is implemented as follows:

- -
-
-#------------------------------------------------------------------------------
-# demo::putConfig
-#
-# Outputs the configuration options of the widget w into the tablelist widget
-# tbl.
-#------------------------------------------------------------------------------
-proc demo::putConfig {w tbl} {
-    if {![winfo exists $w]} {
-        bell
-        tk_messageBox -title "Error" -icon error -message \
-            "Bad window path name \"$w\"" -parent [winfo toplevel $tbl]
-        return ""
-    }
-
-    #
-    # Display the configuration options of w in the tablelist widget tbl
-    #
-    $tbl delete 0 end
-    foreach configSet [$w configure] {
-        #
-        # Insert the list configSet into the tablelist widget
-        #
-        $tbl insert end $configSet
-
-        if {[llength $configSet] == 2} {
-            $tbl rowconfigure end -foreground gray50 -selectforeground gray75
-            $tbl cellconfigure end -editable no
-        } else {
-            #
-            # Change the colors of the first and last cell of the row
-            # if the current value is different from the default one
-            #
-            set default [lindex $configSet 3]
-            set current [lindex $configSet 4]
-            if {[string compare $default $current] != 0} {
-                foreach col {0 4} {
-                    $tbl cellconfigure end,$col \
-                         -foreground red -selectforeground yellow
-                }
-            }
-        }
-    }
-
-    $tbl sortbycolumn 0
-    $tbl activate 0
-    $tbl attrib widget $w
-}
-
-
- -

After deleting the current items of the tablelist widget tbl, - the procedure inserts the items of the list returned by the - configure subcommand of the Tcl command associated with the - widget w.  For each option that is merely an abbreviated - form of some other one, we use the rowconfigure tablelist - subcommand to change the normal and selection foreground colors of the item - just appended, and we disable the interactive editing in the last inserted - cell by using the -editable cell configuration - option.  The cellconfigure tablelist - operation is also invoked for each real option whose current value is - different from the default one, to change the values of the - -foreground and -selectforeground options of the - cells no. 0 and 4, containing the command-line name of the option and its - current value.

- -

Each tablelist widget may have any number of private attributes, - which can be set and retrieved with the aid of the attrib subcommand of the Tcl command - corresponding to the widget.  The demo::putConfig procedure - sets the widget attribute to the name of the widget whose - options are displayed in the tablelist.

- -

The implementation of the comparison command - demo::compareAsSet mentioned above is quite simple:

- -
-
-#------------------------------------------------------------------------------
-# demo::compareAsSet
-#
-# Compares two items of a tablelist widget used to display the configuration
-# options of an arbitrary widget.  The item in which the current value is
-# different from the default one is considered to be less than the other; if
-# both items fulfil this condition or its negation then string comparison is
-# applied to the two option names.
-#------------------------------------------------------------------------------
-proc demo::compareAsSet {item1 item2} {
-    foreach {opt1 dbName1 dbClass1 default1 current1} $item1 \
-            {opt2 dbName2 dbClass2 default2 current2} $item2 {
-        set changed1 [expr {[string compare $default1 $current1] != 0}]
-        set changed2 [expr {[string compare $default2 $current2] != 0}]
-        if {$changed1 == $changed2} {
-            return [string compare $opt1 $opt2]
-        } elseif {$changed1} {
-            return -1
-        } else {
-            return 1
-        }
-    }
-}
-
-
- -

Finally, here is the implementation of the demo::applyValue - procedure, specified as the value of the -editendcommand - option:

- -
-
-#------------------------------------------------------------------------------
-# demo::applyValue
-#
-# Applies the new value of the configuraton option contained in the given row
-# of the tablelist widget tbl to the widget whose options are displayed in it,
-# and updates the colors of the first and last cell of the row.
-#------------------------------------------------------------------------------
-proc demo::applyValue {tbl row col text} {
-    #
-    # Try to apply the new value of the option contained in
-    # the given row to the widget whose options are displayed
-    # in the tablelist; reject the value if the attempt fails
-    #
-    set w [$tbl attrib widget]
-    set opt [$tbl cellcget $row,0 -text]
-    if {[catch {$w configure $opt $text} result] != 0} {
-        bell
-        tk_messageBox -title "Error" -icon error -message $result \
-            -parent [winfo toplevel $tbl]
-        $tbl rejectinput
-        return ""
-    }
-
-    #
-    # Replace the new option value with its canonical form and
-    # update the colors of the first and last cell of the row
-    #
-    set text [$w cget $opt]
-    set default [$tbl cellcget $row,3 -text]
-    if {[string compare $default $text] == 0} {
-        foreach col {0 4} {
-            $tbl cellconfigure $row,$col \
-                 -foreground "" -selectforeground ""
-        }
-    } else {
-        foreach col {0 4} {
-            $tbl cellconfigure $row,$col \
-                 -foreground red -selectforeground yellow
-        }
-    }
-
-    return $text
-}
-
-
- -

The procedure retrieves the name of the widget whose options are displayed - in the tablelist, as the value of its widget attribute, and - invokes the cellcget - tablelist subcommand to get the name of the option specified in the first - cell of the row whose last element was just edited.  Next, it tries to - apply the new value of the option to the widget, and invokes the - rejectinput - subcommand if the attempt fails.  Otherwise it replaces the new option - value with its canonical form and updates the normal and selection foreground - colors of the cells no. 0 and 4.  The canonical form of the option value - is given by the cget subcommand of the Tcl command associated - with that widget.  For example, a boolean value will always be replaced - with 1 or 0, even if the entry contains the string - yes or no.  The procedure returns this - canonical option value, thus making sure that the latter will become the new - contents of the cell that was just edited.

- -

Two Widget Browsers Based on a tablelist

- -

The files browse.tcl and browseTree.tcl in the - demos directory contain a procedure - demo::displayChildren that displays information about the - children of an arbitrary widget in a tablelist contained in a newly created - top-level widget.  To test it, start wish and evaluate the - chosen file by using the source command, in a similar way as in - the case of the previous example.

- -

Both scripts will print the following message to stdout:

- -
-
-To display information about the children of an arbitrary widget, enter
-
-        demo::displayChildren <widgetName>
-
-
- -

The tablelist created by the procedure demo::displayChildren - in the file browse.tcl is a multi-column listbox:

- -
- Widget Browser -
- -

The tablelist created by the procedure of the same name in the file - browseTree.tcl is a multi-column tree widget:

- -
- Widget Browser -
- -

The demo::displayChildren command inserts some data of the - children of the widget specified by <widgetName> into a - vertically scrolled tablelist with 9 dynamic-width columns and interactive - sort capability, and returns the name of the newly created tablelist - widget.  By double-clicking an item or invoking the first entry of a - pop-up menu within the body of the tablelist, you can display the data of the - children of the widget corresponding to the selected item, and with the - second menu entry you can display its configuration options (see the previous example for details).  To go one level up, - click on the Parent button.

- -

There is a lot of code common to the scripts browse.tcl and - browseTree.tcl.  We will restrict the description below to - the second one, which requires Tk 8.3 or later, due to the use of several - tree-related tablelist options and subcommands.

- -
-
-package require Tk 8.3
-package require tablelist 5.13
-
-namespace eval demo {
-    variable dir [file dirname [info script]]
-
-    #
-    # Create two images, needed in the procedure putChildren
-    #
-    variable leafImg [image create bitmap -file [file join $dir leaf.xbm] \
-                      -background coral -foreground gray50]
-    variable compImg [image create bitmap -file [file join $dir comp.xbm] \
-                      -background yellow -foreground gray50]
-}
-
-source [file join $demo::dir config.tcl]
-
-#------------------------------------------------------------------------------
-# demo::displayChildren
-#
-# Displays information on the children of the widget w in a tablelist widget
-# contained in a newly created top-level widget.  Returns the name of the
-# tablelist widget.
-#------------------------------------------------------------------------------
-proc demo::displayChildren w {
-    if {![winfo exists $w]} {
-        bell
-        tk_messageBox -title "Error" -icon error -message \
-            "Bad window path name \"$w\""
-        return ""
-    }
-
-    #
-    # Create a top-level widget of the class DemoTop
-    #
-    set top .browseTop
-    for {set n 2} {[winfo exists $top]} {incr n} {
-        set top .browseTop$n
-    }
-    toplevel $top -class DemoTop
-
-    #
-    # Create a vertically scrolled tablelist widget with 9 dynamic-width
-    # columns and interactive sort capability within the top-level
-    #
-    set tf $top.tf
-    frame $tf
-    set tbl $tf.tbl
-    set vsb $tf.vsb
-    tablelist::tablelist $tbl \
-        -columns {0 "Path Name" left
-                  0 "Class"     left
-                  0 "X"         right
-                  0 "Y"         right
-                  0 "Width"     right
-                  0 "Height"    right
-                  0 "Mapped"    center
-                  0 "Viewable"  center
-                  0 "Manager"   left} \
-        -expandcommand demo::expandCmd -labelcommand demo::labelCmd \
-        -yscrollcommand [list $vsb set] -setgrid no -width 0
-    if {[$tbl cget -selectborderwidth] == 0} {
-        $tbl configure -spacing 1
-    }
-    foreach col {2 3 4 5} {
-        $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
-    #
-    foreach l [$tbl labels] {
-        bind $l <Configure> [list demo::updateItemsDelayed $tbl]
-    }
-    bind $tbl <Configure> [list demo::updateItemsDelayed $tbl]
-
-    #
-    # Create a pop-up menu with two command entries; bind the script
-    # associated with its first entry to the <Double-1> event, too
-    #
-    set menu $top.menu
-    menu $menu -tearoff no
-    $menu add command -label "Display Children" \
-                      -command [list demo::putChildrenOfSelWidget $tbl]
-    $menu add command -label "Display Config" \
-                      -command [list demo::dispConfigOfSelWidget $tbl]
-    set bodyTag [$tbl bodytag]
-    bind $bodyTag <Double-1>   [list demo::putChildrenOfSelWidget $tbl]
-    bind $bodyTag <<Button3>>  [bind TablelistBody <Button-1>]
-    bind $bodyTag <<Button3>> +[bind TablelistBody <ButtonRelease-1>]
-    bind $bodyTag <<Button3>> +[list demo::postPopupMenu $top %X %Y]
-
-    #
-    # Create three buttons within a frame child of the top-level widget
-    #
-    set bf $top.bf
-    frame $bf
-    set b1 $bf.b1
-    set b2 $bf.b2
-    set b3 $bf.b3
-    button $b1 -text "Refresh"
-    button $b2 -text "Parent"
-    button $b3 -text "Close" -command [list destroy $top]
-
-    #
-    # Manage the widgets
-    #
-    . . .
-
-    #
-    # Populate the tablelist with the data of the given widget's children
-    #
-    putChildren $w $tbl root
-    return $tbl
-}
-
-
- -

The procedure invokes the tablelist::tablelist command to create a - tablelist widget.  The value of the -columns option passed to this - command specifies the widths, titles, and alignments of the 9 columns.  - The width of each column is given as 0, specifying that the - column's width is to be made just large enough to hold all the elements in - the column, including its title, which is the string following the - width.  Each of the titles is followed by an alignment, which indicates - how to justify both the elements and the title of the respective column.

- -

We want to display not only the data of the given widget's children, but - also those of its further descendants.  To this end, we need a command - to be invoked whenever an item corresponding to a widget with children gets - expanded.  This command is specified as the value of the -expandcommand option.  - As discussed later, the demo::expandCmd procedure will insert - the children of the row that is about to be expanded, if it has no children - yet.

- -

The command demo::labelCmd, specified as the value of the - -labelcommand - option, will be invoked whenever mouse button 1 is released over one of the - labels.  We will discuss this procedure later.

- -

We specify the value 0 for the widget's -width option, meaning that the - tablelist's width shall be made just large enough to hold all its - columns.

- -

After creating the tablelist widget, we make sure that the elements of its - columns 2, 3, 4, and 5 (displaying the x and y coordinates as well as the - widths and heights of the children) will be compared as integers when sorting - the items based on one of these columns.  We do this with the aid of the - columnconfigure tablelist - operation.

- -

The same columnconfigure subcommand enables us to specify - that, when displaying the elements of columns 6 and 7 (having the titles - "Mapped" and "Viewable", respectively), the boolean - values 1 and 0 will be replaced with the strings - "yes" and "no", returned by the - demo::formatBoolean command shown below.

- -

After creating the vertical scrollbar, we iterate over the elements of the - list containing the path names of all header labels of the tablelist widget, - returned by the labels - subcommand of the Tcl command corresponding to the widget.  For each - element of the list, we bind the procedure - demo::updateItemsDelayed to the <Configure> - event.  In this way we make sure the procedure will be invoked whenever - the header label indicated by that list element changes size.

- -

The four invocations of the bind command following the - creation of the pop-up menu make use of a binding tag whose name depends on - the path name of the tablelist widget and is returned by the bodytag subcommand of the Tcl - command associated with the tablelist widget.  The advantage of using - this tag instead of the path name of the tablelist's body is that this - binding tag is associated not only with the body but also with the separator - frames and with the labels displaying embedded images.  This is - important in our example because we want to make sure the - <<Button3>> and <Double-1> events - will be handled in the same way within a label containing an embedded image - as in the rest of the tablelist's body.  Both the <<Button3>> virtual - event (used in the first three bind commands) and the - TablelistBody - binding tag (used in the first binding script) are created by the Tablelist - package.  The first three bind commands make sure that a - <<Button3>> virtual event will select and activate - the nearest item and will post a pop-up menu with two command entries that - refer to the widget described by that item.

- -

We populate the tablelist by invoking the demo::putChildren - procedure, implemented as follows:

- -
-
-#------------------------------------------------------------------------------
-# demo::putChildren
-#
-# Outputs the data of the children of the widget w into the tablelist widget
-# tbl, as child items of the one identified by nodeIdx.
-#------------------------------------------------------------------------------
-proc demo::putChildren {w tbl nodeIdx} {
-    . . .
-
-    if {[string compare $nodeIdx "root"] == 0} {
-        set top [winfo toplevel $tbl]
-        wm title $top "Children of the [winfo class $w] Widget \"$w\""
-
-        $tbl resetsortinfo
-        $tbl delete 0 end
-        set row 0
-    } else {
-        set row [expr {$nodeIdx + 1}]
-    }
-
-    #
-    # Display the data of the children of the
-    # widget w in the tablelist widget tbl
-    #
-    variable leafImg
-    variable compImg
-    foreach c [winfo children $w] {
-        #
-        # Insert the data of the current child into the tablelist widget
-        #
-        set item {}
-        lappend item \
-                [winfo name $c] [winfo class $c] [winfo x $c] [winfo y $c] \
-                [winfo width $c] [winfo height $c] [winfo ismapped $c] \
-                [winfo viewable $c] [winfo manager $c]
-        $tbl insertchild $nodeIdx end $item
-
-        #
-        # Insert an image into the first cell of the row; mark the
-        # row as collapsed if the child widget has children itself
-        #
-        if {[llength [winfo children $c]] == 0} {
-            $tbl cellconfigure end,0 -image $leafImg
-        } else {
-            $tbl cellconfigure end,0 -image $compImg
-            $tbl collapse $row
-        }
-
-        $tbl rowattrib $row pathName $c
-        incr row
-    }
-
-    if {[string compare $nodeIdx "root"] == 0} {
-        #
-        # Configure the "Refresh" and "Parent" buttons
-        #
-        $top.bf.b1 configure -command [list demo::refreshView $w $tbl]
-        set b2 $top.bf.b2
-        set p [winfo parent $w]
-        if {[string compare $p ""] == 0} {
-            $b2 configure -state disabled
-        } else {
-            $b2 configure -state normal -command \
-                [list demo::putChildren $p $tbl root]
-        }
-    }
-}
-
-
- -

The last argument of this procedure indicates the tree node to become the - parent of the items displaying the data of the children of the widget passed - as first argument.  If this parent is the invisible root - node then we first reset the sorting information by invoking the - resetsortinfo - tablelist subcommand and delete the current items of the tablelist widget - tbl.  The procedure then iterates over the children of the - specified widget and inserts the items built from some data retrieved by - using the winfo command.  Each new item is added to the end - of the parent node's list of children with the aid of the insertchild(ren) - subcommand.

- -

For each child widget, we invoke the cellconfigure tablelist - operation to set the value of the -image option of the - corresponding row's first cell, containing the leaf name of the child.  - In this way, the procedure inserts the image $leafImg or - $compImg into the first cell, depending on whether the child in - question is a leaf or a composite widget.  (Remember that both images - were created outside this procedure, within the initialization of the - demo namespace.)

- -

We mark every newly created row corresponding to a child widget that has - children itself as collapsed by invoking the collapse subcommand.  This - will prepend an expand/collapse control to the contents of the first column, - whose column index 0 is the default value of the -treecolumn configuration - option.

- -

We use the rowattrib tablelist subcommand to - remember the full path name of every child widget as a private attribute - associated with the corresponding tablelist row, because it will be needed at - several places later on.

- -

As mentioned above, the demo::expandCmd procedure will be - invoked automatically when expanding a row that contains an expand/collapse - control:

- -
-
-------------------------------------------------------------------------------
-# demo::expandCmd
-#
-# Outputs the data of the children of the widget whose leaf name is displayed
-# in the first cell of the specified row of the tablelist widget tbl, as child
-# items of the one identified by row.
-#------------------------------------------------------------------------------
-proc demo::expandCmd {tbl row} {
-    if {[$tbl childcount $row] == 0} {
-        set w [$tbl rowattrib $row pathName]
-        putChildren $w $tbl $row
-
-        #
-        # Apply the last sorting (if any) to the new items
-        #
-        $tbl refreshsorting $row
-    }
-}
-
-
- -

The procedure invokes the childcount subcommand to check - whether the children of the row that is about to be expanded have already - been inserted into the tablelist widget, and inserts them if this is not the - case.  It also makes sure that the child items will be displayed in the - order corresponding to the last sorting (if any), with the aid of the - refreshsorting - tablelist subcommand.  Any sorting (if needed) will only be performed on - the child items just inserted into the tablelist widget.

- -

The demo::formatBoolean and demo::labelCmd - procedures mentioned above are trivial:

- -
-
-#------------------------------------------------------------------------------
-# demo::formatBoolean
-#
-# Returns "yes" or "no", according to the specified boolean value.
-#------------------------------------------------------------------------------
-proc demo::formatBoolean val {
-    return [expr {$val ? "yes" : "no"}]
-}
-
-#------------------------------------------------------------------------------
-# demo::labelCmd
-#
-# Sorts the contents of the tablelist widget tbl by its col'th column and makes
-# sure the items will be updated 500 ms later (because one of the items might
-# refer to a canvas containing the arrow that displays the sorting order).
-#------------------------------------------------------------------------------
-proc demo::labelCmd {tbl col} {
-    tablelist::sortByColumn $tbl $col
-    updateItemsDelayed $tbl
-}
-
-
- -

The command tablelist::sortByColumn sorts - the items of the tablelist widget by the specified column in the right order, - by invoking the sortbycolumn subcommand of the - Tcl command associated with the tablelist widget.

- -

The implementation of the demo::updateItemsDelayed command, - invoked in this procedure and already encountered in the - demo::displayChildren procedure above, is quite simple:

- -
-
-#------------------------------------------------------------------------------
-# demo::updateItemsDelayed
-#
-# Arranges for the items of the tablelist widget tbl to be updated 500 ms later.
-#------------------------------------------------------------------------------
-proc demo::updateItemsDelayed tbl {
-    #
-    # Schedule the demo::updateItems command for execution
-    # 500 ms later, but only if it is not yet pending
-    #
-    if {[string compare [$tbl attrib afterId] ""] == 0} {
-        $tbl attrib afterId [after 500 [list demo::updateItems $tbl]]
-    }
-}
-
-#------------------------------------------------------------------------------
-# demo::updateItems
-#
-# Updates the items of the tablelist widget tbl.
-#------------------------------------------------------------------------------
-proc demo::updateItems tbl {
-    #
-    # Reset the tablelist's "afterId" attribute
-    #
-    $tbl attrib afterId ""
-
-    #
-    # Update the items
-    #
-    set rowCount [$tbl size]
-    for {set row 0} {$row < $rowCount} {incr row} {
-        set c [$tbl cellcget $row,0 -text]
-        if {![winfo exists $c]} {
-            continue
-        }
-
-        set item {}
-        lappend item \
-                [winfo name $c] [winfo class $c] [winfo x $c] [winfo y $c] \
-                [winfo width $c] [winfo height $c] [winfo ismapped $c] \
-                [winfo viewable $c] [winfo manager $c]
-        $tbl rowconfigure $row -text $item
-    }
-
-    #
-    # Repeat the last sort operation (if any)
-    #
-    $tbl refreshsorting
-}
-
-
- -

As already mentioned in the previous example, - each tablelist widget may have any number of private attributes, which can be - set and retrieved with the aid of the attrib subcommand of the Tcl command - corresponding to the widget.  The afterId attribute is set - by the demo::updateItemsDelayed procedure when sheduling the - demo::updateItems command for execution 500 ms later, but only - if its value is an empty string.  For this reason, the - demo::updateItems procedure resets this attribute.  It also - makes use of the cellcget tablelist subcommand to - get the path names contained in the first cell of each row, and updates the - data of the children with the aid of the rowconfigure subcommand.  - After updating the items, the procedure repeats the most recent sorting based - on a column (if there was one), with the aid of the refreshsorting - subcommand.

- -

The procedures demo::putChildrenOfSelWidget, - demo::dispConfigOfSelWidget, and - demo::postPopupMenu (see demo::displayChildren) are - also straight-forward.  For example, the - demo::putChildrenOfSelWidget command shown below makes use of - the curselection - subcommand to get the index of the selected row.  More precisely, - curselection returns a list, but in our case this list will have - exactly one element, hence it can be used directly as the first component of - a cell index.

- -
-
-#------------------------------------------------------------------------------
-# demo::putChildrenOfSelWidget
-#
-# Outputs the data of the children of the selected widget into the tablelist
-# widget tbl.
-#------------------------------------------------------------------------------
-proc demo::putChildrenOfSelWidget tbl {
-    set w [$tbl cellcget [$tbl curselection],0 -text]
-    if {![winfo exists $w]} {
-        bell
-        tk_messageBox -title "Error" -icon error -message \
-            "Bad window path name \"$w\"" -parent [winfo toplevel $tbl]
-        return ""
-    }
-
-    if {[llength [winfo children $w]] == 0} {
-        bell
-    } else {
-        putChildren $w $tbl
-    }
-}
-
-
- -

The procedure demo::refreshView, associated with the - Refresh button, is implemented as follows:

- -
-
-#------------------------------------------------------------------------------
-# demo::refreshView
-#
-# Redisplays the data of the children of the widget w in the tablelist widget
-# tbl and restores the expanded states of the items as well as the vertical
-# view.
-#------------------------------------------------------------------------------
-proc demo::refreshView {w tbl} {
-    #
-    # Save the vertical view and get the path names of
-    # the child widgets displayed in the expanded rows
-    #
-    set yView [$tbl yview]
-    foreach key [$tbl expandedkeys] {
-        set pathName [$tbl rowattrib $key pathName]
-        set expandedWidgets($pathName) 1
-    }
-
-    #
-    # Redisplay the data of the widget's (possibly changed) children and
-    # restore the expanded states of the children, along with the vertical view
-    #
-    putChildren $w $tbl root
-    restoreExpandedStates $tbl root expandedWidgets
-    $tbl yview moveto [lindex $yView 0]
-}
-
-
- -

Before redisplaying the tablelist's contents via - demo::putChildren, we get the full keys of the currently - expanded items with the aid of the expandedkeys tablelist - subcommand and insert the correspondig widget paths into the array - expandedWidgets.  After redisplaying the data of the - (possibly changed) children of the widget given as first argument, we pass - this array to the demo::restoreExpandedStates procedure shown - below:

- -
-
-#------------------------------------------------------------------------------
-# restoreExpandedStates
-#
-# Expands those children of the parent identified by nodeIdx that display the
-# data of child widgets whose path names are the names of the elements of the
-# array specified by the last argument.
-#------------------------------------------------------------------------------
-proc demo::restoreExpandedStates {tbl nodeIdx expandedWidgetsName} {
-    upvar $expandedWidgetsName expandedWidgets
-
-    foreach key [$tbl childkeys $nodeIdx] {
-        set pathName [$tbl rowattrib $key pathName]
-        if {[info exists expandedWidgets($pathName)]} {
-            $tbl expand $key -partly
-            restoreExpandedStates $tbl $key expandedWidgets
-        }
-    }
-}
-
-
- -

The procedure retrieves the list of full keys of the children of the - parent node indicated by nodeIdx, by means of the childkeys tablelist - subcommand.  It then loops over this list, and for each key for which - the corresponding row was previously expanded, it invokes the expand tablelist subcommand and then - calls itself recursively to restore the expanded states of that row's - children.

- -

A Directory Viewer Based on a tablelist

- -

The script dirViewer.tcl in the demos directory - displays the contents of the volumes mounted on the system (e.g., the root - / on UNIX and the local drives on Windows) in a tablelist used - as multi-column tree widget:

- -
- Directory Viewer -
- -

By double-clicking an item or invoking the single entry of a pop-up menu - within the body of the tablelist, you can display the contents of the folder - corresponding to the selected item.  To go one level up, click on the - Parent button.

- -

There are a lot of similarities between this script and the one discussed - in the previous section.  In the following we - will only present a few procedures that invoke tablelist commands not - encountered in the examples above:

- -
-
-package require Tk 8.3
-package require tablelist 5.13
-
-#
-# Add some entries to the Tk option database
-#
-set dir [file dirname [info script]]
-source [file join $dir option.tcl]
-
-#
-# Create three images
-#
-image create photo clsdFolderImg -file [file join $dir clsdFolder.gif]
-image create photo openFolderImg -file [file join $dir openFolder.gif]
-image create photo fileImg       -file [file join $dir file.gif]
-
-#------------------------------------------------------------------------------
-# displayContents
-#
-# Displays the contents of the directory dir in a tablelist widget.
-#------------------------------------------------------------------------------
-proc displayContents dir {
-    #
-    # Create a scrolled tablelist widget with 3 dynamic-
-    # width columns and interactive sort capability
-    #
-    set tf .tf
-    frame $tf -class ScrollArea
-    set tbl $tf.tbl
-    set vsb $tf.vsb
-    set hsb $tf.hsb
-    tablelist::tablelist $tbl \
-        -columns {0 "Name"          left
-                  0 "Size"          right
-                  0 "Date Modified" left} \
-        -expandcommand expandCmd -collapsecommand collapseCmd \
-        -xscrollcommand [list $hsb set] -yscrollcommand [list $vsb set] \
-        -movablecolumns no -setgrid no -showseparators yes -height 20 -width 80
-    if {[$tbl cget -selectborderwidth] == 0} {
-        $tbl configure -spacing 1
-    }
-    $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]
-
-    . . .
-
-    #
-    # Populate the tablelist with the contents of the given directory
-    #
-    $tbl sortbycolumn 0
-    putContents $dir $tbl root
-}
-
-
- -

The procedure displayContents creates the tablelist widget - and the two scrollbars as children of a frame of class - ScrollArea.  For this class, the file - option.tcl, sourced into the main script, contains - some look & feel related settings similar to the ones encountered in our - first example:

- -
-
-if {[string compare $winSys "x11"] == 0} {
-    . . .
-} else {
-    option add *ScrollArea.borderWidth                  1
-    option add *ScrollArea.relief                       sunken
-    option add *ScrollArea.Tablelist.borderWidth        0
-    option add *ScrollArea.Tablelist.highlightThickness 0
-    . . .
-}
-
-
- -

The procedure specifies a value not only for the -expandcommand option of the - tablelist it creates, but also for its -collapsecommand - option.  The latter will merely restore the image shown in the first - column to the one displaying a closed folder (see below).

- -
-
-#------------------------------------------------------------------------------
-# putContents
-#
-# Outputs the contents of the directory dir into the tablelist widget tbl, as
-# child items of the one identified by nodeIdx.
-#------------------------------------------------------------------------------
-proc putContents {dir tbl nodeIdx} {
-    . . .
-
-    if {[string compare $nodeIdx "root"] == 0} {
-        if {[string compare $dir ""] == 0} {
-            if {[llength [file volumes]] == 1} {
-                wm title . "Contents of the File System"
-            } else {
-                wm title . "Contents of the File Systems"
-            }
-        } else {
-            wm title . "Contents of the Directory \"[file nativename $dir]\""
-        }
-
-        $tbl delete 0 end
-        set row 0
-    } else {
-        set row [expr {$nodeIdx + 1}]
-    }
-
-    #
-    # Build a list from the data of the subdirectories and
-    # files of the directory dir.  Prepend a "D" or "F" to
-    # each entry's name and modification date & time, for
-    # sorting purposes (it will be removed by formatString).
-    #
-    set itemList {}
-    if {[string compare $dir ""] == 0} {
-        foreach volume [file volumes] {
-            lappend itemList [list D[file nativename $volume] -1 D $volume]
-        }
-    } else {
-        foreach entry [glob -nocomplain -types {d f} -directory $dir *] {
-            if {[catch {file mtime $entry} modTime] != 0} {
-                continue
-            }
-
-            if {[file isdirectory $entry]} {
-                lappend itemList [list D[file tail $entry] -1 \
-                    D[clock format $modTime -format "%Y-%m-%d %H:%M"] $entry]
-            } else {
-                lappend itemList [list F[file tail $entry] [file size $entry] \
-                    F[clock format $modTime -format "%Y-%m-%d %H:%M"] ""]
-            }
-        }
-    }
-
-    #
-    # Sort the above list and insert it into the tablelist widget
-    # tbl as list of children of the row identified by nodeIdx
-    #
-    set itemList [$tbl applysorting $itemList]
-    $tbl insertchildlist $nodeIdx end $itemList
-
-    #
-    # Insert an image into the first cell of each newly inserted row
-    #
-    foreach item $itemList {
-        set name [lindex $item end]
-        if {[string compare $name ""] == 0} {                   ;# file
-            $tbl cellconfigure $row,0 -image fileImg
-        } else {                                                ;# directory
-            $tbl cellconfigure $row,0 -image clsdFolderImg
-            $tbl rowattrib $row pathName $name
-
-            #
-            # Mark the row as collapsed if the directory is non-empty
-            #
-            if {[file readable $name] && [llength \
-                [glob -nocomplain -types {d f} -directory $name *]] != 0} {
-                $tbl collapse $row
-            }
-        }
-
-        incr row
-    }
-
-    . . .
-}
-
-
- -

The main difference between the procedure putContents above - and the procedure demo::putChildren - described in the previous section is related to the - way child items are inserted into the tablelist widget.  Instead of - inserting them individually with the aid of the insertchild(ren) tablelist - subcommand, here we add the relevant data to a list of items and then invoke - the much more performant insertchildlist - subcommand.  Also, instead of first inserting the items and then sorting - them via refreshsorting, we first - perform the necessary sortings on the above-mentioned list of items by - invoking the applysorting subcommand.  - Again, this is much faster than sorting the already inserted child items.

- -

This procedure also illustrates an effective technique based on the - -formatcommand column - configuration option:  In the tablelist widget's internal list, the - names and modification times of the directories and files are preceded by a - D and F, respectively.  This makes sure that - the directories will sort before the files (when sorting in ascending - order).  When displaying the items, the Tablelist code will - automatically invoke the formatString procedure, which removes - the first character.  Similarly, in the widget's internal list, the size - of a directory is set to -1, which sorts before the sizes of the - files.  The formatSize procedure, invoked automatically - when displaying the items, replaces this value with an empty string:

- -
-
-#------------------------------------------------------------------------------
-# formatString
-#
-# Returns the substring obtained from the specified value by removing its first
-# character.
-#------------------------------------------------------------------------------
-proc formatString val {
-    return [string range $val 1 end]
-}
-
-#------------------------------------------------------------------------------
-# formatSize
-#
-# Returns an empty string if the specified value is negative and the value
-# itself in user-friendly format otherwise.
-#------------------------------------------------------------------------------
-proc formatSize val {
-    if {$val < 0} {
-        return ""
-    } elseif {$val < 1024} {
-        return "$val bytes"
-    } elseif {$val < 1048576} {
-        return [format "%.1f KB" [expr {$val / 1024.0}]]
-    } elseif {$val < 1073741824} {
-        return [format "%.1f MB" [expr {$val / 1048576.0}]]
-    } else {
-        return [format "%.1f GB" [expr {$val / 1073741824.0}]]
-    }
-}
-
-
- -

Besides its common task of inserting the children of the row to be - expanded, the expandCmd procedure shown below also changes the - image contained in the first column to the one displaying an open - folder.  The collapseCmd procedure restores the image to - the one displaying a closed folder:

- -
-
-#------------------------------------------------------------------------------
-# expandCmd
-#
-# Outputs the contents of the directory whose leaf name is displayed in the
-# first cell of the specified row of the tablelist widget tbl, as child items
-# of the one identified by row, and updates the image displayed in that cell.
-#------------------------------------------------------------------------------
-proc expandCmd {tbl row} {
-    if {[$tbl childcount $row] == 0} {
-        set dir [$tbl rowattrib $row pathName]
-        putContents $dir $tbl $row
-    }
-
-    if {[$tbl childcount $row] != 0} {
-        $tbl cellconfigure $row,0 -image openFolderImg
-    }
-}
-
-#------------------------------------------------------------------------------
-# collapseCmd
-#
-# Updates the image displayed in the first cell of the specified row of the
-# tablelist widget tbl.
-#------------------------------------------------------------------------------
-proc collapseCmd {tbl row} {
-    $tbl cellconfigure $row,0 -image clsdFolderImg
-}
-
-. . .
-
-displayContents ""
-
-
- -

The last line of the script invokes the procedure - displayContents with an empty string as argument, i.e., displays - the volumes mounted on the system.

- -

Improving the Look & Feel of a tablelist Widget

- -

The script styles.tcl in the demos directory - demonstrates some ways of making tablelist widgets smarter and improving the - readability of their items.  It creates 8 tablelist widgets, shown in - the following figure:

- -
- Styles -
- -

Here is the relevant code segment:

- -
-
-#
-# Create, configure, and populate 8 tablelist widgets
-#
-frame .f
-for {set n 0} { $n < 8} {incr n} {
-    set tbl .f.tbl$n
-    tablelist::tablelist $tbl \
-        -columntitles {"Label 0" "Label 1" "Label 2" "Label 3"} \
-        -background white -height 4 -width 40 -stretch all
-    if {[$tbl cget -selectborderwidth] == 0} {
-        $tbl configure -spacing 1
-    }
-
-    switch $n {
-        1 {
-            $tbl configure -showseparators yes
-        }
-        2 {
-            $tbl configure -stripebackground #e4e8ec
-        }
-        3 {
-            $tbl configure -stripebackground #e4e8ec -showseparators yes
-        }
-        4 {
-            $tbl columnconfigure 1 -background LightYellow
-            $tbl columnconfigure 3 -background LightCyan
-        }
-        5 {
-            $tbl configure -showseparators yes
-            $tbl columnconfigure 1 -background LightYellow
-            $tbl columnconfigure 3 -background LightCyan
-        }
-        6 {
-            $tbl configure -stripebackground #e4e8ec
-            $tbl columnconfigure 1 -background LightYellow \
-                -stripebackground #e5e5c9
-            $tbl columnconfigure 3 -background LightCyan \
-                -stripebackground #c9e5e5
-        }
-        7 {
-            $tbl configure -stripebackground #e4e8ec -showseparators yes
-            $tbl columnconfigure 1 -background LightYellow \
-                -stripebackground #e5e5c9
-            $tbl columnconfigure 3 -background LightCyan \
-                -stripebackground #c9e5e5
-        }
-    }
-
-    foreach row {0 1 2 3} {
-        $tbl insert end \
-             [list "Cell $row,0" "Cell $row,1" "Cell $row,2" "Cell $row,3"]
-    }
-}
-
-
- -

The only configuration option used here but not discussed in the first - three examples (although already encountered in the previous one) is -showseparators.  The - visual effect it produces looks nice both by itself and combined with - horizontal or vertical stripes, created by using the -stripebackground option - and the columnconfigure subcommand, - respectively.

- -

Advanced Interactive tablelist Cell Editing

- -

The scripts tileWidgets.tcl, bwidget.tcl, - iwidgets.tcl, and miscWidgets.tcl in the - demos directory create a tablelist widget displaying some - parameters of 16 serial lines, and demonstrate how to use various widgets - from the Tk core and from the packages tile, BWidget, Iwidgets, combobox (by - Bryan Oakley), ctext, and Mentry (or Mentry_tile) for interactive cell - editing.  The following figure shows the tablelist widget, together with - a BWidget ComboBox used to edit the contents of one of its cells:

- -
- Serial Line Configuration -
- -

Here is the relevant code segment from the script bwidget.tcl - (the scripts tileWidgets.tcl, iwidgets.tcl, and - miscWidgets.tcl are similar):

- -
-
-package require Tk 8.4                          ;# because of "-compound"
-package require tablelist 5.13
-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*Checkbutton.background            white
-option add *Tablelist*Checkbutton.activeBackground      white
-option add *Tablelist*Entry.background                  white
-
-#
-# Register some widgets from the BWidget package for interactive cell editing
-#
-tablelist::addBWidgetEntry
-tablelist::addBWidgetSpinBox
-tablelist::addBWidgetComboBox
-
-#
-# 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]
-
-#
-# Create a tablelist widget with editable columns (except the first one)
-#
-set tbl .tbl
-tablelist::tablelist $tbl \
-    -columns {0 "No."             right
-              0 "Available"       center
-              0 "Name"            left
-              0 "Baud Rate"       right
-              0 "Data Bits"       center
-              0 "Parity"          left
-              0 "Stop Bits"       center
-              0 "Handshake"       left
-              0 "Activation Date" center
-              0 "Activation Time" center
-              0 "Cable Color"     center} \
-    -editstartcommand editStartCmd -editendcommand editEndCmd \
-    -height 0 -width 0
-if {[$tbl cget -selectborderwidth] == 0} {
-    $tbl configure -spacing 1
-}
-$tbl columnconfigure 0 -sortmode integer
-$tbl columnconfigure 1 -name available -editable yes -editwindow checkbutton \
-    -formatcommand emptyStr
-$tbl columnconfigure 2 -name lineName  -editable yes -editwindow Entry \
-    -sortmode dictionary
-$tbl columnconfigure 3 -name baudRate  -editable yes -editwindow ComboBox \
-    -sortmode integer
-$tbl columnconfigure 4 -name dataBits  -editable yes -editwindow SpinBox
-$tbl columnconfigure 5 -name parity    -editable yes -editwindow ComboBox
-$tbl columnconfigure 6 -name stopBits  -editable yes -editwindow ComboBox
-$tbl columnconfigure 7 -name handshake -editable yes -editwindow ComboBox
-$tbl columnconfigure 8 -name actDate   -editable yes -editwindow Entry \
-    -formatcommand formatDate -sortmode integer
-$tbl columnconfigure 9 -name actTime   -editable yes -editwindow Entry \
-    -formatcommand formatTime -sortmode integer
-$tbl columnconfigure 10 -name color    -editable yes -editwindow menubutton \
-    -formatcommand emptyStr
-
-proc emptyStr   val { return "" }
-proc formatDate val { return [clock format $val -format "%Y-%m-%d"] }
-proc formatTime val { return [clock format $val -format "%H:%M:%S"] }
-
-#
-# Populate the tablelist widget; set the activation
-# date & time to 10 minutes past the current clock value
-#
-set clock [expr {[clock seconds] + 600}]
-for {set i 0; set n 1} {$i < 16} {set i $n; incr n} {
-    $tbl insert end [list $n [expr {$i < 8}] "Line $n" 9600 8 None 1 XON/XOFF \
-        $clock $clock [lindex $colorNames $i]]
-
-    set availImg [expr {($i < 8) ? "checkedImg" : "uncheckedImg"}]
-    $tbl cellconfigure end,available -image $availImg
-    $tbl cellconfigure end,color -image img[lindex $colorValues $i]
-}
-
-set btn [button .btn -text "Close" -command exit]
-
-#
-# Manage the widgets
-#
-pack $btn -side bottom -pady 10
-pack $tbl -side top -expand yes -fill both
-
-
- -

We invoke the tablelist::addBWidgetEntry, - tablelist::addBWidgetSpinBox, and - tablelist::addBWidgetComboBox - commands to register the Entry, SpinBox, and ComboBox widgets from the - BWidget package for interactive cell editing.  These commands return the - values "Entry", "SpinBox", and - "ComboBox", respectively, which we then use in the - -editwindow - column configuration option to set the edit window for the columns no. 2, - ..., 10.  In columns no. 1 and 10 we use the Tk core checkbutton and - menubutton widgets, which are automatically registered for interactive cell - editing.

- -

Notice the use of the -name column configuration option, - which allows us to access the columns by their names instead of by numerical - column indices.  This is important, because the file - option.tcl, which is sourced into the main script, - contains the line

- -
-
-option add *Tablelist.movableColumns    yes
-
-
- -

The editStartCmd and editEndCmd procedures shown - below use the columncget subcommand to - retrieve the name of the column from the numerical column index.

- -

By the way, two further option database settings contained in the file - option.tcl are:

- -
-
-option add *Tablelist.labelCommand      tablelist::sortByColumn
-option add *Tablelist.labelCommand2     tablelist::addToSortColumns
-
-
- -

The tablelist::sortByColumn and - tablelist::addToSortColumns - commands specified in these settings enable the user to sort the items by one - or more columns, with the aid of the left mouse button and of the - Shift key.

- -

The editStartCmd procedure, specified as the value of the - -editstartcommand - configuration option, needs the path name of the edit window, in order to be - able to configure the widget in various ways.  This is a common - situation, and Tablelist provides the editwinpath subcommand for this - purpose:

- -
-
-#------------------------------------------------------------------------------
-# 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]
-
-    switch [$tbl columncget $col -name] {
-        lineName {
-            #
-            # Set an upper limit of 20 for the number of characters
-            #
-            $w configure -invalidcommand bell -validate key \
-                         -validatecommand {expr {[string length %P] <= 20}}
-        }
-
-        baudRate {
-            #
-            # Populate the ComboBox and allow no more
-            # than 6 digits in its Entry component
-            #
-            $w configure -values {50 75 110 300 1200 2400 4800 9600 19200 38400
-                                  57600 115200 230400 460800 921600}
-            $w configure -invalidcommand bell -validate key -validatecommand \
-                {expr {[string length %P] <= 6 && [regexp {^[0-9]*$} %S]}}
-        }
-
-        dataBits {
-            #
-            # Configure the SpinBox
-            #
-            $w configure -range {5 8 1} -editable no
-        }
-
-        parity {
-            #
-            # Populate the ComboBox and make it non-editable
-            #
-            $w configure -values {None Even Odd Mark Space} -editable no
-        }
-
-        . . .
-
-        color {
-            #
-            # Populate the menu and make sure the menubutton will display the
-            # color name rather than $text, which is "", due to -formatcommand
-            #
-            set menu [$w cget -menu]
-            foreach name $::colorNames {
-                $menu add radiobutton -compound left \
-                    -image img$::colors($name) -label $name
-            }
-            $menu entryconfigure 8 -columnbreak 1
-            return [$tbl cellcget $row,$col -text]
-        }
-    }
-
-    return $text
-}
-
-
- -

The editEndCmd procedure, specified as the value of the - -editendcommand - configuration option, is responsible for a final validation of the edit - window's text.  Another purpose of this command is to convert the text - contained in the edit window to the cell's new internal contents, - which is necessary because the internal value of the activation date and time - is a clock value in seconds:

- -
-
-#------------------------------------------------------------------------------
-# editEndCmd
-#
-# Performs a final validation of the text contained in the edit window and gets
-# the cell's internal contents.
-#------------------------------------------------------------------------------
-proc editEndCmd {tbl row col text} {
-    switch [$tbl columncget $col -name] {
-        available {
-            #
-            # Update the image contained in the cell
-            #
-            set img [expr {$text ? "checkedImg" : "uncheckedImg"}]
-            $tbl cellconfigure $row,$col -image $img
-        }
-
-        baudRate {
-            #
-            # Check whether the baud rate is an integer in the range 50..921600
-            #
-            if {![regexp {^[0-9]+$} $text] || $text < 50 || $text > 921600} {
-                bell
-                tk_messageBox -title "Error" -icon error -message \
-                    "The baud rate must be an integer in the range 50..921600"
-                $tbl rejectinput
-            }
-        }
-
-        actDate {
-            #
-            # Get the activation date in seconds from the last argument
-            #
-            if {[catch {clock scan $text} actDate] != 0} {
-                bell
-                tk_messageBox -title "Error" -icon error -message "Invalid date"
-                $tbl rejectinput
-                return ""
-            }
-
-            #
-            # Check whether the activation clock value is later than the
-            # current one; if this is the case then make sure the cells
-            # "actDate" and "actTime" will have the same internal value
-            #
-            set actTime [$tbl cellcget $row,actTime -text]
-            set actClock [clock scan [formatTime $actTime] -base $actDate]
-            if {$actClock <= [clock seconds]} {
-                bell
-                tk_messageBox -title "Error" -icon error -message \
-                    "The activation date & time must be in the future"
-                $tbl rejectinput
-            } else {
-                $tbl cellconfigure $row,actTime -text $actClock
-                return $actClock
-            }
-        }
-
-        . . .
-
-        color {
-            #
-            # Update the image contained in the cell
-            #
-            $tbl cellconfigure $row,$col -image img$::colors($text)
-        }
-    }
-
-    return $text
-}
-
-
- -

As mentioned above, the scripts tileWidgets.tcl, - iwidgets.tcl, and miscWidgets.tcl are similar to - bwidget.tcl.  The first one makes use of the tile entry, - spinbox, combobox, checkbutton, and menubutton widgets.  The second one - uses (besides the Tk core checkbutton and menubutton) the entryfield, - spinint, combobox, dateentry, and timeentry widgets from the Iwidgets package - and the validation facilities specific to that library.  The third - script makes use of the entry, spinbox, checkbutton, and menubutton widgets - from the Tk core, Bryan Oakley's combobox, and of the mentry widgets of type - "Date" and "Time", and it performs the entry - validation with the aid of the Wcb package (which is required anyway for the - Mentry library).

- -

A tablelist Widget Containing Embedded Windows

- -

The script embeddedWindows.tcl in the demos - directory creates a tablelist widget whose items correspond to the Tk library - scripts.  The size of each file (in bytes) is not only displayed as a - number, but is also illustrated with the aid of a frame with red background, - created as a child of an embedded frame with ivory background.  The - files can be viewed by clicking on the corresponding embedded button - widgets.

- -

The following screenshot shows the tablelist widget with the mouse cursor - over the first header label, causing this label to appear in - active state:

- -
- Embedded Windows -
- -

First, we create and populate the tablelist widget:

- -
-
-package require tablelist 5.13
-
-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 to be displayed in buttons embedded in a tablelist widget
-#
-image create photo openImg -file [file join $dir open.gif]
-
-#
-# Create a vertically scrolled tablelist widget with 5
-# dynamic-width columns and interactive sort capability
-#
-set tf .tf
-frame $tf -class ScrollArea
-set tbl $tf.tbl
-set vsb $tf.vsb
-tablelist::tablelist $tbl \
-    -columns {0 "File Name" left
-              0 "Bar Chart" center
-              0 "File Size" right
-              0 "View"      center
-              0 "Seen"      center} \
-    -setgrid no -yscrollcommand [list $vsb set] -width 0
-if {[$tbl cget -selectborderwidth] == 0} {
-    $tbl configure -spacing 1
-}
-$tbl columnconfigure 0 -name fileName
-$tbl columnconfigure 1 -formatcommand emptyStr -sortmode integer
-$tbl columnconfigure 2 -name fileSize -sortmode integer
-$tbl columnconfigure 4 -name seen
-scrollbar $vsb -orient vertical -command [list $tbl yview]
-
-proc emptyStr val { return "" }
-
-eval font create BoldFont [font actual [$tbl cget -font]] -weight bold
-
-#
-# Populate the tablelist widget
-#
-cd $tk_library
-set maxFileSize 0
-foreach fileName [lsort [glob *.tcl]] {
-    set fileSize [file size $fileName]
-    $tbl insert end [list $fileName $fileSize $fileSize "" no]
-
-    if {$fileSize > $maxFileSize} {
-        set maxFileSize $fileSize
-    }
-}
-
-
- -

We insert the size of each file not only into the column with the - title  "File Size" , but also into the column  - "Bar Chart".  Since we configured this column with  - -formatcommand emptyStr,  the text will remain hidden in - it.  It will, however, be needed when sorting the items by that - column.

- -

To be able to create the embedded windows, we have first to implement the - creation scripts for them, as specified in the description of the - -window cell - configuration option.  Here is the script that creates a frame to be - embedded into the column displaying the bar chart:

- -
-
-#------------------------------------------------------------------------------
-# createFrame
-#
-# Creates a frame widget w to be embedded into the specified cell of the
-# tablelist widget tbl, as well as a child frame representing the size of the
-# 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
-    #
-    frame $w -width 102 -height 14 -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 -height 12 -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 -relwidth [expr {double($fileSize) / $::maxFileSize}]
-}
-
-
- -

Since the frame will be embedded into the tablelist's body, we want to - have the same handling of the mouse events in the frame and in its child - frame as in the rest of the tablelist's body.  To this end we replace - the binding tag Frame (which has no own bindings anyway) with - TablelistBody, - thus making sure that the default binding scripts associated with that tag - will be valid for the parent frame and its child, too.

- -

We place the red child frame within its parent using the - -relwidth option, to make sure that its width will remain - proportional to the size of the corresponding file when resizing the parent - frame (which will happen when resizing its column, as seen below).

- -

The creation script for the buttons used for viewing the Tk library files - is quite simple:

- -
-
-#------------------------------------------------------------------------------
-# createButton
-#
-# Creates a button widget w to be embedded into the specified cell of the
-# tablelist widget tbl.
-#------------------------------------------------------------------------------
-proc createButton {tbl row col w} {
-    set key [$tbl getkeys $row]
-    button $w -image openImg -highlightthickness 0 -takefocus 0 \
-              -command [list viewFile $tbl $key]
-}
-
-#------------------------------------------------------------------------------
-# viewFile
-#
-# Displays the contents of the file whose name is contained in the row with the
-# given key of the tablelist widget tbl.
-#------------------------------------------------------------------------------
-proc viewFile {tbl key} {
-    set top .top$key
-    if {[winfo exists $top]} {
-        raise $top
-        return ""
-    }
-
-    toplevel $top
-    set fileName [$tbl cellcget k$key,fileName -text]
-    wm title $top "File \"$fileName\""
-
-    #
-    # Create a vertically scrolled text widget as a grandchild of the toplevel
-    #
-    set tf $top.tf
-    frame $tf -class ScrollArea
-    set txt $tf.txt
-    set vsb $tf.vsb
-    text $txt -background white -font TkFixedFont -setgrid yes \
-              -yscrollcommand [list $vsb set]
-    catch {$txt configure -tabstyle wordprocessor}      ;# for Tk 8.5 and above
-    scrollbar $vsb -orient vertical -command [list $txt yview]
-
-    #
-    # Insert the file's contents into the text widget
-    #
-    set chan [open $fileName]
-    $txt insert end [read $chan]
-    close $chan
-
-    . . .
-
-    #
-    # Mark the file as seen
-    #
-    $tbl rowconfigure k$key -font BoldFont
-    $tbl cellconfigure k$key,seen -text yes
-}
-
-
- -

Each file will be displayed in a text widget contained in a top-level - whose name is .top$key, where $key is obtained with - the aid of the getkeys subcommand.  By using - the key instead of the row number, we will have a unique name for the - top-level, even if the order of the items changes due to interactive sorting - by a column.  (Remember that the embedded windows will be destroyed and - automatically recreated when sorting the items or moving the columns.)

- -

Having implemented the creation scripts for the frames and buttons, we can - now use the cellconfigure subcommand to - effectively create these widgets as embedded windows.  Notice the - -stretchwindow option - used for the embedded frames, to make sure that their width will be adapted - to that of the containing column when the latter is being resized - interactively.

- -
-
-#
-# Create embedded windows in the columns no. 1 and 3
-#
-set rowCount [$tbl size]
-for {set row 0} {$row < $rowCount} {incr row} {
-    $tbl cellconfigure $row,1 -window createFrame -stretchwindow yes
-    $tbl cellconfigure $row,3 -window createButton
-}
-
-
- -

Tile-Based Demo Scripts

- -

The Tablelist distribution contains also tile-based counterparts of the - demo scripts discussed above.  As described in the More on Tablelist_tile section of this tutorial, it is quite - easy to port an application using the Tablelist package to one based on - Tablelist_tile.  For example, let's see how to transform the demo script - bwidget.tcl into a tile-based one, - called bwidget_tile.tcl.  The changes are shown below in - red color:

- -

First, we replace the starting lines

- -
-
-package require Tk 8.3                          ;# because of entry validation
-package require tablelist 5.13
-
-
- -

with

- -
-
-package require tablelist_tile 5.13
-
-
- -

and the command

- -
-
-source [file join $dir option.tcl]
-
-
- -

with

- -
-
-source [file join $dir option_tile.tcl]
-
-
- -

To ensure that the overall appearance of the GUI will conform to the - currently used theme, we create a theme-specific container for our - widgets:

- -
-
-#
-# Improve the window's appearance by using a tile
-# frame as a container for the other widgets
-#
-set f [ttk::frame .f]
-
-
- -

This implies that we have to replace the statement

- -
-
-set tbl .tbl
-
-
- -

defining the path name of our tablelist widget with

- -
-
-set tbl $f.tbl
-
-
- -

Similarly, instead of a Tk button created by the command

- -
-
-set btn [button .btn -text "Close" -command exit]
-
-
- -

we use a tile button that is a child of the above tile frame:

- -
-
-set btn [ttk::button $f.btn -text "Close" -command exit]
-
-
- -

We manage this frame in the usual manner:

- -
-
-pack $f -expand yes -fill both
-
-
- -

The script option_tile.tcl is nearly identical to - option.tcl.  Its tile-specific part uses the values written - by the command tablelist::setThemeDefaults - into the array tablelist::themeDefaults, to make sure that the - selection will have the same theme-specific look in all the widgets created - by the application:

- -
-
-tablelist::setThemeDefaults
-if {[tablelist::getCurrentTheme] eq "aqua"} {
-    option add *Listbox.selectBackground \
-               $tablelist::themeDefaults(-selectbackground)
-    option add *Listbox.selectForeground \
-               $tablelist::themeDefaults(-selectforeground)
-} else {
-    option add *selectBackground  $tablelist::themeDefaults(-selectbackground)
-    option add *selectForeground  $tablelist::themeDefaults(-selectforeground)
-}
-option add *selectBorderWidth     $tablelist::themeDefaults(-selectborderwidth)
-
-
- -

The demo script tileWidgets.tcl uses not only the - Tablelist_tile package for creating a tablelist widget with a modern - theme-specific look & feel, but also the tile entry, spinbox, combobox, - checkbutton, and menubutoon widgets for interactive cell editing.  The - resulting window has a nice theme-specific appearance:

- -
- Serial Line Configuration -
- -

The tile-based version of the demo script embeddedWindows.tcl contains a bit more changes, but - most of them are not Tablelist-specific.  Please take a look at the file - embeddedWindows_tile.tcl in the demos directory for - the details.  Here is a screenshot of the resulting window:

- -
- Embedded Windows -
- -
-

Contents     Start page

-
- - DELETED tablelist5.13/doc/tablelistBWidget.html Index: tablelist5.13/doc/tablelistBWidget.html ================================================================== --- tablelist5.13/doc/tablelistBWidget.html +++ tablelist5.13/doc/tablelistBWidget.html @@ -1,226 +0,0 @@ - - - Interactive Tablelist Cell Editing Using the BWidget Package - - - - - - - - -
-

Interactive Tablelist Cell Editing Using the BWidget Package

- -

For Tablelist Version 5.13

- -

by

- -

Csaba Nemethi

- -
- csaba.nemethi@t-online.de -
-
-
- -

Contents

- - - - -
- -

Overview

- -

The BWidget package is a library extension for Tcl/Tk versions 8.1.1 or - higher, written in pure Tcl/Tk code.  Its download location is

- -
-
- http://sourceforge.net/projects/tcllib/files -
-
- -

Tablelist supports interactive cell editing with the aid of the Entry, - SpinBox, and ComboBox widgets from the BWidget package.  The steps - needed for using one of these widgets for editing the cells of a given column - are as follows:

- -
    -
  1. Register the desired widget for interactive cell editing by invoking - one of the commands described in this reference page.
  2. - -
  3. Use the tablelist widget's columnconfigure - subcommand to set the given column's -editable option to true - and its -editwindow option to - the value returned by the command mentioned above.  (These options are - supported at cell level, too, with the aid of the cellconfigure - subcommand.)
  4. -
- -
-

Contents     Start page

-
-
- -

The tablelist::addBWidgetEntry - Command

- -
-
NAME
- -
tablelist::addBWidgetEntry – Register the Entry - widget from the BWidget package for interactive cell editing
- -
SYNOPSIS
- -
-
-tablelist::addBWidgetEntry ?name?
-
-
- -
DESCRIPTION
- -
This command registers the Entry widget from the BWidget package for - interactive cell editing in tablelist widgets.  The optional argument - specifies the name to be used for the Entry widget as the value of the - -editwindow column or - cell configuration option.  It may be any string that is different - from the Tk core and tile edit window names.  The default is - Entry.  The command returns its - name argument.
- -
KEYWORDS
- -
tablelist, editing, BWidget, Entry
-
- -
-

Contents     Start page

-
-
- -

The tablelist::addBWidgetSpinBox - Command

- -
-
NAME
- -
tablelist::addBWidgetSpinBox – Register the SpinBox - widget from the BWidget package for interactive cell editing
- -
SYNOPSIS
- -
-
-tablelist::addBWidgetSpinBox ?name?
-
-
- -
DESCRIPTION
- -
This command registers the SpinBox widget from the BWidget package for - interactive cell editing in tablelist widgets.  The optional argument - specifies the name to be used for the SpinBox widget as the value of the - -editwindow column or - cell configuration option.  It may be any string that is different - from the Tk core and tile edit window names.  The default is - SpinBox.  The command returns its - name argument.
- -
The temporary embedded SpinBox widget associated with the - above name will be created with its - -editable option set to 1.  You can - use the script corresponding to the -editstartcommand - tablelist configuration option to make the SpinBox non-editable or define - validations for it, as well as for setting its (range of) values and its - -wrap option.
- -
KEYWORDS
- -
tablelist, editing, BWidget, SpinBox
-
- -
-

Contents     Start page

-
-
- -

The tablelist::addBWidgetComboBox - Command

- -
-
NAME
- -
tablelist::addBWidgetComboBox – Register the - ComboBox widget from the BWidget package for interactive cell editing
- -
SYNOPSIS
- -
-
-tablelist::addBWidgetComboBox ?name?
-
-
- -
DESCRIPTION
- -
This command registers the ComboBox widget from the BWidget package for - interactive cell editing in tablelist widgets.  The optional argument - specifies the name to be used for the ComboBox widget as the value of the - -editwindow column or - cell configuration option.  It may be any string that is different - from the Tk core and tile edit window names.  The default is - ComboBox.  The command returns its - name argument.
- -
The temporary embedded ComboBox widget associated with the - above name will be created with its - -editable option set to 1.  You can - use the script corresponding to the -editstartcommand - tablelist configuration option to make the ComboBox non-editable or define - validations for it, as well as for populating its listbox component (with - the aid of the ComboBox widget's -values option).
- -
KEYWORDS
- -
tablelist, editing, BWidget, ComboBox
-
- -
-

Contents     Start page

-
- - DELETED tablelist5.13/doc/tablelistBinding.html Index: tablelist5.13/doc/tablelistBinding.html ================================================================== --- tablelist5.13/doc/tablelistBinding.html +++ tablelist5.13/doc/tablelistBinding.html @@ -1,205 +0,0 @@ - - - Helper Commands Used in Tablelist Binding Scripts - - - - - - - - -
-

Helper Commands Used in Tablelist Binding Scripts

- -

For Tablelist Version 5.13

- -

by

- -

Csaba Nemethi

- -
- csaba.nemethi@t-online.de -
-
-
- -

Contents

- - - - -
- -

Overview

- -

The commands described in this reference page are designed to be used in - binding scripts associated with the binding tags whose names are returned by - the bodytag - and labeltag - subcommands of the Tcl command associated with a tablelist widget.  The - first two of these commands are also used in the default binding scripts - associated with the binding tag TablelistBody.  For - details and examples see the sections DEFAULT AND INDIVIDUAL BINDINGS FOR THE - TABLELIST BODY and DEFAULT - AND INDIVIDUAL BINDINGS FOR THE HEADER LABELS.

- -
-

Contents     Start page

-
-
- -

The tablelist::convEventFields - Command

- -
-
NAME
- -
tablelist::convEventFields – Convert event fields - relative to a descendant of a tablelist widget
- -
SYNOPSIS
- -
-
-tablelist::convEventFields descendantPathName x y
-
-
- -
DESCRIPTION
- -
This command gets the path name of a tablelist widget and the x and y - coordinates relative to the latter from the path name - descendantPathName of one of its descendants and from - the x and y coordinates x, y - relative to this descendant.  The command returns these values as the - components of a list consisting of three elements.
- -
- In a binding script, the descendant widget corresponds to the event field - %W, which can be the tablelist's body, one of the - separator frames, a label widget displaying an embedded image, or (a - descendant of) an embedded window.  It can also be a header label or - an additional widget placed by Tablelist into a header label for - displaying a header image or a sort arrow.  Likewise, the arguments - x and y correspond to the event - fields %x and %y.  The three - elements of the list returned by the command are usually assigned to the - help variables tablelist::W, - tablelist::x, and tablelist::y, - by using the statement - -
-
-foreach {tablelist::W tablelist::x tablelist::y} \
-    [tablelist::convEventFields %W %x %y] {}
-
-
-
- -
KEYWORDS
- -
tablelist, event fields, binding script
-
- -
-

Contents     Start page

-
-
- -

The tablelist::getTablelistPath - Command

- -
-
NAME
- -
tablelist::getTablelistPath – Get the path name of a - tablelist widget from the path name of one of its descendants
- -
SYNOPSIS
- -
-
-tablelist::getTablelistPath descendantPathName
-
-
- -
DESCRIPTION
- -
This command gets the path name of a tablelist widget from the path - name descendantPathName of one of its descendants.
- -
In a binding script, the descendant widget corresponds to - the event field %W, which can be the tablelist's body, - one of the separator frames, a label widget displaying an embedded image, - or (a descendant of) an embedded window.  It can also be a header - label or an additional widget placed by Tablelist into a header label for - displaying a header image or a sort arrow.  The return value is often - assigned to the help variable tablelist::W.
- -
KEYWORDS
- -
tablelist, path name, binding script
-
- -
-

Contents     Start page

-
-
- -

The - tablelist::getTablelistColumn Command

- -
-
NAME
- -
tablelist::getTablelistColumn – Get the column - number from the path name of a tablelist header label
- -
SYNOPSIS
- -
-
-tablelist::getTablelistColumn headerLabelPathName
-
-
- -
DESCRIPTION
- -
This command gets the column number from the path name - headerLabelPathName of a tablelist header label or of - an additional widget placed by Tablelist into a header label for displaying - a header image or a sort arrow.
- -
In a binding script, the command argument corresponds to the - event field %W.  The return value is often - assigned to the help variable tablelist::col.
- -
KEYWORDS
- -
tablelist, path name, binding script
-
- -
-

Contents     Start page

-
- - DELETED tablelist5.13/doc/tablelistColSort.html Index: tablelist5.13/doc/tablelistColSort.html ================================================================== --- tablelist5.13/doc/tablelistColSort.html +++ tablelist5.13/doc/tablelistColSort.html @@ -1,209 +0,0 @@ - - - Commands for Interactive Sorting by One or More Columns - - - - - - - - -
-

Commands for Interactive Sorting by One or More Columns

- -

For Tablelist Version 5.13

- -

by

- -

Csaba Nemethi

- -
- csaba.nemethi@t-online.de -
-
-
- -

Contents

- - - - -
- -

Overview

- -

The commands described in this reference page enable the user to sort the - items of a tablelist widget based on one or more of its columns, with the aid - of the left mouse button.

- -

If the tablelist::sortByColumn command was specified - as the value of the -labelcommand - configuration option, then by pressing mouse button 1 over one of the header - labels and later releasing it over the same label, the items will be sorted - based on the elements of the corresponding column.

- -

If the tablelist::addToSortColumns command was - specified as the value of the -labelcommand2 - configuration option, then by pressing mouse button 1 together with the - Shift key over one of the header labels and later releasing it - over the same label, the corresponding column will be appended to the list of - sort columns, or (if it was already contained in that list) the corresponding - sort order will be toggled; in both cases, the items will be sorted based on - the updated lists of sort columns and sort orders.

- -
-

Contents     Start page

-
-
- -

The tablelist::sortByColumn - Command

- -
-
NAME
- -
tablelist::sortByColumn – Sort the items of a - tablelist widget based on one of its columns
- -
SYNOPSIS
- -
-
-tablelist::sortByColumn pathName columnIndex
-
-
- -
DESCRIPTION
- -
This command sorts the items of the tablelist widget pathName - based on the elements of the column specified by - columnIndex.  This is done by invoking the - sortbycolumn subcommand - of the Tcl command associated with the given tablelist widget.  If the - items were last sorted in increasing order, based on the same column given - by columnIndex, and no subsequent invocation of the - resetsortinfo - subcommand was made, then the last argument passed to - sortbycolumn will be -decreasing, - otherwise -increasing.
- -
After sorting the items, the virtual event - <<TablelistColumnSorted>> is - generated.  For Tk versions 8.5 or higher, this virtual event is - generated with its -data option set to a list - consisting of the numerical column index and the sort order - (decreasing or increasing).  - The command returns the sort order, as decreasing or - increasing.
- -
If the specified column's -showlinenumbers - option has been set to true, then the actions described above are not - performed and the return value is an empty string.
- -
tablelist::sortByColumn is usually - specified as the value of the -labelcommand - configuration option for a tablelist widget.
- -
KEYWORDS
- -
tablelist, sort, column, widget
-
- -
-

Contents     Start page

-
-
- -

The tablelist::addToSortColumns - Command

- -
-
NAME
- -
tablelist::addToSortColumns – Add a column index to - the list of sort columns and perform the multi-column sorting
- -
SYNOPSIS
- -
-
-tablelist::addToSortColumns pathName columnIndex
-
-
- -
DESCRIPTION
- -
This command adds the column index specified by - columnIndex to the list of sort columns of the tablelist widget pathName - and sorts the items based on the elements of the columns indicated by the - modified list.  This is done by invoking the sortbycolumnlist - subcommand of the Tcl command associated with the given tablelist - widget.  The two arguments passed to - sortbycolumnlist are built as follows: (a) if the given - column index is already contained in the widget's list of sort columns - (returned by the sortcolumnlist - subcommand) then this list is left unchanged and the sort order list - (returned by the sortorderlist - subcommand) is updated by toggling its corresponding element from - increasing to decreasing and - vice-versa; (b) otherwise the column index is appended to the list of sort - columns and the value increasing is appended to the - list of sort orders.
- -
After sorting the items by passing the two updated lists to - the sortbycolumnlist subcommand, the virtual event - <<TablelistColumnsSorted>> (note the plural - form!) is generated.  For Tk versions 8.5 or higher, this virtual - event is generated with its -data option set to a list - consisting of the two above-mentioned updated lists passed to - sortbycolumnlist as arguments.  The command - returns the new sort order corresponding to the given column, as - decreasing or increasing.
- -
If the specified column's -showlinenumbers - option has been set to true, then the actions described above are not - performed and the return value is an empty string.
- -
tablelist::addToSortColumns is usually - specified as the value of the -labelcommand2 - configuration option for a tablelist widget.
- -
KEYWORDS
- -
tablelist, sort, column list, widget
-
- -
-

Contents     Start page

-
- - DELETED tablelist5.13/doc/tablelistCombobox.html Index: tablelist5.13/doc/tablelistCombobox.html ================================================================== --- tablelist5.13/doc/tablelistCombobox.html +++ tablelist5.13/doc/tablelistCombobox.html @@ -1,137 +0,0 @@ - - - Interactive Tablelist Cell Editing Using the combobox Package - - - - - - - - -
-

Interactive Tablelist Cell Editing Using the combobox Package

- -

For Tablelist Version 5.13

- -

by

- -

Csaba Nemethi

- -
- csaba.nemethi@t-online.de -
-
-
- -

Contents

- - - - -
- -

Overview

- -

Bryan Oakley's combobox package is a library extension for Tcl/Tk versions - 8.0 or higher, written in pure Tcl/Tk code.  Its download location - is

- -
-
- http://www1.clearlight.com/~oakley/tcl/combobox -
-
- -

Tablelist supports interactive cell editing with the aid of the combobox - widget implemented in the package mentioned above.  The steps needed for - using this widget for editing the cells of a given column are as follows:

- -
    -
  1. Register the combobox widget for interactive cell editing by invoking - the tablelist::addOakleyCombobox command described - below.
  2. - -
  3. Use the tablelist widget's columnconfigure - subcommand to set the given column's -editable option to true - and its -editwindow option to - the value returned by the command mentioned above.  (These options are - supported at cell level, too, with the aid of the cellconfigure - subcommand.)
  4. -
- -
-

Contents     Start page

-
-
- -

The tablelist::addOakleyCombobox - Command

- -
-
NAME
- -
tablelist::addOakleyCombobox – Register Bryan - Oakley's combobox widget for interactive cell editing
- -
SYNOPSIS
- -
-
-tablelist::addOakleyCombobox ?name?
-
-
- -
DESCRIPTION
- -
This command registers Bryan Oakley's combobox widget for interactive - cell editing in tablelist widgets.  The optional argument specifies - the name to be used for the combobox widget as the value of the - -editwindow column or - cell configuration option.  It may be any string that is different - from the Tk core and tile edit window names.  The default is - combobox.  The command returns its - name argument.
- -
The temporary embedded combobox widget associated with the - above name will be created with its - -editable option set to 1.  You can - use the script corresponding to the -editstartcommand - tablelist configuration option to make the combobox non-editable or define - validations for its entry child (whose path name can be obtained by - invoking the tablelist widget's entrypath subcommand, or by - appending .entry to the path name of the combobox - widget, or, if using combobox version 2.3 or later, with the aid of the - combobox widget's  subwidget entry  - subcommand), as well as for populating its listbox component (by using the - combobox widget's  list insert  - subcommand).
- -
KEYWORDS
- -
tablelist, editing, combobox
-
- - - - DELETED tablelist5.13/doc/tablelistCtext.html Index: tablelist5.13/doc/tablelistCtext.html ================================================================== --- tablelist5.13/doc/tablelistCtext.html +++ tablelist5.13/doc/tablelistCtext.html @@ -1,182 +0,0 @@ - - - Interactive Tablelist Cell Editing Using the ctext Package - - - - - - - - -
-

Interactive Tablelist Cell Editing Using the ctext Package

- -

For Tablelist Version 5.13

- -

by

- -

Csaba Nemethi

- -
- csaba.nemethi@t-online.de -
-
-
- -

Contents

- - - - -
- -

Overview

- -

George Peter Staplin's ctext package is a library extension for Tcl/Tk - versions 8.0 or higher, written in pure Tcl/Tk code.  It is part of - tklib, which has the address

- -
-
- http://core.tcl.tk/tklib -
-
- -

Tablelist supports interactive cell editing with the aid of the ctext - widget implemented in the package mentioned above.  The steps needed for - using this widget for editing the cells of a given column are as follows:

- -
    -
  1. Register the ctext widget for interactive cell editing by invoking the - tablelist::addCtext command - described below.
  2. - -
  3. Use the tablelist widget's columnconfigure - subcommand to set the given column's -editable option to true - and its -editwindow option to - the value returned by the command mentioned above.  (These options are - supported at cell level, too, with the aid of the cellconfigure - subcommand.)
  4. -
- -
-

Contents     Start page

-
-
- -

The tablelist::addCtext Command

- -
-
NAME
- -
tablelist::addCtext – Register the ctext widget for - interactive cell editing
- -
SYNOPSIS
- -
-
-tablelist::addCtext ?name?
-
-
- -
DESCRIPTION
- -
This command registers the ctext widget for interactive cell editing in - tablelist widgets.  The optional argument specifies the name to be - used for the ctext widget as the value of the -editwindow column or - cell configuration option.  It may be any string that is different - from the Tk core and tile edit window names.  The default is - ctext.  The command returns its - name argument.
- -
The temporary embedded ctext widget used for interactive - cell editing will be created with its -padx and - -pady options set to 2, its - -wrap option set to none, and its - initial height set to the number of lines contained in it.  There is, - however, an exception from this rule:  If the -wrap option of the cell's - column was set to true and Tk version 8.5 or higher is being used, then the - ctext widget's -wrap option will be set to - word and its initial height will equal the number of - display lines (taking into account the line wraps) contained in - it.  You can use the script corresponding to the -editstartcommand - tablelist configuration option to override the initial settings according - to your needs.
- -
If the ctext widget's -wrap option was - set to word or char (either by - Tablelist or from within the above-mentioned script) and Tk version 8.5 or - higher is being used, then, whenever its width changes (e.g., due to - interactive column resizing), its height will be set automatically to the - number of display lines contained in it.  (The number of display lines - is retrieved with the aid of the  count - -displaylines  ctext widget subcommand, introduced in Tk - 8.5.)
- -
If the widget callback package Wcb was loaded into the - interpreter (via  package require Wcb  - or  package require wcb)  then the ctext - widget's height will be updated automatically whenever text is inserted - into or deleted from it, which makes the editing much more - user-friendly.  This is achieved by using an appropriately defined - after-insert and after-delete - callback for the edit window.  You can use the script corresponding to - the -editstartcommand - tablelist configuration option to define further callbacks for the ctext - widget.  (The above-mentioned callback is created via - wcb::cbappend, after returning from that - script.)
- -
The Tab key is reserved for navigation between - the editable cells, but the user can insert a tabulator character into the - ctext widget by pressing Control-i.
- -
Unlike in the case of the other widgets used for interactive - cell editing (except the Tk core text widget), the Return and - KP_Enter keys insert a newline character into the ctext - widget.  Control-j can also be used for inserting a - newline.  Control-Return and - Control-KP_Enter terminate the editing and destroy the edit - window.
- -
Control-Home and Control-End have - their well-known text widget-specific bindings, just like - Meta-< and Meta-> if - tk_strictMotif is false.  Again, this is different - from the behavior of the other widgets used for interactive cell editing - (except the Tk core text widget).  For jumping into the first/last - editable cell, the user can press - Alt-Home/Alt-End or - Meta-Home/Meta-End - (Command-Home/Command-End on Mac OS Classic and - Mac OS X Aqua).
- -
KEYWORDS
- -
tablelist, editing, ctext
-
- - - - DELETED tablelist5.13/doc/tablelistIwidgets.html Index: tablelist5.13/doc/tablelistIwidgets.html ================================================================== --- tablelist5.13/doc/tablelistIwidgets.html +++ tablelist5.13/doc/tablelistIwidgets.html @@ -1,354 +0,0 @@ - - - Interactive Tablelist Cell Editing Using the Iwidgets Package - - - - - - - - -
-

Interactive Tablelist Cell Editing Using the Iwidgets Package

- -

For Tablelist Version 5.13

- -

by

- -

Csaba Nemethi

- -
- csaba.nemethi@t-online.de -
-
-
- -

Contents

- - - - -
- -

Overview

- -

The Iwidgets package (also known as [incr Widgets]) is a library extension - for Tcl/Tk versions 8.0 or higher, written in pure Tcl/Tk code.  It - requires the compiled packages Itcl and Itk (also known as [incr Tcl] and - [incr Tk], respectively).  The download location of these three library - packages is

- -
-
- http://sourceforge.net/projects/incrtcl/files -
-
- -

Tablelist supports interactive cell editing with the aid of the - entryfield, datefield, dateentry, timefield, timeentry, spinner, spinint, and - combobox widgets from the Iwidgets package.  The steps needed for using - one of these widgets for editing the cells of a given column are as - follows:

- -
    -
  1. Register the desired widget for interactive cell editing by invoking - one of the commands described in this reference page.
  2. - -
  3. Use the tablelist widget's columnconfigure - subcommand to set the given column's -editable option to true - and its -editwindow option to - the value returned by the command mentioned above.  (These options are - supported at cell level, too, with the aid of the cellconfigure - subcommand.)
  4. -
- -
-

Contents     Start page

-
-
- -

The tablelist::addIncrEntryfield - Command

- -
-
NAME
- -
tablelist::addIncrEntryfield – Register the - entryfield widget from the Iwidgets package for interactive cell - editing
- -
SYNOPSIS
- -
-
-tablelist::addIncrEntryfield ?name?
-
-
- -
DESCRIPTION
- -
This command registers the entryfield widget from the Iwidgets package - for interactive cell editing in tablelist widgets.  The optional - argument specifies the name to be used for the entryfield widget as the - value of the -editwindow column or - cell configuration option.  It may be any string that is different - from the Tk core and tile edit window names.  The default is - entryfield.  The command returns its - name argument.
- -
KEYWORDS
- -
tablelist, editing, Iwidgets, entryfield
-
- -
-

Contents     Start page

-
-
- -

The tablelist::addIncrDateTimeWidget - Command

- -
-
NAME
- -
tablelist::addIncrDateTimeWidget – Register the - datefield, dateentry, timefield, or timeentry widget from the Iwidgets - package for interactive cell editing
- -
SYNOPSIS
- -
-
-tablelist::addIncrDateTimeWidget datefield|dateentry|timefield|timeentry ?-seconds? ?name?
-
-
- -
DESCRIPTION
- -
This command registers the datefield, dateentry, timefield, or - timeentry widget from the Iwidgets package for interactive cell editing in - tablelist widgets.  If the -seconds argument is - present then the finishediting - subcommand of the Tcl command associated with the tablelist widget will - retrieve the contents of the embedded window used for interactive cell - editing as an integer clock value (in seconds), otherwise as a - string.  Use this option for tablelist widgets whose internal list - contains date or time information in seconds (displayed with the aid of - commands given by the -formatcommand - column configuration option).  The second optional argument specifies - the name to be used for the datefield, dateentry, timefield, or timeentry - widget as the value of the -editwindow column or - cell configuration option.  It may be any string that is different - from the Tk core and tile edit window names.  The default is - datefield, dateentry, - timefield, or timeentry, as given - by the first argument.  The command returns its - name argument.
- -
When editing a cell with the aid of the temporary embedded - datefield, dateentry, timefield, or timeentry widget associated with the - above name, you can use the script corresponding to the - -editstartcommand - tablelist configuration option to set any of the widget's options, like - -gmt, -iq, -int - ("international" date format, supported by datefield and dateentry - widgets), or -format (for timefield and timeentry - widgets, with the values civilian and - military).
- -
KEYWORDS
- -
tablelist, editing, Iwidgets, datefield, dateentry, timefield, - timeentry
-
- -
-

Contents     Start page

-
-
- -

The tablelist::addIncrSpinner - Command

- -
-
NAME
- -
tablelist::addIncrSpinner – Register the spinner - widget from the Iwidgets package for interactive cell editing
- -
SYNOPSIS
- -
-
-tablelist::addIncrSpinner ?name?
-
-
- -
DESCRIPTION
- -
This command registers the spinner widget from the Iwidgets package for - interactive cell editing in tablelist widgets.  The optional argument - specifies the name to be used for the spinner widget as the value of the - -editwindow column or - cell configuration option.  It may be any string that is different - from the Tk core and tile edit window names.  The default is - spinner.  The command returns its - name argument.
- -
When editing a cell with the aid of the temporary embedded - spinner widget associated with the above name, you can - use the script corresponding to the -editstartcommand - tablelist configuration option to define validations for the widget or set - any of its other options, like -decrement and - -increment.
- -
KEYWORDS
- -
tablelist, editing, Iwidgets, spinner
-
- -
-

Contents     Start page

-
-
- -

The tablelist::addIncrSpinint - Command

- -
-
NAME
- -
tablelist::addIncrSpinint – Register the spinint - widget from the Iwidgets package for interactive cell editing
- -
SYNOPSIS
- -
-
-tablelist::addIncrSpinint ?name?
-
-
- -
DESCRIPTION
- -
This command registers the spinint widget from the Iwidgets package for - interactive cell editing in tablelist widgets.  The optional argument - specifies the name to be used for the spinint widget as the value of the - -editwindow column or - cell configuration option.  It may be any string that is different - from the Tk core and tile edit window names.  The default is - spinint.  The command returns its - name argument.
- -
When editing a cell with the aid of the temporary embedded - spinint widget associated with the above name, you can - use the script corresponding to the -editstartcommand - tablelist configuration option to define validations for the widget or set - any of its other options, like -range, - -step, and -wrap.
- -
KEYWORDS
- -
tablelist, editing, Iwidgets, spinint
-
- -
-

Contents     Start page

-
-
- -

The tablelist::addIncrCombobox - Command

- -
-
NAME
- -
tablelist::addIncrCombobox – Register the combobox - widget from the Iwidgets package for interactive cell editing
- -
SYNOPSIS
- -
-
-tablelist::addIncrCombobox ?name?
-
-
- -
DESCRIPTION
- -
This command registers the dropdown-style combobox widget from the - Iwidgets package for interactive cell editing in tablelist widgets.  - The optional argument specifies the name to be used for the combobox widget - as the value of the -editwindow column or - cell configuration option.  It may be any string that is different - from the Tk core and tile edit window names.  The default is - combobox.  The command returns its - name argument.
- -
The temporary embedded combobox widget associated with the - above name will be created with its - -editable option set to 1.  You can - use the script corresponding to the -editstartcommand - tablelist configuration option to make the combobox non-editable or define - validations for it, as well as for populating its listbox component (by - using the combobox widget's  insert list  - subcommand).
- -
KEYWORDS
- -
tablelist, editing, Iwidgets, combobox
-
- -
-

Contents     Start page

-
- - DELETED tablelist5.13/doc/tablelistMentry.html Index: tablelist5.13/doc/tablelistMentry.html ================================================================== --- tablelist5.13/doc/tablelistMentry.html +++ tablelist5.13/doc/tablelistMentry.html @@ -1,489 +0,0 @@ - - - Interactive Tablelist Cell Editing Using the Mentry Package - - - - - - - - -
-

Interactive Tablelist Cell Editing Using the Mentry Package

- -

For Tablelist Version 5.13

- -

by

- -

Csaba Nemethi

- -
- csaba.nemethi@t-online.de -
-
-
- -

Contents

- - - - -
- -

Overview

- -

The multi-entry package Mentry is a library extension for Tcl/Tk versions - 8.0 or higher, written in pure Tcl/Tk code.  Its download location - is

- -
-
- http://www.nemethi.de -
-
- -

Starting with version 3.0, the Mentry distribution provides not only the - package Mentry, but also its tile-based equivalent Mentry_tile, which enables - the theme-specific appearance of mentry widgets; this package requires Tcl/Tk - 8.4 or higher and tile 0.6 or higher.

- -

Tablelist supports interactive cell editing with the aid of the mentry - widgets of type "Date", "Time", - "DateTime, "FixedPoint", "IPAddr", and - "IPv6Addr".  The steps needed for using one of these - widgets for editing the cells of a given column are as follows:

- -
    -
  1. Register the desired widget for interactive cell editing by invoking - one of the commands described in this reference page.
  2. - -
  3. Use the tablelist widget's columnconfigure - subcommand to set the given column's -editable option to true - and its -editwindow option to - the value returned by the command mentioned above.  (These options are - supported at cell level, too, with the aid of the cellconfigure - subcommand.)
  4. -
- -
-

Contents     Start page

-
-
- -

The tablelist::addDateMentry Command

- -
-
NAME
- -
tablelist::addDateMentry – Register the mentry - widget of type "Date" for interactive cell editing
- -
SYNOPSIS
- -
-
-tablelist::addDateMentry format separator ?-gmt? ?name?
-
-
- -
DESCRIPTION
- -
This command registers the widget created by the - mentry::dateMentry command from the Mentry (or - Mentry_tile) package for interactive cell editing in tablelist - widgets.  The format and - separator arguments have the same meanings as in the - mentry::dateMentry command.  If the - -gmt argument is present then both the internal clock - value and its external date representation in the mentry widget will be - viewed as Greenwich Mean Time, otherwise as local time.  The second - optional argument specifies the name to be used for the mentry widget as - the value of the -editwindow column or - cell configuration option.  It may be any string that is different - from the Tk core and tile edit window names.  The default is - dateMentry.  The command returns its - name argument.
- -
A tablelist column having the above name - as the value of its -editwindow option must contain as - internal cell values date information in seconds (displayed with the aid of - a command given by the -formatcommand - column configuration option).  The finishediting - subcommand of the Tcl command associated with the tablelist widget will - retrieve the contents of the embedded window used for interactive cell - editing by invoking the mentry::getClockVal - command.  The value returned by this command (a clock value in seconds - or one of the error strings "EMPTY", "BAD", - "BAD_DATE", or "BAD_YEAR") will be passed to the - script corresponding to the -editendcommand - tablelist configuration option (if any), as its last argument.  If - this value is one of the above error strings then the script should reject - the mentry's contents by invoking the rejectinput - subcommand.
- -
KEYWORDS
- -
tablelist, editing, Mentry, date
-
- -
-

Contents     Start page

-
-
- -

The tablelist::addTimeMentry Command

- -
-
NAME
- -
tablelist::addTimeMentry – Register the mentry - widget of type "Time" for interactive cell editing
- -
SYNOPSIS
- -
-
-tablelist::addTimeMentry format separator ?-gmt? ?name?
-
-
- -
DESCRIPTION
- -
This command registers the widget created by the - mentry::timeMentry command from the Mentry (or - Mentry_tile) package for interactive cell editing in tablelist - widgets.  The format and - separator arguments have the same meanings as in the - mentry::timeMentry command.  If the - -gmt argument is present then both the internal clock - value and its external time representation in the mentry widget will be - viewed as Greenwich Mean Time, otherwise as local time.  The second - optional argument specifies the name to be used for the mentry widget as - the value of the -editwindow column or - cell configuration option.  It may be any string that is different - from the Tk core and tile edit window names.  The default is - timeMentry.  The command returns its - name argument.
- -
A tablelist column having the above name - as the value of its -editwindow option must contain as - internal cell values time information in seconds (displayed with the aid of - a command given by the -formatcommand - column configuration option).  The finishediting - subcommand of the Tcl command associated with the tablelist widget will - retrieve the contents of the embedded window used for interactive cell - editing by invoking the mentry::getClockVal - command.  The value returned by this command (a clock value in seconds - or one of the error strings "EMPTY" or "BAD") - will be passed to the script corresponding to the -editendcommand - tablelist configuration option (if any), as its last argument.  If - this value is one of the above error strings then the script should reject - the mentry's contents by invoking the rejectinput - subcommand.
- -
KEYWORDS
- -
tablelist, editing, Mentry, time
-
- -
-

Contents     Start page

-
-
- -

The tablelist::addDateTimeMentry - Command

- -
-
NAME
- -
tablelist::addDateTimeMentry – Register the mentry - widget of type "DateTime" for interactive cell editing
- -
SYNOPSIS
- -
-
-tablelist::addDateTimeMentry format dateSeparator timeSeparator ?-gmt? ?name?
-
-
- -
DESCRIPTION
- -
This command registers the widget created by the - mentry::dateTimeMentry command from the Mentry (or - Mentry_tile) package for interactive cell editing in tablelist - widgets.  The format, - dateSeparator, and timeSeparator - arguments have the same meanings as in the - mentry::dateTimeMentry command.  If the - -gmt argument is present then both the internal clock - value and its external date & time representation in the mentry widget - will be viewed as Greenwich Mean Time, otherwise as local time.  The - second optional argument specifies the name to be used for the mentry - widget as the value of the -editwindow column or - cell configuration option.  It may be any string that is different - from the Tk core and tile edit window names.  The default is - dateTimeMentry.  The command returns its - name argument.
- -
A tablelist column having the above name - as the value of its -editwindow option must contain as - internal cell values date & time information in seconds (displayed with - the aid of a command given by the -formatcommand - column configuration option).  The finishediting - subcommand of the Tcl command associated with the tablelist widget will - retrieve the contents of the embedded window used for interactive cell - editing by invoking the mentry::getClockVal - command.  The value returned by this command (a clock value in seconds - or one of the error strings "EMPTY", "BAD", - "BAD_DATE", or "BAD_YEAR") will be passed to the - script corresponding to the -editendcommand - tablelist configuration option (if any), as its last argument.  If - this value is one of the above error strings then the script should reject - the mentry's contents by invoking the rejectinput - subcommand.
- -
KEYWORDS
- -
tablelist, editing, Mentry, date, time
-
- -
-

Contents     Start page

-
-
- -

The tablelist::addFixedPointMentry - Command

- -
-
NAME
- -
tablelist::addFixedPointMentry – Register the mentry - widget of type "FixedPoint" for interactive cell editing
- -
SYNOPSIS
- -
-
-tablelist::addFixedPointMentry count1 count2 ?-comma? ?name?
-
-
- -
DESCRIPTION
- -
This command registers the widget created by the - mentry::fixedPointMentry command from the Mentry (or - Mentry_tile) package for interactive cell editing in tablelist - widgets.  The count1, count2, - and -comma arguments have the same meanings as in the - mentry::fixedPointMentry command.  The second - optional argument specifies the name to be used for the mentry widget as - the value of the -editwindow column or - cell configuration option.  It may be any string that is different - from the Tk core and tile edit window names.  The default is - fixedPointMentry_count1.count2 - (e.g., fixedPointMentry_6.2) or - fixedPointMentry_count1,count2 - (e.g., fixedPointMentry_6,2), depending on the presence - of the optional -comma argument.  The command - returns its name argument.
- -
A tablelist column having the above name - as the value of its -editwindow option must contain - real numbers as internal cell values.  The finishediting - subcommand of the Tcl command associated with the tablelist widget will - retrieve the contents of the embedded window used for interactive cell - editing by invoking the mentry::getReal command.  - The value returned by this command (a real number or the error string - "EMPTY") will be passed to the script corresponding to the - -editendcommand - tablelist configuration option (if any), as its last argument.  If - this value is the above error string then the script should reject the - mentry's contents by invoking the rejectinput - subcommand.
- -
KEYWORDS
- -
tablelist, editing, Mentry, real number
-
- -
-

Contents     Start page

-
-
- -

The tablelist::addIPAddrMentry - Command

- -
-
NAME
- -
tablelist::addIPAddrMentry – Register the mentry - widget of type "IPAddr" for interactive cell editing
- -
SYNOPSIS
- -
-
-tablelist::addIPAddrMentry ?name?
-
-
- -
DESCRIPTION
- -
This command registers the widget created by the - mentry::ipAddrMentry command from the Mentry (or - Mentry_tile) package for interactive cell editing in tablelist - widgets.  The optional argument specifies the name to be used for the - mentry widget as the value of the -editwindow column or - cell configuration option.  It may be any string that is different - from the Tk core and tile edit window names.  The default is - ipAddrMentry.  The command returns its - name argument.
- -
A tablelist column having the above name - as the value of its -editwindow option must contain IP - addresses as internal cell values.  The finishediting - subcommand of the Tcl command associated with the tablelist widget will - retrieve the contents of the embedded window used for interactive cell - editing by invoking the mentry::getIPAddr - command.  The value returned by this command (an IP address or the - error string "EMPTY") will be passed to the script - corresponding to the -editendcommand - tablelist configuration option (if any), as its last argument.  If - this value is the above error string then the script should reject the - mentry's contents by invoking the rejectinput - subcommand.
- -
KEYWORDS
- -
tablelist, editing, Mentry, IP address
-
- -
-

Contents     Start page

-
-
- -

The tablelist::addIPv6AddrMentry - Command

- -
-
NAME
- -
tablelist::addIPv6AddrMentry – Register the mentry - widget of type "IPv6Addr" for interactive cell editing
- -
SYNOPSIS
- -
-
-tablelist::addIPv6AddrMentry ?name?
-
-
- -
DESCRIPTION
- -
This command registers the widget created by the - mentry::ipv6AddrMentry command from the Mentry (or - Mentry_tile) package for interactive cell editing in tablelist - widgets.  The optional argument specifies the name to be used for the - mentry widget as the value of the -editwindow column or - cell configuration option.  It may be any string that is different - from the Tk core and tile edit window names.  The default is - ipv6AddrMentry.  The command returns its - name argument.
- -
A tablelist column having the above name - as the value of its -editwindow option must contain - IPv6 addresses as internal cell values.  The finishediting - subcommand of the Tcl command associated with the tablelist widget will - retrieve the contents of the embedded window used for interactive cell - editing by invoking the mentry::getIPv6Addr - command.  The value returned by this command (an IPv6 address or the - error string "EMPTY") will be passed to the script - corresponding to the -editendcommand - tablelist configuration option (if any), as its last argument.  If - this value is the above error string then the script should reject the - mentry's contents by invoking the rejectinput - subcommand.
- -
KEYWORDS
- -
tablelist, editing, Mentry, IPv6 address
-
- -
-

Contents     Start page

-
- - DELETED tablelist5.13/doc/tablelistThemes.html Index: tablelist5.13/doc/tablelistThemes.html ================================================================== --- tablelist5.13/doc/tablelistThemes.html +++ tablelist5.13/doc/tablelistThemes.html @@ -1,269 +0,0 @@ - - - Commands Related to Tile Themes - - - - - - - - -
-

Commands Related to Tile Themes

- -

For Tablelist Version 5.13

- -

by

- -

Csaba Nemethi

- -
- csaba.nemethi@t-online.de -
-
-
- -

Contents

- - - - -
- -

Overview

- -

The commands described in this reference page should only be invoked when - using the package Tablelist_tile.  They enable you to set and query the - current theme, to retrieve a list of the available themes, and to make sure - that your widgets will have a theme-specific appearance.

- -
-

Contents     Start page

-
-
- -

The tablelist::setTheme Command

- -
-
NAME
- -
tablelist::setTheme – Set the current theme
- -
SYNOPSIS
- -
-
-tablelist::setTheme theme
-
-
- -
DESCRIPTION
- -
This command sets the current theme to theme, - loading it if necessary.  It is simply an alias for - ttk::setTheme or tile::setTheme, - depending on the tile version loaded into the interpreter.  (The - tile::setTheme command was renamed to - ttk::setTheme in tile version 0.8.)
- -
Being just an alias for a tile library procedure, the - tablelist::setTheme command does exactly the same as - the original one: It loads the package implementing the given theme if - needed, sets the theme to the specified one, and saves the latter in the - variable ttk::currentTheme or - tile::currentTheme, depending on the current tile - version.
- -
KEYWORDS
- -
tablelist, theme, tile
-
- -
-

Contents     Start page

-
-
- -

The tablelist::getCurrentTheme - Command

- -
-
NAME
- -
tablelist::getCurrentTheme – Get the current - theme
- -
SYNOPSIS
- -
-
-tablelist::getCurrentTheme
-
-
- -
DESCRIPTION
- -
This command returns the value of the variable - ttk::currentTheme or - tile::currentTheme, depending on the tile version - loaded into the interpreter.  (The namespace containing the variable - currentTheme was changed in tile version 0.8 from - tile to ttk.)
- -
KEYWORDS
- -
tablelist, theme, tile
-
- -
-

Contents     Start page

-
-
- -

The tablelist::getThemes Command

- -
-
NAME
- -
tablelist::getThemes – Get the themes registered in - the package database
- -
SYNOPSIS
- -
-
-tablelist::getThemes
-
-
- -
DESCRIPTION
- -
This command returns a list of the themes registered in the package - database.  It is simply an alias for ttk::themes - or tile::availableThemes, depending on the tile version - loaded into the interpreter.  (The - tile::availableThemes command was renamed to - ttk::themes in tile version 0.8.)
- -
KEYWORDS
- -
tablelist, theme, tile
-
- -
-

Contents     Start page

-
-
- -

tablelist::setThemeDefaults - Command

- -
-
NAME
- -
tablelist::setThemeDefaults – Set theme-specific - default values of some tablelist configuration options
- -
SYNOPSIS
- -
-
-tablelist::setThemeDefaults
-
-
- -
DESCRIPTION
- -
This command populates the array - tablelist::themeDefaults with theme-specific default - values of a series of Tablelist configuration options.  The array - names are the command-line names of the options, and the corresponding - array values are the default values of these configuration options for the - currently set tile theme.
- -
The options whose names and values are written into the - array tablelist::themeDefaults are: - -background, -foreground, - -disabledforeground, - -stripebackground, - -selectbackground, - -selectforeground, - -selectborderwidth, -font, - -labelforeground, -labelfont, - -labelborderwidth, -labelpady, - -arrowcolor, -arrowdisabledcolor, - -arrowstyle, and -treestyle.  - In addition, the command sets some other array elements to theme-specific - default values of the background and foreground colors of the column labels - in normal, disabled, - active, and pressed states.  - (Tablelist needs the label colors for handling sort arrows and images with - transparent background in the column labels.)
- -
The tablelist::setThemeDefaults command - is invoked by Tablelist_tile automatically whenever a tablelist widget is - createad or the <<ThemeChanged>> virtual - event is received by a tablelist widget.  In the latter case, the - widget is reconfigured, using the new default values of those options that - were not set explicitly to values different from the corresponding - defaults.
- -
Besides being used by the Tablelist_tile code, this command - can also be invoked in Tcl scripts, still before creating any tile-based - tablelist widget.  By calling it explicitly and using the values - written by it into the array tablelist::themeDefaults, - you can make sure that classical Tk widgets, e.g., listbox and text, will - have a theme-specific appearance, just like the tile widgets.  For - example, you can add some common configuration options to the option - database as follows:
- -
-
-
-tablelist::setThemeDefaults
-if {$tile::currentTheme eq "aqua"} {
-    option add *Listbox.selectBackground \
-               $tablelist::themeDefaults(-selectbackground)
-    option add *Listbox.selectForeground \
-               $tablelist::themeDefaults(-selectforeground)
-} else {
-    option add *selectBackground  $tablelist::themeDefaults(-selectbackground)
-    option add *selectForeground  $tablelist::themeDefaults(-selectforeground)
-}
-option add *selectBorderWidth     $tablelist::themeDefaults(-selectborderwidth)
-
-
-
- -
KEYWORDS
- -
tablelist, theme, tile
-
- -
-

Contents     Start page

-
- - DELETED tablelist5.13/doc/tablelistTile.html Index: tablelist5.13/doc/tablelistTile.html ================================================================== --- tablelist5.13/doc/tablelistTile.html +++ tablelist5.13/doc/tablelistTile.html @@ -1,274 +0,0 @@ - - - Interactive Tablelist Cell Editing Using Tile Widgets - - - - - - - - -
-

Interactive Tablelist Cell Editing Using Tile Widgets

- -

For Tablelist Version 5.13

- -

by

- -

Csaba Nemethi

- -
- csaba.nemethi@t-online.de -
-
-
- -

Contents

- - - - -
- -

Overview

- -

The tile theme engine is a compiled library extension for Tcl/Tk versions - 8.4 or higher.  Beginning with Tk 8.5a6, tile is integrated into the Tk - core.  For earlier Tk versions it can be downloaded from the address

- -
-
- http://sourceforge.net/projects/tktable//files/tile -
-
- -

Tablelist supports interactive cell editing with the aid of the tile - entry, spinbox, combobox, checkbutton, and menubutton widgets, accessed as - ttk::entry, ttk::spinbox, - ttk::combobox, ttk::checkbutton, and - ttk::menubutton, respectively.  The version of the - tile package must be 0.6 or higher (the tile spinbox requires even tile 0.8.3 - or later, or, alternatively, Tk 8.6 or later).  These widgets are - automatically registered for cell editing, hence the only action needed for - using one of them for editing the cells of a given column is as follows:

- -

Use the tablelist widget's columnconfigure - subcommand to set the given column's -editable option to true - and its -editwindow option to - ttk::entry, ttk::spinbox, - ttk::combobox, ttk::checkbutton, or - ttk::menubutton, respectively.  (These options are - supported at cell level, too, with the aid of the cellconfigure - subcommand.)

- -

One known limitation of the currently available tile versions is that - the  style theme use  command can only be used - to set the current theme, but not to retrieve it.  For this reason, - Tablelist makes use of the variable ttk::currentTheme or - tile::currentTheme (depending on the tile version), which - is set by the ttk::setTheme or - tile::setTheme procedure.  From this it follows that - the tile widgets used for interactive cell editing will only be managed as - expected if the platform-specific default theme is either left unchanged or - replaced with another theme by invoking the procedure - ttk::currentTheme or tile::setTheme, - depending on the current tile version.  (See also the tablelist::setTheme - command.)

- -
-

Contents     Start page

-
-
- -

Interactive Cell Editing Using the tile entry Widget

- -
-
DESCRIPTION
- -
The temporary embedded tile entry widget used for interactive cell - editing will be created with an explicitly set value for its - -style option.  Apart from its theme-specific - appearance, it behaves just like its Tk core counterpart.
- -
If an application uses the tile entry widget for interactive - cell editing and also the Wcb package (even if not for that widget), then - the version of Wcb must be 3.1 or higher (because earlier Wcb releases - didn't support any tile widgets).
- -
KEYWORDS
- -
tablelist, editing, tile, entry
-
- -
-

Contents     Start page

-
-
- -

Interactive Cell Editing Using the tile spinbox Widget

- -
-
DESCRIPTION
- -
The temporary embedded tile spinbox widget used for interactive cell - editing will be created with an explicitly set value for its - -style option and with its -state - option set to normal, which makes the widget - editable.  You can use the script corresponding to the - -editstartcommand - tablelist configuration option to set the state of the spinbox to - readonly or define validations for it, as well as for - setting its (range of) values and its -wrap - option.  Apart from its theme-specific appearance, it behaves just - like its Tk core counterpart.
- -
If an application uses the tile spinbox widget for - interactive cell editing and also the Wcb package (even if not for that - widget), then the version of Wcb must be 3.2 or higher (because the support - for the new tile spinbox widget was added to Wcb in its version 3.2).
- -
KEYWORDS
- -
tablelist, editing, tile, spinbox
-
- -
-

Contents     Start page

-
-
- -

Interactive Cell Editing Using the tile combobox - Widget

- -
-
DESCRIPTION
- -
The temporary embedded tile combobox widget used for interactive cell - editing will be created with an explicitly set value for its - -style option and with its -state - option set to normal, which makes the widget - editable.  You can use the script corresponding to the - -editstartcommand - tablelist configuration option to set the state of the combobox to - readonly or define validations for it, as well as for - populating its listbox component (with the aid of the combobox widget's - -values option).
- -
If an application uses the tile combobox widget for - interactive cell editing and also the Wcb package (even if not for that - widget), then the version of Wcb must be 3.1 or higher (because earlier Wcb - releases didn't support any tile widgets).
- -
KEYWORDS
- -
tablelist, editing, tile, combobox
-
- -
-

Contents     Start page

-
-
- -

Interactive Cell Editing Using the tile checkbutton - Widget.

- -
-
DESCRIPTION
- -
The temporary embedded tile checkbutton widget used for interactive - cell editing will be created with explicitly set values for its - -style and -variable options.  - You can use the script corresponding to the -editstartcommand - tablelist configuration option to set any other configuration options, like - -offvalue and -onvalue, according - to the internal values of the cells.  Since the default values - of the -offvalue and -onvalue tile - checkbutton options are 0 and 1, you don't need - to change these options if the cells have the same internal values - 0 and 1.
- -
KEYWORDS
- -
tablelist, editing, tile, checkbutton
-
-
- - - -
-
DESCRIPTION
- -
The temporary embedded tile menubutton widget used for interactive cell - editing will be created with explicitly set values for its - -style and -textvariable - options.  In addition, a menu with its -tearoff - option set to 0 and an appropriate script as the value of its - -postcommand option is created and set as the value of - the menubutton's -menu option.  In an X11 - environment, the menu's appearance is adapted to that of the tablelist - widget by setting its -background, - -foreground, -activebackground, - -activeforeground, and - -activeborderwidth options to appropriate values.  - You can use the script corresponding to the -editstartcommand - tablelist configuration option to set any other options of the menubutton - and/or its associated menu.  You will, however, need this script in - the first place for populating the menu, preferably with radiobutton - entries.  For every radiobutton entry added to the menu, the Tablelist - implementation will make sure that its value (which can be specified by - setting the entry's -value or - -label option) will be displayed in the menubutton as - its text when the entry is selected.  (Tablelist achieves this by - setting the menu entry's -variable option to the value - of the menubutton's -textvariable option.)  For - menu entries of types other than radiobutton (e.g., for command entries) it - is the responsibility of the application to make sure that the selected - entry's text will be shown in the menubutton (for example, with the aid of - the menu entry's -command option).
- -
KEYWORDS
- -
tablelist, editing, tile, menubutton
-
- -
-

Contents     Start page

-
- - DELETED tablelist5.13/doc/tablelistTkCore.html Index: tablelist5.13/doc/tablelistTkCore.html ================================================================== --- tablelist5.13/doc/tablelistTkCore.html +++ tablelist5.13/doc/tablelistTkCore.html @@ -1,288 +0,0 @@ - - - Interactive Tablelist Cell Editing Using Tk Core Widgets - - - - - - - - -
-

Interactive Tablelist Cell Editing Using Tk Core Widgets

- -

For Tablelist Version 5.13

- -

by

- -

Csaba Nemethi

- -
- csaba.nemethi@t-online.de -
-
-
- -

Contents

- - - - -
- -

Overview

- -

Tablelist supports interactive cell editing with the aid of the Tk core - entry, text, spinbox, checkbutton, and menubutton widgets.  These - widgets are automatically registered for cell editing, hence the only action - needed for using one of them for editing the cells of a given column is as - follows:

- -

Use the tablelist widget's columnconfigure - subcommand to set the given column's -editable option to true - and its -editwindow option to - entry, text, - spinbox, checkbutton, or - menubutton, respectively.  (These options are - supported at cell level, too, with the aid of the cellconfigure - subcommand.)  Since the default value of the - -editwindow column configuration option is - entry, it is not necessary to set it explicitly if the - editing should take place with the aid of an embedded entry widget.

- -
-

Contents     Start page

-
-
- -

Interactive Cell Editing Using the entry Widget

- -
-
DESCRIPTION
- -
As mentioned above, the interactive cell editing in a tablelist widget - takes place per default with the aid of an embedded entry widget.  - Refer to the INTERACTIVE CELL - EDITING section of the reference page describing the - tablelist::tablelist command for details on the editing - process.
- -
KEYWORDS
- -
tablelist, editing, entry
-
- -
-

Contents     Start page

-
-
- -

Interactive Cell Editing Using the text Widget

- -
-
DESCRIPTION
- -
The temporary embedded text widget used for interactive cell editing - will be created with its -padx and - -pady options set to 2, its - -wrap option set to none, and its - initial height set to the number of lines contained in it.  There is, - however, an exception from this rule:  If the -wrap option of the cell's - column was set to true and Tk version 8.5 or higher is being used, then the - text widget's -wrap option will be set to - word and its initial height will equal the number of - display lines (taking into account the line wraps) contained in - it.  You can use the script corresponding to the -editstartcommand - tablelist configuration option to override the initial settings according - to your needs.
- -
If the text widget's -wrap option was - set to word or char (either by - Tablelist or from within the above-mentioned script) and Tk version 8.5 or - higher is being used, then, whenever its width changes (e.g., due to - interactive column resizing), its height will be set automatically to the - number of display lines contained in it.  (The number of display lines - is retrieved with the aid of the  count - -displaylines  text widget subcommand, introduced in Tk - 8.5.)
- -
If the widget callback package Wcb was loaded into the - interpreter (via  package require Wcb  - or  package require wcb)  then the text - widget's height will be updated automatically whenever text is inserted - into or deleted from it, which makes the editing much more - user-friendly.  This is achieved by using an appropriately defined - after-insert and after-delete - callback for the edit window.  You can use the script corresponding to - the -editstartcommand - tablelist configuration option to define further callbacks for the text - widget.  (The above-mentioned callback is created via - wcb::cbappend, after returning from that - script.)
- -
The Tab key is reserved for navigation between - the editable cells, but the user can insert a tabulator character into the - text widget by pressing Control-i.
- -
Unlike in the case of the other widgets used for interactive - cell editing, the Return and KP_Enter keys insert - a newline character into the text widget.  Control-j can - also be used for inserting a newline.  Control-Return and - Control-KP_Enter terminate the editing and destroy the edit - window.
- -
Control-Home and Control-End have - their well-known text widget-specific bindings, just like - Meta-< and Meta-> if - tk_strictMotif is false.  Again, this is different - from the behavior of the other widgets used for interactive cell - editing.  For jumping into the first/last editable cell, the user can - press Alt-Home/Alt-End or - Meta-Home/Meta-End - (Command-Home/Command-End on Mac OS Classic and - Mac OS X Aqua).
- -
KEYWORDS
- -
tablelist, editing, text
-
- -
-

Contents     Start page

-
-
- -

Interactive Cell Editing Using the spinbox Widget

- -
-
DESCRIPTION
- -
The temporary embedded spinbox widget used for interactive cell editing - will be created with its -state option set to - normal, which makes the widget editable.  You can - use the script corresponding to the -editstartcommand - tablelist configuration option to set the state of the spinbox to - readonly or define validations for it, as well as for - setting its (range of) values and its -wrap - option.
- -
KEYWORDS
- -
tablelist, editing, spinbox
-
- -
-

Contents     Start page

-
-
- -

Interactive Cell Editing Using the checkbutton - Widget

- -
-
DESCRIPTION
- -
On Windows, Mac OS Classic, and Mac OS X Aqua the temporary embedded - checkbutton widget used for interactive cell editing will be created with - explicitly set values for its -borderwidth, - -font, -padx, - -pady, and -variable options.  - In an X11 environment it will be created with explicitly set values for its - -borderwidth, -indicatoron, - -image, -selectimage, - -selectcolor, and -variable - options.  You can use the script corresponding to the - -editstartcommand - tablelist configuration option to set any other options, like - -offvalue and -onvalue, according - to the internal values of the cells.  Since the default values - of the -offvalue and -onvalue - checkbutton options are 0 and 1, you don't need - to change these options if the cells have the same internal values - 0 and 1.
- -
KEYWORDS
- -
tablelist, editing, checkbutton
-
-
- - - -
-
DESCRIPTION
- -
The temporary embedded menubutton widget used for interactive cell - editing will be created with explicitly set values for its - -anchor, -indicatoron, - -justify, -padx, - -pady, -relief, and - -textvariable options.  In addition, a menu with - its -tearoff option set to 0 and an - appropriate script as the value of its -postcommand - option is created and set as the value of the menubutton's - -menu option.  In an X11 environment, the menu's - appearance is adapted to that of the tablelist widget by setting its - -background, -foreground, - -activebackground, - -activeforeground, and - -activeborderwidth options to appropriate values.  - You can use the script corresponding to the -editstartcommand - tablelist configuration option to set any other options of the menubutton - and/or its associated menu.  You will, however, need this script in - the first place for populating the menu, preferably with radiobutton - entries.  For every radiobutton entry added to the menu, the Tablelist - implementation will make sure that its value (which can be specified by - setting the entry's -value or - -label option) will be displayed in the menubutton as - its text when the entry is selected.  (Tablelist achieves this by - setting the menu entry's -variable option to the value - of the menubutton's -textvariable option.)  For - menu entries of types other than radiobutton (e.g., for command entries) it - is the responsibility of the application to make sure that the selected - entry's text will be shown in the menubutton (for example, with the aid of - the menu entry's -command option).
- -
KEYWORDS
- -
tablelist, editing, menubutton
-
- -
-

Contents     Start page

-
- - DELETED tablelist5.13/doc/tablelistWidget.html Index: tablelist5.13/doc/tablelistWidget.html ================================================================== --- tablelist5.13/doc/tablelistWidget.html +++ tablelist5.13/doc/tablelistWidget.html @@ -1,9606 +0,0 @@ - - - The tablelist::tablelist Command - - - - - - - - -
-

The tablelist::tablelist Command

- -

For Tablelist Version 5.13

- -

by

- -

Csaba Nemethi

- -
- csaba.nemethi@t-online.de -
-
-
- -

Contents

- - - - -
- -

Quick Reference

- -
-
NAME
- -
tablelist::tablelist – Create and manipulate - tablelist widgets
- -
SYNOPSIS
- -
-
-tablelist::tablelist pathName ?options?
-
-
- -
STANDARD OPTIONS
- -
-
--borderwidth          -highlightthickness  -setgrid
--cursor               -relief              -xscrollcommand
--exportselection      -selectbackground    -yscrollcommand
--highlightbackground  -selectborderwidth
--highlightcolor       -selectforeground
-
-
- -
OPTIONS FOR THE BODY COMPONENT OF THE - WIDGET
- -
-
--background  -disabledforeground  -font  -foreground
-
-
- -
WIDGET-SPECIFIC OPTIONS
- -
-acceptchildcommand - command
- -
-acceptdropcommand - command
- -
-activestyle - frame|none|underline
- -
-arrowcolor - color
- -
-arrowdisabledcolor - color
- -
-arrowstyle - flat5x3|flat5x4|flat6x4|flat7x4|flat7x5|flat7x7|flat8x5|flat9x5|flat9x6|
-             flatAngle7x4|flatAngle7x5|flatAngle9x5|flatAngle9x6|flat1Angle9x7|
-             flatAngle10x6|flatAngle10x7|photo7x7|sunken8x7|sunken10x9|sunken12x11
- -
-autoscan - boolean
- -
-collapsecommand - command
- -
-columns {width title - ?left|right|center? width title - ?left|right|center? ...}
- -
-columntitles {title - title ...}
- -
-customdragsource - boolean
- -
-editendcommand - command
- -
-editselectedonly - boolean
- -
-editstartcommand - command
- -
-expandcommand - command
- -
-forceeditendcommand - boolean
- -
-fullseparators - boolean
- -
-height lines
- -
-incrarrowtype - up|down
- -
-instanttoggle - boolean
- -
-labelactivebackground - color
- -
-labelactiveforeground - color
- -
-labelbackground - color  or  -labelbg - color
- -
-labelborderwidth - screenDistance  or  -labelbd - screenDistance
- -
-labelcommand - command
- -
-labelcommand2 - command
- -
-labeldisabledforeground - color
- -
-labelfont - font
- -
-labelforeground - color  or  -labelfg - color
- -
-labelheight - lines
- -
-labelpady - screenDistance
- -
-labelrelief - raised|sunken|flat|ridge|solid|groove
- -
-listvariable - variable
- -
-movablecolumns - boolean
- -
-movablerows - boolean
- -
-movecolumncursor - cursor
- -
-movecursor - cursor
- -
-populatecommand - command
- -
-protecttitlecolumns - boolean
- -
-resizablecolumns - boolean
- -
-resizecursor - cursor
- -
-selectmode - single|browse|multiple|extended
- -
-selecttype - row|cell
- -
-setfocus - boolean
- -
-showarrow - boolean
- -
-showeditcursor - boolean
- -
-showhorizseparator - boolean
- -
-showlabels - boolean
- -
-showseparators - boolean
- -
-snipstring - string
- -
-sortcommand - command
- -
-spacing - screenDistance
- -
-state - normal|disabled
- -
-stretch - all|columnIndexList
- -
-stripebackground - color  or  -stripebg - color
- -
-stripeforeground - color  or  -stripefg - color
- -
-stripeheight - lines
- -
-takefocus - 0|1|""|command
- -
-targetcolor - color
- -
-tight boolean
- -
-titlecolumns - number
- -
-tooltipaddcommand - command
- -
-tooltipdelcommand - command
- -
-treecolumn - columnIndex
- -
-treestyle - adwaita|ambiance|aqua|baghira|dust|dustSand|gtk|
-            klearlooks|mate|mint|newWave|oxygen1|oxygen2|
-            phase|plastik|plastique|radiance|ubuntu|
-            vistaAero|vistaClassic|win7Aero|win7Classic|
-            winnative|winxpBlue|winxpOlive|winxpSilver
- -
-width characters
- -
COLUMN CONFIGURATION OPTIONS
- -
-align - left|right|center
- -
-background - color  or  -bg - color
- -
-changesnipside - boolean
- -
-changetitlesnipside - boolean
- -
-editable - boolean
- -
-editwindow - name
- -
-font font
- -
-foreground - color  or  -fg - color
- -
-formatcommand - command
- -
-hide boolean
- -
-labelalign - left|right|center
- -
-labelbackground - color  or  -labelbg - color
- -
-labelborderwidth - screenDistance  or  -labelbd - screenDistance
- -
-labelcommand - command
- -
-labelcommand2 - command
- -
-labelfont - font
- -
-labelforeground - color  or  -labelfg - color
- -
-labelheight - lines
- -
-labelimage - image
- -
-labelpady - screenDistance
- -
-labelrelief - raised|sunken|flat|ridge|solid|groove
- -
-maxwidth - width
- -
-name name
- -
-resizable - boolean
- -
-selectbackground - color
- -
-selectforeground - color
- -
-showarrow - boolean
- -
-showlinenumbers - boolean
- -
-sortcommand - command
- -
-sortmode - ascii|asciinocase|command|dictionary|integer|real
- -
-stretchable - boolean
- -
-stripebackground - color
- -
-stripeforeground - color
- -
-text list
- -
-title title
- -
-valign - center|top|bottom
- -
-width width
- -
-wrap boolean
- -
ROW CONFIGURATION OPTIONS
- -
-background - color  or  -bg - color
- -
-font font
- -
-foreground - color  or  -fg - color
- -
-hide boolean
- -
-name name
- -
-selectable - boolean
- -
-selectbackground - color
- -
-selectforeground - color
- -
-text list
- -
CELL CONFIGURATION OPTIONS
- -
-background - color  or  -bg - color
- -
-editable - boolean
- -
-editwindow - name
- -
-font font
- -
-foreground - color  or  -fg - color
- -
-image image
- -
-selectbackground - color
- -
-selectforeground - color
- -
-stretchwindow - boolean
- -
-text text
- -
-valign - center|top|bottom
- -
-window - command
- -
-windowdestroy - command
- -
-windowupdate - command
- -
DESCRIPTION
- -
COLORS AND FONTS
- -
USING A TABLELIST AS MULTI-COLUMN - TREE WIDGET
- -
INTERACTIVE CELL EDITING
- -
DRAG & DROP - SUPPORT
- -
VIRTUAL EVENTS
- -
ROW INDICES
- -
-
-number  knumber  active  anchor  end  last  top  bottom  @x,y  name
-
-
- -
NODE INDICES
- -
-
-root  number  knumber  active  anchor  end  last  top  bottom  @x,y  name
-
-
- -
COLUMN INDICES
- -
-
-number  active  anchor  end  last  left  right  @x,y  name
-
-
- -
CELL INDICES
- -
-
-row,col  active  anchor  end  last  @x,y
-
-    row: number  knumber  active  anchor  end  last  top  bottom  name
-    col: number  active  anchor  end  last  left  right  name
-
-
- -
WIDGET COMMAND
- -
pathName activate - index
- -
pathName activatecell - cellIndex
- -
pathName applysorting - itemList
- -
pathName attrib ?name? - ?value name value ...?
- -
pathName bbox - index
- -
pathName bodypath
- -
pathName bodytag
- -
pathName canceledediting
- -
pathName cancelediting
- -
pathName cellattrib - cellIndex ?name? ?value name value - ...?
- -
pathName cellbbox - cellIndex
- -
pathName cellcget - cellIndex option
- -
pathName cellconfigure - cellIndex ?option? ?value option value - ...?
- -
pathName cellindex - cellIndex
- -
- pathName cellselection - option args - -
-
pathName cellselection anchor - cellIndex
- -
pathName cellselection clear - firstCell lastCell
- -
pathName cellselection clear - cellIndexList
- -
pathName cellselection includes - cellIndex
- -
pathName cellselection set - firstCell lastCell
- -
pathName cellselection set - cellIndexList
-
-
- -
pathName cget - option
- -
pathName childcount - nodeIndex
- -
pathName childindex - index
- -
pathName childkeys - nodeIndex
- -
pathName collapse - index ?-fully|-partly?
- -
pathName collapseall - ?-fully|-partly?
- -
pathName columnattrib - columnIndex ?name? ?value name value - ...?
- -
pathName columncget - columnIndex option
- -
pathName columnconfigure columnIndex - ?option? ?value option value ...?
- -
pathName columncount
- -
pathName columnindex - columnIndex
- -
pathName columnwidth - columnIndex - ?-requested|-stretched|-total?
- -
pathName configcelllist {cellIndex option - value cellIndex option value ...}
- -
pathName configcells - ?cellIndex option value cellIndex option - value ...?
- -
pathName configcolumnlist {columnIndex - option value columnIndex option value - ...}
- -
pathName configcolumns - ?columnIndex option value columnIndex - option value ...?
- -
pathName configrowlist - {index option value index option - value ...}
- -
pathName configrows - ?index option value index option - value ...?
- -
pathName configure - ?option? ?value option value ...?
- -
pathName containing - y
- -
pathName containingcell x y
- -
pathName containingcolumn x
- -
pathName cornerlabelpath
- -
pathName cornerpath
- -
pathName curcellselection
- -
pathName curselection
- -
pathName delete first - last
- -
pathName delete - indexList
- -
pathName deletecolumns - firstColumn lastColumn
- -
pathName deletecolumns - columnIndexList
- -
pathName depth - nodeIndex
- -
pathName descendantcount nodeIndex
- -
pathName editcell - cellIndex
- -
pathName editinfo
- -
pathName editwinpath
- -
pathName editwintag
- -
pathName entrypath
- -
pathName expand index - ?-fully|-partly?
- -
pathName expandall - ?-fully|-partly?
- -
pathName expandedkeys
- -
pathName fillcolumn - columnIndex text
- -
pathName findcolumnname name
- -
pathName findrowname - name ?-descend? ?-parent nodeIndex?
- -
pathName finishediting
- -
pathName formatinfo
- -
pathName get first - last
- -
pathName get - indexList
- -
pathName getcells - firstCell lastCell
- -
pathName getcells - cellIndexList
- -
pathName getcolumns - firstColumn lastColumn
- -
pathName getcolumns - columnIndexList
- -
pathName getformatted - first last
- -
pathName getformatted - indexList
- -
pathName getformattedcells firstCell - lastCell
- -
pathName getformattedcells - cellIndexList
- -
pathName getformattedcolumns firstColumn - lastColumn
- -
pathName getformattedcolumns - columnIndexList
- -
pathName getfullkeys - first last
- -
pathName getfullkeys - indexList
- -
pathName getkeys - first last
- -
pathName getkeys - indexList
- -
pathName hasattrib - name
- -
pathName hascellattrib - cellIndex name
- -
pathName hascolumnattrib columnIndex - name
- -
pathName hasrowattrib - index name
- -
pathName hidetargetmark
- -
pathName imagelabelpath cellIndex
- -
pathName index - index
- -
pathName insert index - ?item item ...?
- -
pathName insertchildlist parentNodeIndex - childIndex itemList
- -
pathName insertchild(ren) parentNodeIndex - childIndex ?item item ...?
- -
pathName insertcolumnlist columnIndex - {width title ?left|right|center? - width title ?left|right|center? - ...}
- -
pathName insertcolumns - columnIndex ?width title - ?left|right|center? width title - ?left|right|center? ...?
- -
pathName insertlist - index itemList
- -
pathName iselemsnipped - cellIndex fullTextName
- -
pathName isexpanded - index
- -
pathName istitlesnipped columnIndex - fullTextName
- -
pathName isviewable - index
- -
pathName itemlistvar
- -
pathName labelpath - columnIndex
- -
pathName labels
- -
pathName labeltag
- -
pathName move - sourceIndex targetIndex
- -
pathName move - sourceIndex targetParentNodeIndex - targetChildIndex
- -
pathName movecolumn - sourceColumn targetColumn
- -
pathName nearest - y
- -
pathName nearestcell - x y
- -
pathName nearestcolumn - x
- -
pathName noderow - parentNodeIndex childIndex
- -
pathName parentkey - nodeIndex
- -
pathName refreshsorting - ?parentNodeIndex?
- -
pathName rejectinput
- -
pathName resetsortinfo
- -
pathName rowattrib - index ?name? ?value name value - ...?
- -
pathName rowcget - index option
- -
pathName rowconfigure - index ?option? ?value option value - ...?
- -
pathName scan - mark|dragto x y
- -
pathName searchcolumn - columnIndex pattern ?options?
- -
pathName see - index
- -
pathName seecell - cellIndex
- -
pathName seecolumn - columnIndex
- -
- pathName selection - option args - -
-
pathName selection anchor - index
- -
pathName selection clear first - last
- -
pathName selection clear - indexList
- -
pathName selection includes - index
- -
pathName selection set first - last
- -
pathName selection set - indexList
-
-
- -
pathName separatorpath - ?columnIndex?
- -
pathName separators
- -
pathName showtargetmark before|inside - index
- -
pathName size
- -
pathName sort - ?-increasing|-decreasing?
- -
pathName sortbycolumn - columnIndex ?-increasing|-decreasing?
- -
pathName sortbycolumnlist columnIndexList - ?sortOrderList?
- -
pathName sortcolumn
- -
pathName sortcolumnlist
- -
pathName sortorder
- -
pathName sortorderlist
- -
pathName targetmarkpath
- -
pathName targetmarkpos - y ?-any|-horizontal|-vertical?
- -
pathName togglecolumnhide firstColumn - lastColumn
- -
pathName togglecolumnhide - columnIndexList
- -
pathName togglerowhide - first last
- -
pathName togglerowhide - indexList
- -
pathName toplevelkey - index
- -
pathName unsetattrib - name
- -
pathName unsetcellattrib cellIndex - name
- -
pathName unsetcolumnattrib columnIndex - name
- -
pathName unsetrowattrib index - name
- -
pathName viewablerowcount ?first - last?
- -
pathName windowpath - cellIndex
- -
- pathName xview - args - -
-
pathName xview
- -
pathName xview units
- -
pathName xview moveto - fraction
- -
pathName xview scroll number - units|pages
-
-
- -
- pathName yview - args - -
-
pathName yview
- -
pathName yview units
- -
pathName yview moveto - fraction
- -
pathName yview scroll number - units|pages
-
-
- -
DEFAULT AND INDIVIDUAL BINDINGS FOR - THE TABLELIST BODY
- -
DEFAULT AND INDIVIDUAL BINDINGS - FOR THE HEADER LABELS
- -
DEFAULT BINDINGS FOR INTERACTIVE - CELL EDITING
- -
KEYWORDS
- -
tablelist, multi-column, listbox, tree, widget
-
- -
-

Contents     Start page

-
-
- -

Detailed Reference

- -
-
NAME
- -
tablelist::tablelist – Create and manipulate - tablelist widgets
- -
SYNOPSIS
- -
-
-tablelist::tablelist pathName ?options?
-
-
- -
STANDARD OPTIONS
- -
-
--borderwidth          -highlightthickness  -setgrid
--cursor               -relief              -xscrollcommand
--exportselection      -selectbackground    -yscrollcommand
--highlightbackground  -selectborderwidth
--highlightcolor       -selectforeground
-
-
- -
See the options manual entry for details on the standard - options.  The -highlightbackground, - -highlightcolor, and - -highlightthickness options are only supported by the - Tablelist package, but not by Tablelist_tile.  When using the package - Tablelist_tile, the options -selectbackground, - -selectborderwidth, and - -selectforeground have theme-specific default - values.
- -
OPTIONS FOR THE BODY COMPONENT OF THE - WIDGET
- -
-
--background  -disabledforeground  -font  -foreground
-
-
- -
These options (described in the options manual entry) are only - valid for the body component of the tablelist widget.  As discussed in - the next section, the colors and font used when drawing the header labels - can be different from those specified for the body.  When using the - package Tablelist_tile, these options have theme-specific default - values.
- -
WIDGET-SPECIFIC OPTIONS
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -acceptchildcommand
Database Name: acceptChildCommand
Database Class: AcceptChildCommand
- -
-

Specifies a Tcl command used to decide whether a given tablelist - node may accept a specified item being moved interactively as a child.  The - specified command is automatically concatenated with the name of the - tablelist widget, the node index of the would-be new parent node, and - the row index of the dragged item, the resulting script is evaluated in - the global scope, and the return value (which must be a boolean) will - determine whether to allow to move the source item to the current mouse - position as a child of the given parent node.

- -

For example, in the case of a tablelist widget used as a file - manager, in which the top-level items represent volumes mounted on the - system, the command specified by this option might look like in the - (pseudo-)code below:

- -
-
-proc acceptChildCmd {tbl targetParentNodeIdx sourceRow} {
-    if {[string compare $targetParentNodeIdx "root"] == 0} {
-        # Allow only volumes as top-level items
-        return [expr {[$tbl depth $sourceRow] == 1}]
-    } else {
-        # Allow only directories as parent items
-        return [$targetParentNodeIdx represents a directory]
-    }
-}
-
-
- -

For technical reasons (the use of the -elide - text widget tag option for collapsing a row), this option is not - supported for Tk versions earlier than 8.3.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -acceptdropcommand
Database Name: acceptDropCommand
Database Class: AcceptDropCommand
- -
-

Specifies a Tcl command used to decide whether a given tablelist row - may accept a specified item being moved - interactively to be dropped as a sibling just before that - row.  The specified command is automatically concatenated with the - name of the tablelist widget, the row index of the would-be new target, - and the row index of the dragged item, the resulting script is - evaluated in the global scope, and the return value (which must be a - boolean) will determine whether to allow to move the source item to the - current mouse position, just before the given row.

- -

For example, to make sure that the position of the last row of a - tablelist widget won't be affected by the interactive row move - operation, the command specified by this option might look like in the - code below:

- -
-
-proc acceptDropCmd {tbl targetRow sourceRow} {
-    set rowCount [[$tbl size]
-    return [expr {$sourceRow != $rowCount - 1 && $targetRow < $rowCount}]
-}
-
-
-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -activestyle
Database Name: activeStyle
Database Class: ActiveStyle
- -
-

Specifies how to diplay the active item or element (depending on the - value of the -selecttype - configuration option) when the tablelist has the keyboard focus.  - The allowed values are frame, - none, and underline.  The - default value frame shows a thin frame around the - active item or element, which in most cases looks nice.  It looks - less pretty when applied to the active item if the background color of - some of its cells was changed by using the columnconfigure or cellconfigure widget command and no - column separators are shown.  The value none - specifies that no special indication of the active item or element is - to be performed.  The value underline produces - the same visual effect as in the case of the Tk core listbox.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -arrowcolor
Database Name: arrowColor
Database Class: ArrowColor
- -
-

Specifies the color to use for the up- or down-arrow placed into a - column label by the sortbycolumn or sortbycolumnlist subcommand of the - Tcl command associated with the widget.  This option is only - relevant if the value of the -showarrow option is true.  The - default value depends on the windowing system in the Tablelist package - and on the current theme in Tablelist_tile.  For example, if the - windowing system is x11 then the default is an - empty string, indicating that the arrow will inherit the background - color of the label in which it is placed (but is distinguishable from - the latter, due to its 3-D border and sunken relief, because in this - case the -arrowstyle - option has the default value sunken10x9).  On - the windowing system win32, the default arrow color - is #aca899 for Windows XP, #569bc0 for - Windows Vista and Windows 7, and an empty string for older Windows - versions, paired with the default arrow style - flat9x5, flat7x4, and - sunken8x7, respectively.  Finally, for the - windowing systems classic and - aqua on the Macintosh, the default arrow color and - style depend on the version of the operating system:  Starting - with version 10.10 (Yosemite) of Mac OS X, the default arrow color for - the windowing system aqua is #404040 - and the default arrow style is flatAngle7x4.  - For earlier operating system versions, the default values are the arrow - color #717171 and the arrow style - flat7x7 (or photo7x7, in the - presence of PNG support).

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -arrowdisabledcolor
Database Name: arrowDisabledColor
Database Class: ArrowDisabledColor
- -
-

Specifies the color to use for the up- or down-arrow placed into a - column label by the sortbycolumn or sortbycolumnlist subcommand of the - Tcl command associated with the widget when the tablelist's - state is - disabled.  This option is only relevant if the - value of the -showarrow - option is true.  When the default value of the -arrowcolor option is an empty string then - this is the default for the -arrowdisabledcolor - option, too; otherwise the latter's default value equals the default - foreground color of the header labels in disabled - state.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -arrowstyle
Database Name: arrowStyle
Database Class: ArrowStyle
- -
-

Specifies the relief, shape, width, and height of the up- or - down-arrow placed into a column label by the sortbycolumn or sortbycolumnlist subcommand of the - Tcl command associated with the widget.  This option is only - relevant if the value of the -showarrow option is true.  The - currently supported values are flat5x3, - flat5x4, flat6x4, - flat7x4, flat7x5, - flat7x7, flat8x5, - flat9x5, flat9x6, - flatAngle7x4, flatAngle7x5, - flatAngle9x5, flatAngle9x6, - flatAngle9x7, flatAngle10x6, - flatAngle10x7, photo7x7, - sunken8x7, sunken10x9, and - sunken12x11, as shown in the picture below.  - The default value depends on the windowing system in the Tablelist - package and on the current theme in Tablelist_tile; see the description - of the -arrowcolor option - for details.

- -

Arrow Styles

- -

While the sort arrows of the styles flat* and - sunken* are created from bitmaps, the arrow style - photo7x7 uses PNG images that look and behave very - close to the native sort arrows on Mac OS X Aqua versions earlier than - 10.10 (Yosemite).  This arrow style is only supported if the Tk - version is either 8.6 (with built-in PNG support), or 8.5 and the - img::png package can be loaded into the - interpreter.  When supported, photo7x7 will be - the default value of the -arrowstyle option in - Tablelist_tile with the aqua theme for Mac OS X - versions earlier than 10.10 (otherwise flat7x7 will - be used as default for these earlier OS X versions).  When using - this arrow style, the -arrowcolor and -arrowdisabledcolor options have - no effect, but, due to the transparency information contained in the - PNG images, the arrows will automatically adapt their color to the - various states of the header labels, just like the native sort - arrows.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -autoscan
Database Name: autoScan
Database Class: AutoScan
- -
-

Specifies a boolean value that controls whether to trigger the - automatic scrolling when the mouse leaves the tablelist window with - button 1 down.  The default is 1, meaning that - automatic scrolling will be in effect, just like in the case of the Tk - listbox widget.  However, when using the TkDND package or some - other drag & drop implementation, you might want to set this option - to 0, in order to avoid any conflicts between the drag - operation and the automatic scrolling.

- -

REMARK:  Starting with Tablelist version 5.12, this - option has become obsolete, because the default bindings now suppress - the above-mentioned automatic scrolling if the tablelist's body - component was registered as a drag source for mouse button 1 via - the  tkdnd::drag_source register  or the - BWidget DragSite::register command, or the - tablelist's -customdragsource option was set to - true.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -collapsecommand
Database Name: collapseCommand
Database Class: CollapseCommand
- -
-

Specifies a Tcl command to be invoked when collapsing a row of a - tablelist used as a tree widget (with the aid of the collapse or collapseall subcommand).  The - specified command is automatically concatenated with the name of the - tablelist widget and the row index, and the resulting script is - evaluated in the global scope, before hiding the descendants of the row - in question.

- -

For technical reasons (the use of the -elide - text widget tag option for collapsing a row), this option is not - supported for Tk versions earlier than 8.3.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -columns
Database Name: columns
Database Class: Columns
- -
-

Specifies the widths, titles, and alignments of the columns.  - The option's value must be a list of the form

- -
-
-width title ?alignment? width title ?alignment? ...
-
-
- -

Each width must be a number.  A positive - value specifies the column's width in average-size characters of the - widget's font.  If width is negative, its - absolute value is interpreted as a column width in pixels.  - Finally, a value of zero specifies that the column's width is to be - made just large enough to hold all the elements in the column, - including its header (but no larger than the maximum width indicated by - the -maxwidth column - configuration option).  In all three cases, the effective column - width will be somewhat greater because of the margins created - automatically to the left and right of the column.

- -

Each title specifies the text to be displayed in - the column's header, and may optionally be followed in the next list - element by an alignment, which specifies how to - align the elements of the column.  Each - alignment must be one of left, - right, or center.  The - default is left.  The - alignment also refers to the column's title as long - as the -labelalign - option hasn't been specified for that column, or if its value is an - empty string.

- -

The default value of this option is an empty list, specifying that - initially the widget has no columns.

- -

REMARK:  Columns whose width was specified as zero are - called dynamic-width columns.  In general, they are more - user-friendly than their static-width counterparts, being that - their widths are automatically adapted to their contents.  On the - other hand, the static-width columns perform significantly better on - item insertion and sorting than the dynamic-width ones, due to some - optimizations introduced in Tablelist version 5.6.  (Prior to that - release, the above-mentioned operations were faster with dynamic-width - columns than with static-width ones.)

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -columntitles
Database Name: columnTitles
Database Class: ColumnTitles
- -
-

This option provides a simplified form of specifying dynamic-width, - left-aligned tablelist columns.  Its value is viewed as a list of - column titles.  The default is an empty list.

- -

In the simplest case that no columns have been specified yet, - setting this option to the value given by the list

- -
-
-title title ...
-
-
- -

is equivalent to setting the -columns option to the value given by the - list

- -
-
-0 title left 0 title left ...
-
-
- -

If the columns have already been specified then this option updates - their titles (as many of them as possible) and, if the number of - elements of its value is greater than the number of columns then it - uses the remaining elements as titles of additional dynamic-width, - left-aligned columns.  For example, if the widget has 3 columns - and the option's value is a list of length 5 then the option will - update the titles of the 3 columns and will append 2 new dynamic-width, - left-aligned columns having as titles the last 2 elements of the - list.  If the widget has 3 columns and the option specifies just 2 - texts then it will update the titles of the first 2 columns only.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -customdragsource
Database Name: customDragSource
Database Class: CustomDragSource
- -
-

Specifies a boolean value that indicates whether the tablelist - widget is a drag source for some drag & drop implementation other - than TkDND and the drag & drop framework included in BWidget.  - If true then the default bindings will perform an automatic drag-friendly handling of the selection and - will suppress the automatic scrolling when the mouse leaves the - tablelist window with button 1 down.  The default is - 0.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -editendcommand
Database Name: editEndCommand
Database Class: EditEndCommand
- -
-

Specifies a Tcl command to be invoked on normal termination of the - interactive editing of a cell's contents if the final text of the - temporary embedded widget used for the editing is different from its - initial one.  The command is automatically concatenated with the - name of the tablelist widget, the cell's row and column indices, as - well as the final contents of the edit window, the resulting script is - evaluated in the global scope, and the return value becomes the cell's - new contents after destroying the temporary embedded widget.  The - main purpose of this script is to perform a final validation of the - edit window's contents.  See the description of the - -forceeditendcommand option for - more about the invocation of the command mentioned above, as well as - the INTERACTIVE CELL EDITING section for - details on the editing process.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -editselectedonly
Database Name: editSelectedOnly
Database Class: EditSelectedOnly
- -
-

Specifies a boolean value that controls whether to start the - interactive cell editing when mouse button 1 is pressed in an editable - cell.  If this value is true then the editing will only be started - if the cell has previously been selected (interactively or - programmatically).  In this case, a first left-click will usually - just select the cell (or its row, depending on the value of the - -selecttype option), and - a second mouse click will start the editing session.  The default - is 0, meaning that the editing will be started regardless - of whether the cell is selected or not.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -editstartcommand
Database Name: editStartCommand
Database Class: EditStartCommand
- -
-

Specifies a Tcl command to be invoked when the interactive editing - of a cell's contents is started.  The command is automatically - concatenated with the name of the tablelist widget, the cell's row and - column indices, as well as the text displayed in the cell, the - resulting script is evaluated in the global scope, and the return value - becomes the initial contents of the temporary embedded widget used for - the editing.  The main purpose of this script is to define - validations for the edit window's contents.  See the INTERACTIVE CELL EDITING section for details on the - editing process.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -expandcommand
Database Name: expandCommand
Database Class: ExpandCommand
- -
-

Specifies a Tcl command to be invoked when expanding a row of a - tablelist used as a tree widget (with the aid of the expand or expandall subcommand).  The specified - command is automatically concatenated with the name of the tablelist - widget and the row index, and the resulting script is evaluated in the - global scope, before displaying the children of the row in - question.

- -

For technical reasons (the use of the -elide - text widget tag option for collapsing a row), this option is not - supported for Tk versions earlier than 8.3.

- -

REMARK:  It is common practice to use the command - specified as the value of this option to insert the children of the row - that is about to be expanded, if it has no children yet.  For - example, the Directory Viewer - demo script uses the command implemented as follows:

- -
-
-proc expandCmd {tbl row} {
-    if {[$tbl childcount $row] == 0} {
-        # Get the name of the directory whose leaf name is
-        # displayed in the first cell of the specified row
-        set dir [$tbl rowattrib $row pathName]
-
-        # Display the contents of the directory $dir
-        # as child items of the one identified by $row
-        putContents $dir $tbl $row
-    }
-
-    # The rest is just eye candy:
-    if {[$tbl childcount $row] != 0} {
-        # Update the image displayed in the row's first cell
-        $tbl cellconfigure $row,0 -image openFolderImg
-    }
-}
-
-
-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -forceeditendcommand
Database Name: forceEditEndCommand
Database Class: ForceEditEndCommand
- -
-

Specifies a boolean value that controls the invocation of the - command given by the the -editendcommand option.  If this - value is true then the command will be invoked on normal termination of - the editing process even if the final text of the temporary embedded - widget used for the editing equals its initial one, and will also be - invoked when the interactive cell editing is canceled (in the latter - case, the text passed to it as last argument will be the cell's - original contents, not its final one).  The default value of this - option is 0, meaning that the command will only be invoked - on normal termination of the editing process, if the final text of the - temporary embedded widget is different from its initial one.  See - the INTERACTIVE CELL EDITING section for - details on the editing process.

- -

If the option's value is true and no value for the - -editendcommand option was specified, then on - normal termination of the editing process the cell's new contents will - be set to the text contained in the edit window, even if it has not - been changed interactively (but might have been returned by the command - given by the the -editstartcommand option).

- -

Setting this option to true enables you to execute an arbitrary - action whenever the interactive cell editing is finished.  Just - binding a script to the <Destroy> event for - the temporary embedded widget used for the editing won't work, because - that widget might be destroyed and recreated automatically under - various circumstances.  Alternately, you can use the - <<TablelistCellUpdated>> and - <<TablelistCellRestored>> virtual - events, generated by the finishediting and cancelediting subcommands, - respectively.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -fullseparators
Database Name: fullSeparators
Database Class: FullSeparators
- -
-

Specifies a boolean value that controls whether the separators (if - any) shall extend all of the way to the bottom of the tablelist's - body.  The default is 0, meaning that the height of - the separators will be adjusted to the widget's content, i.e., they - won't extend to the bottom of the tablelist's body if there is free - vertical space left below the widget's last row.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -height
Database Name: height
Database Class: Height
- -
-

Specifies the desired height for the window, in units of characters - in the font given by the -font option.  This - is at the same time the desired height in lines, provided that no - column-, row-, or cell-specific fonts, multi-line elements, or embedded - images or windows will make the height of any of the rows different - from the one corresponding to the above-mentioned font.  With this - restriction, if the option's value is zero or less, then the window's - height is made just large enough to hold all the items in the tablelist - widget.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -incrarrowtype
Database Name: incrArrowType
Database Class: IncrArrowType
- -
-

Specifies the type of the arrow placed into a column label when - sorting the items based on that column in increasing order, with the - aid of the sortbycolumn - or sortbycolumnlist - subcommand of the Tcl command associated with the widget.  The - value of this option must be one of up or - down.  The default is - up.  This option is only relevant if the value - of the -showarrow option - is true.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -instanttoggle
Database Name: instantToggle
Database Class: InstantToggle
- -
-

Specifies a boolean value that controls whether the interactive cell - editing with the aid of a Tk or tile checkbutton widget, if started - with the left mouse button, will be finished immediately after - automatically toggling the checked state of the temporary embedded - checkbutton.  The default value is 0, meaning that a - mouse click into the cell will only start the editing session (and - automatically toggle the checkbutton's checked state), but not also - finish it.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -labelactivebackground
Database Name: labelActiveBackground
Database Class: Foreground
- -
-

Specifies the -activebackground option for the - header labels, i.e., the background color to use when the mouse cursor - is positioned over a header label and the value of - tk_strictMotif is false.  This option is only - defined in the Tablelist package if the Tk version being used supports - the -activebackground option for label - widgets.  This is checked by Tablelist at initialization time, and - will normally be the case for Tk versions 8.3.2 or higher.  On the - other hand, the Tablelist_tile package doesn't support the - -labelactivebackground option.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -labelactiveforeground
Database Name: labelActiveForeground
Database Class: Background
- -
-

Specifies the -activeforeground option for the - header labels, i.e., the foreground color to use when the mouse cursor - is positioned over a header label and the value of - tk_strictMotif is false.  This option is only - defined in the Tablelist package if the Tk version being used supports - the -activeforeground option for label - widgets.  This is checked by Tablelist at initialization time, and - will normally be the case for Tk versions 8.3.2 or higher.  On the - other hand, the Tablelist_tile package doesn't support the - -labelactiveforeground option.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -labelbackground or - -labelbg
Database Name: labelBackground
Database Class: Background
- -
-

Specifies the -background option for the header - labels.  This option is only supported by the Tablelist package, - but not by Tablelist_tile.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -labelborderwidth or - -labelbd
Database Name: labelBorderWidth
Database Class: BorderWidth
- -
-

Specifies the -borderwidth option for the header - labels.  This option is different from the standard - -borderwidth option defined for the tablelist - widget itself.  In the package Tablelist_tile this option has a - theme-specific default value.

- -

REMARK:  Please take into account that in some themes, - setting this option to a value other than the default might be ignored - by tile and thus could cause alignment problems.  This is because - the border of tile widgets is drawn with theme-specific methods, which - will not always produce the results known from Tk widgets.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -labelcommand
Database Name: labelCommand
Database Class: LabelCommand
- -
-

Specifies the Tcl command to be invoked when mouse button 1 is - pressed over one of the header labels and later released over the same - label.  When the <ButtonRelease-1> event - occurs, the command is automatically concatenated with the name of the - tablelist widget and the column index of the respective label, and the - resulting script is evaluated in the global scope.  If the - tablelist's state is - disabled then this action will not take - place.  The most common value of this option is tablelist::sortByColumn; - this command sorts the items based on the column whose index was passed - to it as second argument.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -labelcommand2
Database Name: labelCommand2
Database Class: LabelCommand2
- -
-

Specifies the Tcl command to be invoked when mouse button 1 is - pressed together with the Shift key over one of the header - labels and later released over the same label.  When the - <ButtonRelease-1> event occurs, the command - is automatically concatenated with the name of the tablelist widget and - the column index of the respective label, and the resulting script is - evaluated in the global scope.  If the tablelist's - state is - disabled then this action will not take - place.  The most common value of this option is tablelist::addToSortColumns; - this command adds the column index passed to it as second argument to - the list of sort columns and sorts the items based on the columns - indicated by the modified list.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -labeldisabledforeground
Database Name: labelDisabledForeground
Database Class: DisabledForeground
- -
-

Specifies the -disabledforeground option for the - header labels, i.e., the foreground color to use for the labels when - the tablelist's state is - disabled.  This option is only defined in the - Tablelist package if the Tk version being used supports the - -disabledforeground option for label widgets.  - This is checked by Tablelist at initialization time, and will normally - be the case for Tk versions 8.3.1 or higher.  On the other hand, - the Tablelist_tile package doesn't support the - -labeldisabledforeground option.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -labelfont
Database Name: labelFont
Database Class: Font
- -
-

Specifies the -font option for the header - labels.  In the package Tablelist_tile this option has a - theme-specific default value.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -labelforeground or - -labelfg
Database Name: labelForeground
Database Class: Foreground
- -
-

Specifies the -foreground option for the header - labels.  In the package Tablelist_tile this option has a - theme-specific default value.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -labelheight
Database Name: labelHeight
Database Class: Height
- -
-

Specifies the -height option for the header - labels.  This option is only supported by the Tablelist package, - but not by Tablelist_tile.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -labelpady
Database Name: labelPadY
Database Class: Pad
- -
-

In the Tablelist package this option specifies the - -pady configuration option for the header - labels.  In the Tablelist_tile package the value of the - -labelpady option is mapped to the corresponding - components of the value of the -padding - configuration option of the header labels, and the - -labelpady option has a theme-specific default - value.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -labelrelief
Database Name: labelRelief
Database Class: Relief
- -
-

Specifies the -relief option for the header - labels.  This option is different from the standard - -relief option defined for the tablelist widget - itself.  The default value is raised.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -listvariable
Database Name: listVariable
Database Class: Variable
- -
-

Specifies the name of a variable.  The value of the variable is - a list to be displayed inside the widget; if the variable value changes - then the widget will automatically update itself to reflect the new - value.  The value of the variable must be a valid list.  Each - list element corresponds to a row within the widget, and must be a - valid list itself; its elements correspond to the cells within the - respective row.  Attempts to assign a variable whose value does - not fulfil these conditions to -listvariable will - cause an error.  Attempts to unset a variable in use as a - -listvariable will fail but will not generate an - error.

- -

REMARK 1:  For increased efficiency, updating the widget - to reflect a changed value of the variable specified with this option - is, whenever possible, done at idle time (i.e., when there are no - events to process).  On the other hand, most tablelist subcommands - make it necessary to perform an immediate update of the widget's - internal list according to the value of this variable, before executing - the subcommand in question.  Doing this repeatedly can become - quite inefficient.  To avoid performance problems, you should - always try to separate the operations that build up the value of the - variable specified by this option from other commands.  For - example, instead of

- -
-
-tablelist::tablelist .tbl ... -listvariable var
-set var {}
-for {set row 0} {$row < 1000} {incr row} {
-    lappend var ...
-    .tbl cellconfigure $row,3 -image ...
-}
-
-
- -

you should write

- -
-
-tablelist::tablelist .tbl ... -listvariable var
-set var {}
-for {set row 0} {$row < 1000} {incr row} {
-    lappend var ...
-}
-for {set row 0} {$row < 1000} {incr row} {
-    .tbl cellconfigure $row,3 -image ...
-}
-
-
- -

The first method above is quite inefficient, because it requires - 1000 updates of the widget's internal list.  The second method - performs incomparably faster, because it needs only one synchronization - (at the beginning of the second loop).

- -

REMARK 2:  It is not recommended to set this option for - a tablelist used as a tree widget, because adding new items to the list - specified as its value will result in inserting those list elements - into the widget without respecting the tree's internal structure.  - There is no problem if you access the variable for reading only, but - for that purpose it is more efficient to use the itemlistvar subcommand rather than the - -listvariable option.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -movablecolumns
Database Name: movableColumns
Database Class: MovableColumns
- -
-

Specifies a boolean value that determines whether the columns can be - moved interactively.  See the DEFAULT - AND INDIVIDUAL BINDINGS FOR THE HEADER LABELS section below for - information on moving a column interactively.  The default value - is 0.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -movablerows
Database Name: movableRows
Database Class: MovableRows
- -
-

Specifies a boolean value that determines whether the rows can be - moved interactively.  See the DEFAULT AND - INDIVIDUAL BINDINGS FOR THE TABLELIST BODY section below for - information on moving a row interactively.  The default value is - 0.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -movecolumncursor
Database Name: moveColumnCursor
Database Class: MoveColumnCursor
- -
-

Specifies the mouse cursor to be used when moving a column - interactively.  The default value is icon on - the windowing systems x11 and - win32, and the native cursor - closedhand on the Macintosh windowing systems - classic and aqua.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -movecursor
Database Name: moveCursor
Database Class: MoveCursor
- -
-

Specifies the mouse cursor to be used when moving a row - interactively.  The default value is hand2 on - the windowing systems x11 and - win32, and the native cursor - pointinghand on the Macintosh windowing systems - classic and aqua.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -populatecommand
Database Name: populateCommand
Database Class: PopulateCommand
- -
-

Specifies a Tcl command to be invoked by the searchcolumn subcommand before examining - the children (or descendants, when used with the - -descend option) of a tablelist row whose children - have not been inserted yet.  The specified command is - automatically concatenated with the name of the tablelist widget and - the row index, and the resulting script is evaluated in the global - scope.  It is expected that this script will insert the children - of the row in question, without expanding the node or changing its - appearance in any other way.

- -

For technical reasons (the use of the -elide - text widget tag option for collapsing a row), this option is not - supported for Tk versions earlier than 8.3.

- -

REMARK:  There are many similarities between this option - and -expandcommand.  Both options are - used in the first place to insert children on demand.  The main - differences between them are as follows:

- -
    -
  1. The command specified by the -populatecommand - option is only invoked for rows whose children have not been inserted - yet, while the one specified by -expandcommand is - always invoked before expanding a row, regardless of whether the - children of that row are already present in the widget or not.
  2. - -
  3. The command specified by the - -expandcommand option may perform visual changes - on the node in question, while the role of the one specified by - -populatecommand is restricted to inserting the - children, without altering the node's appearance in any way.
  4. -
- -

A logical consequence of the above is that the value of - -populatecommand is usually just a stripped-down - version of the command specified by the - -expandcommand option.  For example, the - Directory Viewer demo script - might use a command implemented as follows:

- -
-
-proc populateCmd {tbl row} {
-    # Get the name of the directory whose leaf name is
-    # displayed in the first cell of the specified row
-    set dir [$tbl rowattrib $row pathName]
-
-    # Display the contents of the directory $dir
-    # as child items of the one identified by $row
-    putContents $dir $tbl $row
-}
-
-
- -

Moreover, the -expandcommand option can be set - to a command that invokes the one specified by the - -populatecommand option:

- -
-
-proc expandCmd {tbl row} {
-    if {[$tbl childcount $row] == 0} {
-        populateCmd $tbl $row
-    }
-
-    # The rest is just eye candy:
-    if {[$tbl childcount $row] != 0} {
-        # Update the image displayed in the row's first cell
-        $tbl cellconfigure $row,0 -image openFolderImg
-    }
-}
-
-
-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -protecttitlecolumns
Database Name: protectTitleColumns
Database Class: ProtectTitleColumns
- -
-

Specifies a boolean value that determines whether the boundary of - the title column area shall be protected from being crossed when moving - a column interactively.  See the DEFAULT - AND INDIVIDUAL BINDINGS FOR THE HEADER LABELS section below for - information on moving a column interactively.  The default value - is 0, specifying that non-title columns can be moved into - the title column area and vice-versa.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -resizablecolumns
Database Name: resizableColumns
Database Class: ResizableColumns
- -
-

Specifies a boolean value that determines whether the columns can be - resized interactively.  See the DEFAULT - AND INDIVIDUAL BINDINGS FOR THE HEADER LABELS section below for - information on interactive column resizing.  The default value is - 1.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -resizecursor
Database Name: resizeCursor
Database Class: ResizeCursor
- -
-

Specifies the mouse cursor to be used during interactive column - resizing.  The default value is - sb_h_double_arrow on the windowing systems - x11 and win32, and the native - cursor resizeleftright on the Macintosh windowing - systems classic and aqua.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -selectmode
Database Name: selectMode
Database Class: SelectMode
- -
-

Specifies one of several styles for manipulating the - selection.  The value of the option may be arbitrary, but the - default bindings expect it to be either single, - browse, multiple, or - extended.  The default value is - browse.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -selecttype
Database Name: selectType
Database Class: SelectType
- -
-

Specifies one of two selection types for the tablelist widget: - row or cell.  If the - selection type is row then the default bindings - will select and deselect entire items, and the whole row having the - location cursor will be displayed as active when the tablelist has the - keyboard focus.  If the selection type is cell - then the default bindings will select and deselect individual elements, - and the single cell having the location cursor will be displayed as - active when the tablelist has the keyboard focus.  The default - value is row.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -setfocus
Database Name: setFocus
Database Class: SetFocus
- -
-

Specifies a boolean value that determines whether a click with the - left mouse button anywhere into the tablelist's body, including the - separators and the embedded images (more precisely, any descendants of - the tablelist widget having the binding tag TablelistBody) should set the focus to - the body of the tablelist widget if the latter's state is normal.  The - default value is 1.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -showarrow
Database Name: showArrow
Database Class: ShowArrow
- -
-

Specifies a boolean value that determines whether the - sortbycolumn and - sortbycolumnlist - subcommands of the Tcl command associated with the widget should place - an arrow indicating the sort order into the header label(s) of the - column(s) specified by their first argument.  The default value is - 1.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -showeditcursor
Database Name: showEditCursor
Database Class: ShowEditCursor
- -
-

Specifies a boolean value indicating whether the mouse cursor should - change automatically to one having the shape of a pencil whenever a - click with mouse button 1 would start an editing session.  The - default value is 1.

- -

REMARK:  On X11 and Mac OS X Aqua, the cursor set by - Tablelist when a mouse klick would start the interactive cell editing, - is Tk's built-in cursor pencil.  Since on - Windows this cursor is ugly and not really usable, the edit cursor - shown by Tablelist on this platform will be the one loaded from the - file pencil.cur, located in the scripts - subdirectory of the Tablelist installation directory.  If the - application was started as a starpack containing the Tablelist package, - then the edit cursor will be loaded from a copy of this file, created - automatically by Tablelist in the user's Temp - directory.

- -

The file pencil.cur is a copy of the file  - Ubuntu Handwriting.cur,  downloaded from the - address

- -
-
- http://www.rw-designer.com/cursor-detail/46745 -
-
-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -showhorizseparator
Database Name: showHorizSeparator
Database Class: ShowHorizSeparator
- -
-

Specifies a boolean value that controls whether to place a - horizontal separator just below the last row if the value of the - -showseparators - option is true, that of the -fullseparators option is false, and - there is free space left between the last row and the bottom of the - tablelist window.  The default value is 1.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -showlabels
Database Name: showLabels
Database Class: ShowLabels
- -
-

Specifies a boolean value that determines whether the header labels - are to be shown or not.  The default value is 1.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -showseparators
Database Name: showSeparators
Database Class: ShowSeparators
- -
-

Specifies a boolean value that determines whether the columns are to - be separated with borders.  The default value is - 0.  The separators are implemented as thin frames - with sunken relief in the package Tablelist, and as tile separator - widgets in the package Tablelist_tile.  They are attached to the - right edges of the header labels, and are only created if the value of - this option is true.  In this case, a horizontal separator will - also be created and placed just below the last row, provided that the - value of the -showhorizseparator option is - true, that of the -fullseparators option is false, and - there is free space left between the last row and the bottom of the - tablelist window.

- -

REMARK:  Tablelist doesn't support horizontal separators - (except for the one mentioned above), but a nice distinguishing effect - for the rows can be achieved with the aid of the -stripebackground option discussed - below.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -snipstring
Database Name: snipString
Database Class: SnipString
- -
-

Specifies the string to be used as snip indicator when displaying - the elements that don't fit into their cells.  The default is an - ellipsis ("...").

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -sortcommand
Database Name: sortCommand
Database Class: SortCommand
- -
-

Specifies a command to be used for the comparison of the items when - invoking the sort subcommand of - the Tcl command associated with the tablelist widget.  To compare - two items (viewed as lists of cell contents within one row each) during - the sort operation, the command is automatically - concatenated with the two items and the resulting script is - evaluated.  The script should return an integer less than, equal - to, or greater than zero if the first item is to be considered less - than, equal to, or greater than the second, respectively.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -spacing
Database Name: spacing
Database Class: Spacing
- -
-

Specifies additional space to provide above and below each row of - the widget.  The option's value may have any of the standard forms - for screen distances.  It defaults to 0.  See - also the -tight option.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -state
Database Name: state
Database Class: State
- -
-

Specifies one of two states for the tablelist widget: - normal or disabled.  If - the widget is disabled then neither items nor columns may be inserted, - deleted, updated, or moved, the items, header labels, and the up- or - down-arrow are drawn in the -disabledforeground, -labeldisabledforeground, and - -arrowdisabledcolor color, - respectively, the selection cannot be modified and is not shown - (although the selection information is retained), the header labels are - completely insensitive, and no interactive cell editing can be - performed.  In addition, in disabled state any color options - specified at column, row, or cell level will be ignored.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -stretch
Database Name: stretch
Database Class: Stretch
- -
-

Specifies the columns to be stretched in order to fill the tablelist - window if necessary.  The option's value may be - all or a list of column indices in any of the forms - described in the COLUMN INDICES section - below.  In the second case, the specified column indices are - replaced with their numerical equivalents, except for - end and last, which are viewed - as dynamic column indices whose numerical equivalent (i.e., the index - of the tablelist's last column) might change during program execution - and therefore will be recomputed every time the columns are - stretched.  The list will be updated automatically whenever - columns are inserted, deleted, or moved.  The number of pixels by - which a column is stretched is proportional to its width in - pixels.  The default value of this option is an empty list, - meaning that no column will be stretched to eliminate the blank space - that might appear at the right of the table.  (Note that the blank - space following the header labels is filled with a dummy, insensitive - label having the same background, borderwidth, and relief as the - "normal" header labels.)  This option is ignored if the value of - the -width configuration - option is zero or less.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -stripebackground or - -stripebg
Database Name: stripeBackground
Database Class: Background
- -
-

Specifies the background color to use when displaying the items - belonging to a stripe.  Each stripe is composed of the same number - stripeHeight of consecutive viewable items, according to the value of the - -stripeheight - configuration option.  The first stripeHeight - viewable items are "normal" ones; they are followed by a stripe - composed of the next stripeHeight viewable items, which in - turn is followed by the same number of "normal" viewable items, and so - on.  In the Tablelist package and in most themes supported by - Tablelist_tile, the default value is an empty string, indicating that - the stripes will inherit the background color specified by the - -background - configuration option.  When using Tablelist_tile with the - tileqt theme then the default value is given by the - global KDE option alternateBackground, which in - turn depends on the current color scheme.  In this case it is - recommended to either keep that default value retrieved from KDE, or to - use an explicitly specified empty string if no stripes are to be - displayed.  The -stripebackground option has a - higher priority than the -background column - configuration option, but a lower priority than the - -background option specified at row or cell - level.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -stripeforeground or - -stripefg
Database Name: stripeForeground
Database Class: Foreground
- -
-

Specifies the foreground color to use when displaying the items - belonging to a stripe.  Each stripe is composed of the same number - stripeHeight of consecutive viewable items, according to the value of the - -stripeheight - configuration option.  The first stripeHeight - viewable items are "normal" ones; they are followed by a stripe - composed of the next stripeHeight viewable items, which in - turn is followed by the same number of "normal" viewable items, and so - on.  The default value is an empty string, indicating that the - stripes will inherit the foreground color specified by the - -foreground - configuration option.  The -stripeforeground - option has a higher priority than the -foreground - column configuration option, but a lower priority than the - -foreground option specified at row or cell - level.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -stripeheight
Database Name: stripeHeight
Database Class: StripeHeight
- -
-

Specifies the number of items in each stripe.  If zero or less - then no stripes are displayed.  The default is 1.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -takefocus
Database Name: takeFocus
Database Class: TakeFocus
- -
-

This option determines whether the widget accepts the focus during - keyboard traversal.  It is almost identical to the standard option - of the same name (see the options manual entry for - details).  The only difference is that not the widget itself but - its body child (containing the items) will receive the focus during - keyboard traversal with the standard keys (Tab and - Shift-Tab).

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -targetcolor
Database Name: targetColor
Database Class: TargetColor
- -
-

Specifies the color of the gap displayed in the tablelist's body or - header to indicate the target position when moving a row or column - interactively.  The target indicator belonging to the tablelist's - body can also be displayed explicitly with the aid of the - showtargetmark - subcommand, and its path name can be retrieved via targetmarkpath.  The default - value is black.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -tight
Database Name: tight
Database Class: Tight
- -
-

Specifies a boolean value that determines whether to eliminate the - one-pixel additional space left below each tablelist row for Tk listbox - compatibility.  The default value is 0, which draws a - one-pixel additional space below each row, just like a Tk core - listbox.

- -

REMARK:  You can set this option to true and at the same - time provide additional space above and below each row with the aid of - the -spacing configuratiom - option.  As a result, the space below each row will be the same as - above the row (and not one pixel higher).

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -titlecolumns
Database Name: titleColumns
Database Class: TitleColumns
- -
-

Specifies the number of the non-scrollable columns at the left edge - of the window, also called title columns.  The positions of - these columns will not change when adjusting the horizontal view by - invoking the scan, - seecell, seecolumn, or xview subcommand.  The default value is - 0.  The value of this option also determines the - scrolling unit used by the commands mentioned above when shifting the - horizontal view: if it is positive then the horizontal scrolling is - performed column-wise, otherwise by character units (the width of the - 0 character).

- -

The end of the title column area is visualized with the aid of a - separator, attached to the right edge of the header label corresponding - to the last non-hidden title column.  This special separator is - always displayed to mark the end of the title columns (if any), - independently of the value of the -showseparators option.  The user - can easily distinguish it from the other separators by means of its - background color, which is different from that of the other - separators.

- -

For technical reasons (the use of the -elide - option for a text widget tag), this option is not supported for Tk - versions earlier than 8.3.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -tooltipaddcommand
Database Name: tooltipAddCommand
Database Class: TooltipAddCommand
- -
-

Specifies a Tcl command to be used for displaying cell- and column - label-specific balloon help.  When the mouse pointer enters a - cell, the command is automatically concatenated with the name of the - tablelist widget and the cell's row and column indices, and the - resulting script is evaluated in the global scope.  Similarly, - when the mouse pointer enters a header label, the command is - automatically concatenated with the name of the tablelist widget, the - number -1, and the column index of the respective label, - and the resulting script is evaluated in the global scope.  In - both cases, the action described above is only triggered if both the - value of this option and that of -tooltipdelcommand are nonempty - strings.

- -

For example, consider the procedure tooltipAddCmd shown - below, which makes use of the DynamicHelp::add - command from the BWidget package to display the full cell and label - texts as tooltips for the cells and header labels with snipped - contents.

- -
-
-proc tooltipAddCmd {tbl row col} {
-    if {($row >= 0 && [$tbl iselemsnipped $row,$col fullText]) ||
-        ($row <  0 && [$tbl istitlesnipped $col fullText])} {
-        DynamicHelp::add $tbl -text $fullText
-    }
-}
-
-
- -

A tablelist widget can use this procedure by specifying

- -
-
-... -tooltipaddcommand tooltipAddCmd -tooltipdelcommand DynamicHelp::delete
-
-
- -

If you prefer to use the tooltip::tooltip - command from the tooltip package contained in tklib then the procedure - becomes

- -
-
-proc tooltipAddCmd {tbl row col} {
-    if {($row >= 0 && [$tbl iselemsnipped $row,$col fullText]) ||
-        ($row <  0 && [$tbl istitlesnipped $col fullText])} {
-        tooltip::tooltip $tbl $fullText
-    }
-}
-
-
- -

and can be used by specifying

- -
-
-... -tooltipaddcommand tooltipAddCmd -tooltipdelcommand "tooltip::tooltip clear"
-
-
- -

Please note that in the less common case that the name of your - tablelist widget contains spaces, the  tooltip::tooltip - clear  command won't work as expected.  As a - workaround you can use the slightly modified approach shown below:

- -
-
-proc tooltipDelCmd tbl { tooltip::tooltip $tbl "" }
-
-... -tooltipaddcommand tooltipAddCmd -tooltipdelcommand tooltipDelCmd
-
-
- -

Both examples above make use of the iselemsnipped and istitlesnipped subcommands, to make - sure that the full cell and label texts will only be displayed for - those cells and header labels whose contents are snipped.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -tooltipdelcommand
Database Name: tooltipDelCommand
Database Class: TooltipDelCommand
- -
-

Specifies a Tcl command to be used for removing the cell- or column - label-specific balloon help.  When the mouse pointer leaves a cell - or a header label, the command specified by this option is - automatically concatenated with the name of the tablelist widget and - the resulting script is evaluated in the global scope.  This - action is only triggered if both the value of this option and that of - -tooltipaddcommand - are nonempty strings.  Common values for this option are - "DynamicHelp::delete" (which requires the BWidget package) - and  "tooltip::tooltip clear"  (which requires - the tooltip package contained in tklib).  Their usage is shown in - the examples above.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -treecolumn
Database Name: treeColumn
Database Class: TreeColumn
- -
-

Specifies the column to contain the indentations and expand/collapse - controls for a tablelist used as a tree widget.  The option's - value may be a column index in any of the forms described in the - COLUMN INDICES section below.  The - specified column index is replaced with its numerical equivalent, and - it will be updated automatically whenever columns are inserted, - deleted, or moved.  The default value is 0.

- -

For technical reasons (the use of the -elide - text widget tag option for collapsing a row), this option is not - supported for Tk versions earlier than 8.3.

- -

REMARK:  Please note that the tree structure will only - be displayed as expected if the column specified by this option is - left-aligned.  It is your responsibility to make sure that this - restriction is fulfilled when using a tablelist as a tree widget.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -treestyle
Database Name: treeStyle
Database Class: TreeStyle
- -
-

Specifies the look & feel of the column containing the - indentations and expand/collapse controls for a tablelist used as a - tree widget.  This includes, among others, the images used for - displaying the expand/collapse controls, the indentation width, and - whether expand/collapse controls and indentations are to be protected - when selecting a row or cell.  The currently supported values are - shown at a glance below:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
aquagtkadwaitaubuntu
aquagtkadwaitaubuntu
mintmatenewWave
mintmatenewWave
plastiqueoxygen1oxygen2klearlooks
plastiqueoxygen1oxygen2klearlooks
plastikbaghiraphase
plastikbaghiraphase
winnativewinxpBluewinxpOlivewinxpSilver
winnativewinxpBluewinxpOlivewinxpSilver
vistaAerovistaClassicwin7Aerowin7Classic
vistaAerovistaClassicwin7Aerowin7Classic
ambiancedustdustSandradiance
ambiancedustdustSandradiance
- -

If the tree style is aqua, - gtk, adwaita, - ubuntu, mint, - mate, newWave, - oxygen2, vistaAero, or - win7Aero, and the Tk version is either 8.6 (with - built-in PNG support) or 8.5 and the img::png - package can be loaded into the interpreter, then the images used for - displaying the expand/collapse controls are PNG images with alpha - channel.  Otherwise (i.e., for the other tree styles or in the - absence of PNG support) GIF images are used for the expand/collapse - controls.

- -

The following table contains a detailed description of the tree - styles, in alphabetical order:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
ValueScreenshotComments
adwaitaadwaitaInspired by the GTK+ 3 theme Adwaita.
ambianceambianceInspired by the GTK+ theme Ambiance.  Recommended to be - used with large fonts and images.
aquaaqua - - - - - - - - - - - - -
Tablelist: Default for the windowing systems - aqua and - classic.
Tablelist_tile: Default for the themes aqua and - Aquativo.
-
baghirabaghira - - - - - - -
Tablelist_tile: Default for the Qt styles baghira, - cde, and motif within - the tileqt theme.  Also used by some - flavors of qtcurve.
-
dustdustInspired by the GTK+ theme Dust.  Recommended to be used - with large fonts and images.
dustSanddustSandInspired by the GTK+ theme Dust Sand.  Recommended to be - used with large fonts and images.
gtkgtk - - - - - - - - - - - - -
Tablelist: Default for the windowing system - x11.
Tablelist_tile: Default for the themes blue, - clam, classic, - default, kroc, - sriv, srivlg, and - step, as well as for the Qt style - gtk+ within the - tileqt theme.
-
klearlooksklearlooks - Inspired by the KDE 4 style Klearlooks.
- - - - - - - -
Tablelist_tile: Default for the Qt style qtcurve - within the tileqt theme.
-
matemateInspired by a few GTK+ themes of the MATE desktop.
mintmintInspired by a few GTK+ 3 themes bundled with the Linux Mint - distribution.
newWavenewWaveInspired by the GTK+ theme New Wave.
oxygen1oxygen1Inspired by the KDE 4 style Oxygen.
oxygen2oxygen2 - - - - - - -
Tablelist_tile: Default for the Qt style oxygen - within the tileqt theme.
-
phasephase - - - - - - -
Tablelist_tile: Default for the Qt style phase within - the tileqt theme.
-
plastikplastik - - - - - - -
Tablelist_tile: Default for the plastik theme and the - Qt style plastik within the - tileqt theme.
-
plastiqueplastique - - - - - - -
Tablelist_tile: Default for the Qt style plastique - within the tileqt theme.
-
radianceradianceInspired by the GTK+ theme Radiance.  Recommended to be - used with large fonts and images.
ubuntuubuntuInspired by a couple of GTK+ 3 themes bundled with the Ubuntu - Linux distribution.
vistaAerovistaAero - - - - - - - - - - - - -
Tablelist: Default for the windowing system - win32 on Windows Vista.
Tablelist_tile: Default for the vista theme on - Windows Vista with the Vista Aero style.
-
vistaClassicvistaClassic - - - - - - - - - - - - -
Tablelist: Default for the windowing system - win32 on Windows Vista with the Windows - Classic style.
Tablelist_tile: Default for the vista theme on - Windows Vista with the Windows Classic style.
-
win7Aerowin7Aero - - - - - - - - - - - - -
Tablelist: Default for the windowing system - win32 on Windows 7.
Tablelist_tile: Default for the vista theme on - Windows 7 with the Windows 7 Aero style.
-
win7Classicwin7Classic - - - - - - - - - - - - -
Tablelist: Default for the windowing system - win32 on Windows 7 with the Windows - Classic style.
Tablelist_tile: Default for the vista theme on - Windows 7 with the Windows Classic style.
-
winnativewinnative - - - - - - - - - - - - -
Tablelist: Default for the windowing system - win32 on Windows 2000 and Windows XP with - the Windows Classic style.
Tablelist_tile: Default for the themes alt, - keramik, keramik_alt, - winnative, and - xpnative with the Windows Classic style, - as well as for most Qt styles within the - tileqt theme.
-
winxpBluewinxpBlue - - - - - - - - - - - - -
Tablelist: Default for the windowing system - win32 on Windows XP with the Blue color - scheme.
Tablelist_tile: Default for the winxpblue theme and - the xpnative theme on Windows XP with the - Blue color scheme.
-
winxpOlivewinxpOlive - - - - - - - - - - - - -
Tablelist: Default for the windowing system - win32 on Windows XP with the Olive Green - color scheme.
Tablelist_tile: Default for the xpnative theme on - Windows XP with the Olive Green color scheme.
-
winxpSilverwinxpSilver - - - - - - - - - - - - -
Tablelist: Default for the windowing system - win32 on Windows XP with the Silver color - scheme.
Tablelist_tile: Default for the xpnative theme on - Windows XP with the Silver color scheme.
-
- -

For technical reasons (the use of the -elide - text widget tag option for collapsing a row), this option is not - supported for Tk versions earlier than 8.3.

-
-
- -
- - - - - - - - - - - - - - - - - - -
Command-Line Name: -width
Database Name: width
Database Class: Width
- -
-

Specifies the desired width for the window, in average-size - characters of the widget's font.  If zero or less then the desired - width for the window is made just large enough to hold all the columns - in the tablelist widget.

-
-
- -
COLUMN CONFIGURATION OPTIONS
- -
The following options are currently supported by the columncget, columnconfigure, configcolumnlist, and configcolumns commands:
- -
-
-
-align - alignment
- -
Specifies how to align the elements of the column.  It must be - one of left, right, or - center.  This option also refers to the - column's title if the -labelalign option hasn't been - specified for the given column, or if its value is an empty - string.  The -align option is tied to the - alignment element corresponding to this column in - the list specifying the value of the -columns option for the tablelist widget; - changes in either will automatically be reflected in the other.
- -
-background - color or -bg color
- -
Specifies the normal background color to use when displaying the - contents of the column.
- -
-changesnipside - boolean
- -
Specifies whether to override the alignment-specific default - position of the snip indicator when - displaying the elements of the column (excluding its title).  The - default value is 0, meaning that the snip string will be - appended to the elements if the column's alignment is - left or center and prepended to - them in case the alignment is right.
- -
- -changetitlesnipside boolean
- -
Specifies whether to override the alignment-specific default - position of the snip indicator when - displaying the column's title.  The default value is - 0, meaning that the snip string will be appended to the - title if the column's alignment is left or - center and prepended to it in case the alignment is - right.
- -
-editable - boolean
- -
Specifies whether the elements of the column can be edited - interactively.  The default value is 0.  The - value of this option can be overridden for individual cells by using - the cell configuration option of the same - name.
- -
-editwindow - name
- -
Specifies the type of the temporary embedded widget to be used for - interactive editing of the contents of the given column's cells.  - name may be one of entry (which - is the default), text, spinbox - (the latter for Tk versions 8.4 or higher), - checkbutton, menubutton, - ttk::entry, ttk::spinbox, - ttk::combobox, - ttk::checkbutton, or - ttk::menubutton (the latter five only in the - presence of the tile widget engine), or the value returned by one of - the registration commands for widgets from the packages BWidget, Iwidgets, combobox (by Bryan Oakley), ctext, and Mentry (or Mentry_tile).  For example, - you can use  -editwindow ComboBox  - after registering the ComboBox widget for interactive cell - editing with the aid of the tablelist::addBWidgetComboBox - command.  Similarly, you can use  -editwindow - combobox  after registering Bryan Oakley's - combobox widget for interactive cell editing by invoking the - tablelist::addOakleyCombobox - command.  The value of this option can be overridden for - individual cells by using the cell - configuration option of the same name.
- -
-font font
- -
Specifies the font to use when displaying the contents of the - column.
- -
-foreground - color or -fg color
- -
Specifies the normal foreground color to use when displaying the - contents of the column.
- -
-formatcommand - command
- -
Specifies a Tcl command to be invoked when displaying the content - of a cell within this column or adding it to the selection when the - latter is being exported.  If command is a - nonempty string, then it is automatically concatenated with the cell's - text, the resulting script is evaluated in the global scope, and the - return value is displayed in the cell or added to the selection instead - of the original data.
- -
For example, if a time value in seconds is being - inserted into the cell and command is the procedure - formatDate defined as
- -
-
-
-proc formatDate clockVal {
-    return [clock format $clockVal -format "%Y-%m-%d"]
-}
-
-
-
- -
then the text displayed in the cell will be the date in the - specified format, not the time value in seconds.
- -
This option is also used by Tablelist when building the - return values of the getformatted, getformattedcolumns, and - getformattedcells - subcommands, or searching for a text pattern passed to the - searchcolumn subcommand - with the -formatted option.  All the other - subcommands, notably get, - getcolumns, - getcells, rowcget, columncget, cellcget, sort, sortbycolumn, sortbycolumnlist, and - refreshsorting - operate on the original cell text, which is contained in the widget's - internal list.  In the case of the above example, this will make - it possible to sort the items quite easily by time, with a second's - precision, even if their visual representation only contains the year, - month, and day.
- -
The -formatcommand option comes in - handy if only images or embedded windows are to be displayed in a - column but the texts associated with the cells may not simply be empty - strings because they are needed for other purposes (like sorting or - editing).  In such cases, a procedure returning an empty string - can be used as the option's value, thus making sure that the textual - information contained in that column remains hidden.
- -
The demo scripts included in the Tablelist distribution - contain further examples demonstrating the use of this option.  - The most interesting ones are also described in Tablelist Programmer's Guide.
- -
In the more sophisticated case that the result of the - formatting should also depend on the cell's row, you will have to - invoke the formatinfo - subcommand, which provides the necessary information about the cell - whose content is being formatted.
- -
Due to the - -formatcommand column configuration option, we will - distinguish between the internal value of a tablelist element and its - formatted version.  The latter is the result of the - invocation of the script corresponding to the - -formatcommand option of the element's column, or - the element itself if this option was not set for that column.  - Consequently, the formatted version of a tablelist item is a list - comprised of the formatted elements of the original item.
- -
-hide - boolean
- -
Specifies whether to hide the column when displaying the widget or - exporting its selection.  The default value is - 0.  After toggling the hidden state of a column, the - <<TablelistColHiddenStateChanged>> - virtual event is generated, with its -data option - set to the numerical column index for Tk versions 8.5 or higher.
- -
-labelalign - alignment
- -
Specifies how to align the column's title.  It must be one of - left, right, or - center, or an empty string.  If this option - hasn't been specified for the given column, or if its value is an empty - string, then the header title will have the same alignment as the - elements of the column, as given by the -align column configuration option or by - the alignment element corresponding to this column - in the list specifying the value of the -columns global option.
- -
-labelbackground - color or -labelbg color
- -labelborderwidth screenDistance or - -labelbd screenDistance
- -labelcommand command
- -labelcommand2 command
- -labelfont fontName
- -labelforeground color or - -labelfg color
- -labelheight lines
- -labelpady screenDistance
- -labelrelief relief
- -
The value of each of these options may also be an empty - string.  These options are the column-specific equivalents of the - global ones having the same names, described in the WIDGET-SPECIFIC OPTIONS section.  They - override the options of the same names set at widget level if the - specified value is not empty.  If one of these options hasn't been - specified for the given column, or if its value is an empty string, - then that option will not be used at column level; the global option of - the same name will be used instead.  The -labelactivebackground, - -labelactiveforeground, and - -labeldisabledforeground - options are only defined at widget level; there are no column - configuration options with these names.  The - -labelbackground and - -labelheight options are only supported by the - Tablelist package, but not by Tablelist_tile.
- -
-labelimage - image
- -
Specifies the name of the Tk image to be displayed in the header - label.  image must be the result of an - invocation of the  image create  command, - or an empty string, specifying that no image is to be displayed.  - If the label's text is right-aligned then the image will be displayed - to the right of the text, otherwise to its left.  The text and the - image are separated from each other by a gap corresponding to the width - of a space character in the given label's font.
- -
-maxwidth - width
- -
width must be a number.  A positive value - specifies the column's maximum width in average-size characters of the - widget's font.  If width is negative, its - absolute value is interpreted as a maximum column width in - pixels.  Finally, a value of zero (which is the default) specifies - that the column's maximum width is to be made just large enough to hold - all the elements in the column, including its header.  This option - is only relevant if the given column has dynamic width, i.e., if its - width was set to 0.
- -
-name name
- -
Specifies a name associated with the column.  While the - numerical index of a column might change by inserting, deleting, or - moving columns, its name remains constant and can be used as a safe - alternative column index (see the COLUMN - INDICES section for details).  Similarly, it can also be used - as the second component of a cell index of the form - row,col, as described in the CELL INDICES section.  To avoid ambiguities, - column names should be different from any other forms of column indices - (like numbers, active, anchor, - end, last, - left, right, or any of their - abbreviations).  They should also be different from (any - abbreviations of) the string all, which may be - specified as the value of the -stretch configuration option.  The - default value is an empty string.
- -
-resizable - boolean
- -
Specifies whether the column can be resized interactively.  - See the DEFAULT AND INDIVIDUAL BINDINGS FOR - THE HEADER LABELS section for information on interactive column - resizing.  The default value is 1.  This option - is only relevant if the value of the -resizablecolumns widget - configuration option is true.
- -
-selectbackground - color
- -
Specifies the background color to use when displaying the contents - of a cell in the given column while the cell is selected.
- -
-selectforeground - color
- -
Specifies the foreground color to use when displaying the contents - of a cell in the given column while the cell is selected.
- -
-showarrow - boolean
- -
Specifies whether the sortbycolumn command with the given - column index as first argument and the sortbycolumnlist command having the - given column index as element of its first argument should place an - arrow indicating the sort order into the column's label.  The - default value is 1.  This option is only relevant if - the value of the -showarrow widget configuration option is - true.
- -
-showlinenumbers - boolean
- -
Specifies whether the given column should display the line numbers - (starting with 1 and ending with the number of the non-hidden - rows).  The default value is 0.
- -
The following details assume that the given column's - -showlinenumbers option was set to true:  - Associating the line numbers with the non-hidden rows takes place - automatically whenever items are inserted, deleted, updated, moved, or - sorted, or their -hide - option is toggled.  For increased efficiency, this is done at idle - time.  For example, if several items are inserted into or deleted - from the tablelist widget, then the necessary renumbering of the - non-hidden rows will be performed as an idle callback, the next time - the event loop is entered and there are no events to process.  The - line numbers will override any previous contents of the column's - cells.  They are, per default, displayed without leading zeros, - but this (and the display format in general) can be changed with the - aid of the -formatcommand column configuration - option.
- -
The sortbycolumn and sortbycolumnlist subcommands as well - as the tablelist::sortByColumn - and tablelist::addToSortColumns - commands check the column indices passed to them as arguments and don't - perform any sorting by those columns that have been configured to - display the line numbers (see the corresponding descriptions for - details).
- -
REMARK:  Please note that the line numbers - refer to the non-hidden rows, which in case of a tablelist used - as a tree widget might be different from the viewable ones.  Consequently, collapsing a row - will, in general, not lead to renumbering the lines (instead, it will - just elide the corresponding range of line numbers).
- -
-sortcommand - command
- -
This option is only relevant if the value of the -sortmode option for the given column is - command.  It specifies a command to be used - for the comparison of the column's elements when invoking the - sortbycolumn command - with the given column index as first argument or the sortbycolumnlist command having the - given column index as element of its first argument.  To compare - two elements during the sortbycolumn or - sortbycolumnlist operation, - command is automatically concatenated with the two - elements and the resulting script is evaluated.  The script should - return an integer less than, equal to, or greater than zero if the - first element is to be considered less than, equal to, or greater than - the second, respectively.
- -
-sortmode - mode
- -
Specifies how to compare the column's elements when invoking the - sortbycolumn command - with the given column index as first argument or the sortbycolumnlist command having the - given column index as element of its first argument.  - mode may have any of the following values:
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
asciiUse string comparison with Unicode code-point collation order - (the name is for backward-compatibility reasons).  This is - the default.
asciinocase  This is the same as ascii, except that - comparisons are handled in a case-insensitive manner.
commandUse the command specified by the -sortcommand column - configuration option to compare the column's elements.
dictionaryUse dictionary-style comparison.  This is the same as - ascii, except: (a) case is ignored except as - a tie-breaker; (b) if two strings contain embedded numbers, the - numbers compare as integers, not characters.  For example, - bigBoy sorts between bigbang and - bigboy, and x10y sorts between - x9y and x11y.
integerConvert the elements to integers and use integer - comparison.
realConvert the elements to floating-point values and use - floating-point comparison.
-
- -
-stretchable - boolean
- -
Specifies whether the column is to be stretched in order to fill - the tablelist window if necessary.  The value of this option is - tied to that of the -stretch - option for the tablelist widget; changes in either will automatically - be reflected in the other.
- -
-stripebackground - color
- -
Specifies the background color to use when displaying the contents - of a cell in the given column if the cell's row belongs to a - stripe.
- -
-stripeforeground - color
- -
Specifies the foreground color to use when displaying the contents - of a cell in the given column if the cell's row belongs to a - stripe.
- -
-text list
- -
Specifies a list of strings to be displayed in the cells of the - given column, i.e., updates the elements contained in the column.  - If the tablelist's state is - disabled then this option will be ignored.
- -
-title - title
- -
Specifies the text to be displayed in the column's header.  - This option is tied to the title element - corresponding to the given column in the list specifying the value of - the -columns option for the - tablelist widget; changes in either will automatically be reflected in - the other.
- -
-valign - verticalAlignment
- -
Specifies the vertical alignment of embedded images and windows - displayed in the given column.  The - verticalAlignment must be one of - center (which is the default), - top, or bottom.  - Especially in rows containing multi-line elements, embedded images or - windows are often not as tall as the rows themselves; in such cases, - this option enables you to control the column-dependent vertical - alignment of these embedded objects.  The value of this option can - be overridden for individual cells by using the cell configuration option of the same name.
- -
-width - width
- -
width must be a number.  A positive value - specifies the column's width in average-size characters of the widget's - font.  If width is negative, its absolute - value is interpreted as a column width in pixels.  Finally, a - value of zero specifies that the column's width is to be made just - large enough to hold all the elements in the column, including its - header (but no larger than the maximum width indicated by the - -maxwidth column - configuration option).  This option is tied to the - width element corresponding to the given column in - the list specifying the value of the -columns option for the tablelist widget; - changes in either will automatically be reflected in the other.
- -
-wrap - boolean
- -
Specifies whether to display those elements of the given column - that don't fit into their cells in word-wrapped multi-line rather than - snipped form.  The default value is 0.  If the - specified column has static width or a nonzero -maxwidth value and the value of this - option is true, then elements of the column that are too long to be - displayed in a single line will be broken up into several lines.  - The same applies to the individual lines of the multi-line elements - (i.e., elements containing newline characters): they will also be - wrapped if necessary, thus giving rise to additional line breaks.  - In both cases, the line breaks are chosen at word boundaries wherever - possible, and they are only used for the external representation of the - strings contained in the given column, without affecting the internal - contents of the cells.
-
-
- -
The -background, - -font, -foreground, - -selectbackground, - -selectforeground, - -stripebackground, and - -stripeforeground column configuration options override - the options of the same names set at widget level (but not the ones set at - cell or row level) if the specified value is not an empty string.  See - the COLORS AND FONTS section for further - details on these options.
- -
ROW CONFIGURATION OPTIONS
- -
The following options are currently supported by the rowcget, rowconfigure, configrowlist, and configrows commands:
- -
-
-
-background - color or -bg color
- -
Specifies the normal background color to use when displaying the - contents of the row.
- -
-font font
- -
Specifies the font to use when displaying the contents of the - row.
- -
-foreground - color or -fg color
- -
Specifies the normal foreground color to use when displaying the - contents of the row.
- -
-hide - boolean
- -
Specifies whether to hide the row when displaying the widget or - exporting its selection.  The default value is - 0.  After toggling the hidden state of a row, the - <<TablelistRowHiddenStateChanged>> - virtual event is generated, with its -data option - set to the numerical row index for Tk versions 8.5 or higher.
- -
For technical reasons (the use of the - -elide option for a text widget tag), this option - is not supported for Tk versions earlier than 8.3.
- -
CAUTION:  Tk versions 8.3 - 8.4.12 had a bug - that caused a segmentation fault if the whole content of a text widget - was elided.  This bug was also present in Tk 8.5.a1 - - 8.5.a3.  When using one of these earlier Tk versions, this bug - will produce a crash if all the rows of a tablelist widget are - hidden.  It is your responsibility to avoid such situations when - using a Tk version having this bug!
- -
-name name
- -
Specifies a name associated with the row.  While the numerical - index of a row might change by inserting, deleting, or moving rows, or - by sorting the items, its name remains constant and can be used as a - safe alternative row index (see the ROW - INDICES section for details).  Similarly, it can also be used - as the first component of a cell index of the form - row,col, as described in the CELL INDICES section.  To avoid ambiguities, - row names should be different from any other forms of row indices (like - numbers, full keys, active, - anchor, end, - last, top, - bottom, or any of their abbreviations).  The - default value is an empty string.
- -
-selectable - boolean
- -
Specifies whether the elements displayed in the given row can be - selected.  The default value is 1.  If the value - 0 was given then any attempt to select the item contained - in this row with the aid of the  selection set  widget command or any - of its elements by using the  cellselection set  command will be - silently ignored; moreover, an existing old (cell) selection is removed - from the row.
- -
-selectbackground - color
- -
Specifies the background color to use when displaying the contents - of a cell in the given row while the cell is selected.
- -
-selectforeground - color
- -
Specifies the foreground color to use when displaying the contents - of a cell in the given row while the cell is selected.
- -
-text list
- -
Specifies a list of strings to be displayed in the cells of the - given row, i.e., updates the item contained in the row.  If the - tablelist's state is - disabled then this option will be ignored.
-
-
- -
The -background, - -font, -foreground, - -selectbackground, and - -selectforeground row configuration options override - the options of the same names set at column or widget level (but not the - ones set at cell level) if the specified value is not an empty - string.  See the COLORS AND FONTS - section for further details on these options.
- -
CELL CONFIGURATION OPTIONS
- -
The following options are currently supported by the cellcget, cellconfigure, configcelllist, and configcells commands:
- -
-
-
-background - color or -bg color
- -
Specifies the normal background color to use when displaying the - contents of the cell.
- -
-editable - boolean
- -
Specifies whether the contents of the cell can be edited - interactively.  The default value is 0.  This - option overrides the one of the same name - for the column containing the given cell.
- -
-editwindow - name
- -
Specifies the type of the temporary embedded widget to be used for - interactive editing of the cell's contents.  The default value is - entry.  This option overrides the one of the same name for the column - containing the given cell, and may have the same values as its - column-related counterpart.
- -
-font - font
- -
Specifies the font to use when displaying the contents of the - cell.
- -
-foreground - color or -fg color
- -
Specifies the normal foreground color to use when displaying the - contents of the cell.
- -
-image - image
- -
Specifies the name of the Tk image to be displayed in the - cell.  image must be the result of an - invocation of the  image create  command, - or an empty string, specifying that no image is to be displayed.  - If the column containing the cell is right-aligned then the image will - be displayed to the right of the cell's text, otherwise to its - left.  The text and the image are separated from each other by a - gap of 4 pixels.  If for the same cell the -window option was specified with a - nonempty value then it overrides the -image - option.  If the tablelist's state is disabled then this - option will be ignored.
- -
To display an image in a cell, Tablelist makes use of an - embedded label widget (which is created on demand).  This requires - more memory than inserting the image directly into the tablelist's - body, but has the main advantage of making it possible to adjust the - width of the label containing the widget to fit into its column.  - This has the visual effect of cutting off part of the image from its - right side.  To make sure that images with transparent background - will be displayed correctly, the background color of the label widgets - containing the embedded images is automatically updated whenever - necessary.
- -
- -selectbackground color
- -
Specifies the background color to use when displaying the contents - of the cell while it is selected.
- -
- -selectforeground color
- -
Specifies the foreground color to use when displaying the contents - of the cell while it is selected.
- -
-stretchwindow - boolean
- -
Specifies whether the width of the window embedded into the cell - shall be adapted dynamically to the width of the cell's column if the - latter is non-zero (i.e., static).  The default value is - 0.  If the value of this option is true and the - column was specified with a non-zero width or was resized - interactively, then the width of the embedded window (if any) will be - adjusted automatically so the window fills the whole horizontal space - belonging to that column (except the left and right margins).  - Please note that in this case the cell's text will remain hidden.  - On the other hand, if the column is of dynamic width then this option - will be ignored and both the cell's text and its embedded window (if - any) will be displayed as usual.  The easiest way to avoid this - discrepancy is to set the cell's text to an empty string or make sure - that the column's elements are always displayed as empty strings, by - using the -formatcommand column configuration - option.
- -
-text - text
- -
Specifies the string to be displayed in the given cell, i.e., - updates the element contained in the cell.  If the tablelist's - state is - disabled then this option will be ignored.
- -
-valign - verticalAlignment
- -
Specifies the vertical alignment of the embedded image or window - displayed in the cell (if any).  The default value is - center.  This option overrides the one of the same name for the column containing - the given cell, and may have the same values as its column-related - counterpart.
- -
-window - command
- -
Specifies a Tcl command creating the window to be embedded into the - cell.  The command is automatically concatenated with the name of - the tablelist widget, the cell's row and column indices, as well as the - path name of the embedded window to be created, and the resulting - script is evaluated in the global scope.  - command may also be an empty string, specifying - that no embedded window is to be displayed.  If the column - containing the cell is right-aligned then the window will be displayed - to the right of the cell's text, otherwise to its left.  The text - and the window are separated from each other by a gap of 4 - pixels.  If this option was specified with a nonempty value then - it overrides the -image - cell configuration option.  If the tablelist's state is disabled then this - option will be ignored.
- -
REMARK:  There are several situations where - the embedded window will be destroyed and later recreated by invoking - the script mentioned above.  For example, when changing the value - of some of the tablelist widget or column configuration options, - sorting the items, or moving a row or a column, the widget's contents - will be redisplayed, which makes it necessary to recreate the embedded - windows.  This operation won't preserve the changes made on the - embedded windows after their creation.  For this reason, you - should avoid any changes on embedded windows outside their creation - scripts.
- -
-windowdestroy - command
- -
Specifies a Tcl command to be invoked when a window embedded into - the cell is destroyed.  The command is automatically concatenated - with the name of the tablelist widget, the cell's row and column - indices, as well as the path name of the embedded window, and the - resulting script is evaluated in the global scope.  This option - provides an easy-to-use alternative to binding a script to the embedded - window's <Destroy> event from within its - creation script, specified as the value of the -window cell configuration option.
- -
-windowupdate - command
- -
Specifies a Tcl command responsible for adapting the background and - foreground colors of a window embedded into the cell to the current - background and foreground colors of the cell itself.  The current - cell colors depend on whether the tablelist widget's state is normal or - disabled, whether the cell is selected, and whether - its row is displayed with the colors specified by the -stripebackground and - -stripeforeground - widget or column configuration options.  The command is - automatically concatenated with the name of the tablelist widget, the - cell's row and column indices, the path name of the embedded window, - the option name -background and the cell's current - background color, as well as the option name - -foreground and the cell's current foreground - color.  The resulting script is then evaluated in the global - scope.  The specified command can use the colors passed to it as - arguments to set the corresponding colors of the embedded window to the - same values.
- -
For example, if the embedded window is a text or ctext - widget and you want for its background and foreground colors to be - automatically adapted to the cell's current background and foreground - colors, then you can achieve this by setting the - -windowupdate cell configuration option to - updateWindow, where the latter is the procedure - implemented as follows:
- -
-
-
-proc updateWindow {tbl row col w args} {
-    eval [list $w configure] $args
-}
-
-
-
- -
With Tcl/Tk 8.5 or above, you can use the more compact form
- -
-
-
-proc updateWindow {tbl row col w args} {
-    $w configure {*}$args
-}
-
-
-
- -
In this example, args is a list of the form
- -
-
-
--background backgroundColor -foreground foregroundColor
-
-
-
-
-
- -
The -background, -font, - -foreground, -selectbackground, and - -selectforeground cell configuration options override - the options of the same names set at row, column, or widget level if the - specified value is not an empty string.  See the COLORS AND FONTS section for further details on - these options.
- -
DESCRIPTION
- -
The tablelist::tablelist command creates a new - window named pathName and of the class - Tablelist, and makes it into a tablelist - widget.  Additional options, described above, may be specified on the - command line or in the option database to configure aspects of the - tablelist such as its colors, font, and columns.  The - tablelist::tablelist command returns its - pathName argument.  At the time this command is - invoked, there must not exist a window named pathName, - but pathName's parent must exist.
- -
A tablelist is a multi-column listbox and tree widget, - implemented as a mega-widget, consisting of a body and a - header.  The body displays a list of items, one per - line.  Each item is a list of elements, which are aligned in - columns.  In other words, an item is the contents of a row, and an - element is the text contained in a cell.  The header consists of label - widgets displaying the column titles.  The labels can be used, among - others, for interactive column resizing and column-based sorting of the - items, as described below.
- -
Each cell and each header label of a tablelist widget can - also contain an image, which is placed to the left or right of the text, - depending on the column's alignment.  Instead of an image, a tablelist - cell can also contain an embedded window, placed to the left or right of - the text, just like an embedded image.
- -
When a tablelist is used as a tree widget, one of its - columns will display the tree hierarchy with the aid of indentations and - expand/collapse controls.  The Tablelist package provides a great - variety of tree styles controlling the look & feel of that column, and - chooses the correct default style depending on the windowing system, - operating system version, and tile theme.  In a tablelist used as a - multi-column tree widget, every row is at the same time a tree node, - having exactly one parent node and any number of child - nodes.  The tree's origin is the invisible root node, which has - no parent itself and whose children are the top-level nodes.
- -
The elements of a tablelist widget can, per default, be only - edited programmatically.  However, interactive editing can be enabled - for individual cells and for entire columns.  Per default, the - interactive cell editing uses a temporary embedded entry widget, thus - making sure that all the validation facilities available for entry widgets - can be used during the editing process.  A great variety of widgets - from the packages BWidget, Iwidgets, combobox (by Bryan Oakley), ctext, and - Mentry (or Mentry_tile), as well as Tk core text, spinbox, checkbutton, and - menubutton widgets, along with tile entry, spinbox, combobox, checkbutton, - and menubutton widgets are also supported as temporary embedded widgets - used for cell editing.  In addition, a rich set of keyboard bindings - is provided for a comfortable navigation between the editable cells.
- -
When first created, a new tablelist widget has no - items.  Items may be added, deleted, or updated using widget commands - described below.  In addition, one or more items or elements may be - selected.  If a tablelist widget is exporting its selection (see the - -exportselection option), then it will observe the - standard X11 protocols for handling the selection.  Tablelist widget - selections are available as types STRING and - UTF8_STRING; the value of the selection will be a text - built by taking all of the rows having at least one viewable selected element, joining these elements - together with tabs, and the resulting strings in turn with newlines.  - If a tablelist widget that is exporting its selection is the selection - owner and some other window claims ownership of the selection away from it, - then the virtual event - <<TablelistSelectionLost>> is - generated.
- -
It is not necessary for all the elements to be displayed in - the tablelist widget at once; commands described below may be used to - change the view in the window.  Tablelist widgets allow scrolling in - both directions using the standard -xscrollcommand and - -yscrollcommand options.  They also support - scanning, as described below.
- -
Each tablelist widget, as well as each tablelist column, - row, and cell may have any number of attributes, which can be used - in commands that create or manipulate tablelist widgets for particular - purposes.
- -
COLORS AND FONTS
- -
The -background, -font, - -foreground, -selectbackground, and - -selectforeground options can also be specified at - column, row, and cell level, by using the columnconfigure (or configcolumnlist, or configcolumns), rowconfigure (or configrowlist, or configrows), and cellconfigure (or configcelllist, or configcells) subcommands of the Tcl command - associated with the tablelist widget.  Likewise, the - -stripebackground and - -stripeforeground options can also be specified at - column level.  For this reason, a particular cell can have up to four - values for one and the same color or font option.  If these values - conflict, then the option specified at the highest priority level is - used.  The decreasing priority order is cell, row, column, - widget.
- -
If one of these options hasn't been specified at cell, row, - or column level, or if its value for that level is an empty string (this is - explicitly allowed), then that option will not be used at that particular - level.
- -
USING A TABLELIST AS MULTI-COLUMN TREE - WIDGET
- -
When using a tablelist widget to display a tree hierarchy, there are a - few rules to follow:
- -
-
    -
  1. Do not use the the widget's -listvariable option, or at least do not - add new items to the variable specified as its value, because adding - new items to that list will result in inserting those list elements - into the widget without respecting the tree's internal structure.
  2. - -
  3. Make sure that the column specified by the - -treecolumn option is - left-aligned so the tree structure can be displayed as expected.
  4. - -
  5. Use the insertchild(ren) or insertchildlist subcommand rather - than insert or - insertlist for inserting - new items into the widget.
  6. -
-
- -
INTERACTIVE CELL EDITING
- -
Whether or not the contents of a cell of a tablelist widget can be - edited interactively, depends on the -editable option - on both cell and column level.  If the cell-level option was set - explicitly then its value determines the editability of the cell's - contents.  Otherwise the value of the column-level option is used to - decide whether the cell can be edited interactively.  From this rule - it follows that you can enable interactive cell editing for a whole column - by setting its -editable option to true.  To - exclude some of the column's cells from interactive editing, set their - -editable option to false.
- -
The interactive cell editing is started by the - editcell subcommand, which is - invoked implicitly by clicking with the left mouse button into an editable - cell (see the -editselectedonly option for details) or - using keyboard navigation to move from one editable cell into - another.  If the selection type is cell and the - location cursor is in an editable cell, then the interactive editing of the - active element can also be started by pressing Return or - KP_Enter.  Per default, the editcell - subcommand creates a temporary entry widget and embeds it into the cell - whose index was passed to it as argument.  You can, however, use the - -editwindow column or - cell configuration option to specify another - widget instead of an entry, like a Tk core text, spinbox, checkbutton, or - menubutton widget, or a tile entry, spinbox, combobox, checkbutton, or - menubutton, or one of the 19 currently supported widgets from the packages - BWidget, Iwidgets, combobox (by Bryan Oakley), ctext, and Mentry - (or Mentry_tile).  Before specifying a widget from one of these - library packages as the value of the -editwindow column - or cell configuration option, you must register it for interactive cell - editing by invoking the corresponding tablelist::add* - command.  The above-mentioned Tk core and tile widgets are - automatically registered for cell editing.
- -
In the simplest case, the text automatically inserted into - the temporary embedded widget is the same as the text displayed in the - cell, which in turn can be the cell's contents or the string obtained from - the latter by using the -formatcommand option of the cell's - column.  However, if the value of the -editstartcommand configuration option - is a nonempty string, then the text displayed in the cell is passed to that - command as its last argument (following the tablelist's path name as well - as the cell's row and column indices), the resulting script is evaluated in - the global scope, and the return value becomes the edit window's - contents.  From within this script you can invoke the - cancelediting subcommand, - which destroys the temporary embedded widget and cancels the editing of its - contents.  The main goal of this script is, however, to enable you to - define validations for the editing process.  This can be done either - with the aid of the options for entry validation, supported by Tk versions - 8.3 and higher (see the entry reference page), or by using the - widget callback package Wcb, available - for Tk versions 8.0 and higher.  The Iwidgets package (available for - Tk versions 8.0 or higher) provides its own validation facilities, which - can equally be used if the edit window is a widget belonging to that - extension.  In either case, you will need the path name of the - temporary embedded widget or that of its entry or entry-like component; use - the editwinpath and - entrypath subcommands to get - these path names.  Another purpose of the command indicated by the - -editstartcommand option is to enable you to prepare - the edit window in various other ways.  For example, if the latter is - a combobox widget then you can set its -editable option - to false or (for a tile combobox) set its state to - readonly, and you will have to populate its listbox - component.  In the same script, you can change some of the embedded - widget's visual attributes (like its background, selection background, or - selection foreground color).  (Notice that this can also be done with - the aid of the Tk option database.)
- -
The editing of the text inserted into the edit window uses - the widget-specific bindings for mouse and keyboard events, with a few - extensions and changes, as described in the DEFAULT BINDINGS FOR INTERACTIVE CELL EDITING - section.  For example, in entry or entry-like components of the edit - window, Control-i inserts a tab, Control-j - inserts a newline, and if the edit window is a text or ctext widget then - Return and KP_Enter insert a newline character, - too.  Tab and Shift-Tab are used for - navigation between the editable cells, just like Alt-Left, - Alt-Right, Alt-Up, Alt-Down, - Alt-Prior, Alt-Next, Alt-Home, and - Alt-End (as well as Control-Home and - Control-End, except in the case of a text or ctext - widget).  On Mac OS Classic and Mac OS X Aqua the Command - key is used instead of Alt.  The editing can be aborted - with the Escape key (or by invoking the cancelediting subcommand) and terminated - normally with Return or KP_Enter (together with - Control for a text or ctext widget).  The bindings for - the keys used for normal termination of the editing just invoke the - finishediting subcommand; - the latter can also be called explicitly to terminate the editing - programmatically.  Normal termination is also triggered by clicking - with the left mouse button anywhere in the tablelist's body, outside the - cell just being edited, or moving into another editable cell by using - keyboard navigation.  If the editing was started with the left mouse - button, the edit window is a Tk or tile checkbutton, and the value of the - -instanttoggle option is - true, then the normal termination of the editing will take place - automatically, without any user interaction.
- -
When normal termination of the editing process occurs, the - Tcl command associated with the tablelist widget compares the edit window's - final contents to its original one.  If they are equal then the - embedded widget is destroyed and the cell's original value is - restored.  If the two strings are different and the value of the - -editendcommand - configuration option is a nonempty string, then the edit window's final - text is passed to that command as its last argument (following the - tablelist's path name as well as the cell's row and column indices), the - resulting script is evaluated in the global scope, and the return value - becomes the cell's new internal contents after destroying the temporary - embedded widget.  The main goal of this script is to enable you to do - a final validation of the edit window's contents.  From within this - script you can invoke the rejectinput subcommand, which prevents the - script's return value from becoming the cell's new contents; this - subcommand also prevents the destruction of the temporary embedded - widget.  Another purpose of the command indicated by the - -editendcommand option is to convert the edit window's - text to the cell's new internal contents, which is necessary if, due - to the -formatcommand - column configuration option, the cell's internal value is different from - its external representation.  See the description of the - -forceeditendcommand - option for more about the invocation of the command mentioned above.
- -
DRAG & DROP - SUPPORT
- -
As described in detail in the - "DEFAULT AND INDIVIDUAL BINDINGS FOR THE TABLELIST BODY" section, the - default binding scripts perform an automatic drag-friendly handling of the - selection and of pointer movements with mouse button 1 down if the - tablelist widget's -customdragsource opton was set to true - or its body component was registered as a drag source for mouse button 1 - via the  tkdnd::drag_source register  or the - BWidget DragSite::register command.
- -
On the other hand, you can also register a tablelist widget - as a TkDND drop target, by invoking the  tkdnd::drop_target - register  command.  Similarly, you can register the - body component of a tablelist widget as a drop target for the drag & - drop framework included in BWidget, with the aid of the - DropSite::register command.  (Notice that for - BWidget it is necessary to register the tablelist's body rather than - the widget itself.)
- -
The action to be triggered by a drop event over a tablelist - widget might depend on the row under the mouse and the vertical position of - the mouse pointer within the containing row (if any).  For example, - your application might insert one or more new siblings before or after the - row in question, or a child item having that row as parent, depending on - the vertical position of the mouse pointer within the containing row.  - Alternatively, the drop event might update the item under the mouse, using - the data associated with the drag source, or perform some other, - application-specific action.  In any case, you can significantly - increase the user-friendliness of your application by displaying a target - indicator (a horizontal gap or vertical bar) before or inside the row that - will be affected by the drop.  The examples below demonstrate how to - achieve this for a tablelist widget $tbl with the aid of the - showtargetmark, - hidetargetmark, - targetmarkpos, and - targetmarkpath - subcommands.
- -
- TkDND EXAMPLE:  For an introduction to TkDND see the online - TkDND Tutorial by Georgios - Petasis.  For the following example it is strongly recommended to - use TkDND version 2.7 or later, which can be downloaded from the location - -
-
- http://sourceforge.net/projects/tkdnd/files/ -
-
- -
-
-package require tkdnd 2.7
-
-tkdnd::drop_target register $tbl DND_Text
-
-bind $tbl <<DropEnter>>    { onTblDropEnterOrPos %W %X %Y %a %b }
-bind $tbl <<DropPosition>> { onTblDropEnterOrPos %W %X %Y %a %b }
-bind $tbl <<DropLeave>>    { %W hidetargetmark }
-bind $tbl <<Drop>>         { onTblDrop %W %A %D }
-
-proc onTblDropEnterOrPos {tbl rootX rootY actions buttons} {
-    global place row
-    set y [expr {$rootY - [winfo rooty $tbl]}]
-    foreach {place row} [$tbl targetmarkpos $y] {}
-
-    if {some_optional_excluding_condition} {
-        $tbl hidetargetmark
-        return refuse_drop
-    } else {
-        $tbl showtargetmark $place $row
-        return copy ;# for example
-    }
-}
-
-proc onTblDrop {tbl action data} {
-    handleTblDrop $tbl $data
-    return $action
-}
-
-
-
- -
- BWidget EXAMPLE:  For an introduction to drag & drop with - BWidget see the online tutorial BWidget example: Drag and Drop Demo by - Kevin Walzer.  The DropSite::* commands used in - the following example are described in the "DropSite" reference page - included in the BWidget distribution.  When using this drag & - drop framework, you will have to register not only the tablelist's body, - but also its target indicator as drop sites, to make sure that the target - mark won't get hidden by moving the mouse cursor over it with mouse - button 1 down: - -
-
-package require BWidget
-
-foreach w [list [$tbl bodypath] [$tbl targetmarkpath]] {
-    DropSite::register $w -dropovercmd tblDropOverCmd -dropcmd tblDropCmd \
-        -droptypes ...
-}
-
-proc tblDropOverCmd {dropTarget dragSrc event rootX rootY op dataType data} {
-    # $event may be "enter", "motion", or "leave"
-    set tbl [tablelist::getTablelistPath $dropTarget]
-    if {[string equal $event "leave"]} {
-        set newWidget [winfo containing -displayof $dropTarget $rootX $rootY]
-        if {![string equal $newWidget [$tbl targetmarkpath]] &&
-            ![string equal $newWidget [$tbl bodypath]]} {
-            $tbl hidetargetmark
-            return 2 ;# refuse the drop and re-invoke the callback on motion events
-        }
-    }
-    
-    global place row
-    set y [expr {$rootY - [winfo rooty $tbl]}]
-    foreach {place row} [$tbl targetmarkpos $y] {}
-
-    if {some_optional_excluding_condition} {
-        $tbl hidetargetmark
-        DropSite::setcursor dot
-        return 2 ;# refuse the drop and re-invoke the callback on motion events
-    } else {
-        $tbl showtargetmark $place $row
-        DropSite::setcursor based_arrow_down
-        return 3 ;# accept the drop and re-invoke the callback on motion events
-    }
-}
-
-proc tblDropCmd {dropTarget dragSrc rootX rootY op dataType data} {
-    set tbl [tablelist::getTablelistPath $dropTarget]
-    handleTblDrop $tbl $data
-    return ""
-}
-
-
-
- -
- In both examples above, you can restrict the type of the supported drop - target indicator by appending the argument - -horizontal or -vertical to the - targetmarkpos invocation.  When passing - the -vertical option, you will have to extend the - if statement following that subcommand invocation as - follows: - -
-
-    if {$row < 0 || some_optional_excluding_condition} {
-
-
-
- -
- Both examples above invoke the handleTblDrop procedure, - implemented as follows: - -
-
-proc handleTblDrop {tbl data} {
-    $tbl hidetargetmark
-    global place row
-
-    if {[string equal $place "before"]}
-        if {$row < [$tbl size]} {
-            # Insert a sibling of the item indicated by $row, built from $data
-            # (For a flat tablelist replace the following 2 lines with
-            # "set key [$tbl insert $row ...]")
-            set key [$tbl insertchild [$tbl parentkey $row] \
-                     [$tbl childindex $row] ...]
-        } else {
-            # Append a top-level item built from $data
-            # (For a flat tablelist replace the following line with
-            # "set key [$tbl insert end ...]")
-            set key [$tbl insertchild root end ...]
-        }
-    } else { ;# "inside"
-        # Insert a child of the item indicated by $row, built from $data
-        # Alternatively, update the item indicated by $row, using $data
-        set key [$tbl insertchild $row 0 ...]
-        $tbl expand $row -partly
-    }
-
-    . . .
-}
-
-
-
- -
VIRTUAL EVENTS
- -
Tablelist defines a few virtual events for the purposes of - notification, and makes use of the  event - generate  command to send them to the tablelist widget in - question (whose path name will be the value of the %W - substitution in event scripts).  When using Tk 8.5 or above, most of - these virtual events are generated with their -data - option set to an appropriate event-specific value.  Binding scripts - can access this user data as the value of the %d - substitution.  Unfortunately, the -data option - to  event generate  was not supported by Tk - versions earlier than 8.5.  For these Tk versions, the  - event generate  command will be invoked without - the -data option.
- -
The virtual events generated by Tablelist are as - follows:
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Virtual EventDescriptionUser Data (for Tk 8.5 or Later)
<<TablelistCellRestored>>Generated by the cancelediting subcommand.A list consisting of the numerical row and column indices of the - cell whose content is being edited.
<<TablelistCellUpdated>>Generated by the finishediting subcommand.A list consisting of the numerical row and column indices of the - cell whose content is being edited.
- <<TablelistColHiddenStateChanged>>Generated whenever the hidden state of one or more columns is - toggled by using the columnconfigure, configcolumnlist, - configcolumns, or - togglecolumnhide - subcommand.A list consisting of the numerical indices of the columns whose - hidden state changed.
<<TablelistColumnMoved>>Generated by the default bindings whenever a column is moved - interactively to a new position.A list of length 4, whose first two elements are identical to the - two arguments passed to the movecolumn subcommand invoked for moving - the source column to the target position, and the last two elements - are the corresponding column names, retrieved with the aid of - the  columncget ... - -name  subcommand.
<<TablelistColumnResized>>Generated by the default bindings whenever a column is resized - interactively.The numerical index of the column that was resized.
<<TablelistColumnSorted>>Generated by the tablelist::sortByColumn - command.A list consisting of the numerical column index and the sort - order (decreasing or - increasing).
<<TablelistColumnsSorted>>Generated by the tablelist::addToSortColumns - command.A list consisting of the two lists passed to the - sortbycolumnlist - subcommand, invoked to perform the multi-column sorting.
- <<TablelistRowHiddenStateChanged>>Generated whenever the hidden state of one or more rows is - toggled by using the rowconfigure, configrowlist, configrows, or togglerowhide subcommand.A list consisting of the numerical indices of the rows whose - hidden state changed.
<<TablelistRowMoved>>Generated by the default bindings whenever a row is moved - interactively to a new position.A list of length 3, whose elements are derived from the arguments - passed to the second form of the move subcommand invoked for moving the source - row to the target position.  The first list element will be the - full key corresponding to the first argument, the second one will be - root or the full key corresponding to the second - argument, and the third list element will be identical to the third - argument passed to the move subcommand.
<<TablelistSelect>>, - <<ListboxSelect>>Generated by the default bindings whenever the selection changes - in the tablelist widget due to user interaction.Not used.
<<TablelistSelectionLost>>Sent to the tablelist widget whenever it loses ownership of the - PRIMARY selection.Not used.
-
- -
ROW INDICES
- -
Many of the widget commands for tablelist widgets take one or more row - indices as arguments.  A row index specifies a particular item of the - tablelist, in any of the following ways:
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
numberSpecifies the item as a numerical index, where 0 - corresponds to the first item in the tablelist.
knumberSpecifies the item by its full key, composed of the letter - k and the sequence number associated with the - item.  You can use the getkeys widget command to get this sequence - number, or the getfullkeys widget command to retrieve - the full key.  In addition, the insert, insertlist, insertchildren, and - insertchildlist - subcommands return the list of full keys associated with the items - just inserted.
active   Indicates the item containing the element that has the location - cursor.  Depending on the selection type, this item as a whole - or just its element having the location cursor will be displayed - according to the value of the -activestyle configuration option when - the tablelist has the keyboard focus.  This item is specified - with the activate widget - command or as the row containing the element specified with the - activatecell widget - command.
anchorIndicates the anchor point for the row selection, which is set - with the  selection - anchor  widget command, or the row containing the - anchor point for the cell selection, which is set with the  - cellselection - anchor  widget command.
endIndicates the end of the tablelist.  For most commands this - refers to the last item in the tablelist, but for a few commands such - as index, insert, insertlist, and  showtargetmark before,  as well - as for the target of the move - command it refers to the item just after the last one.
lastIndicates the last item of the tablelist.
topIndicates the topmost item visible in the tablelist window.
bottomIndicates the bottommost item visible in the tablelist - window.
@x,yIndicates the item that covers the point in the tablelist window - specified by x and y (in - pixel coordinates).  If no item covers that point, then the - closest item to that point is used.  The coordinates - x and y are expected to be - relative to the tablelist window itself (not its body - component).
nameSpecifies the row by the value of its -name configuration option.  - name must be different from all the above row - indices, and should be unique (if several rows have the same name - then this value is considered to indicate the first matching - row).
-
- -
In the widget command descriptions below, arguments named - index, first, - last, sourceIndex, and - targetIndex always contain row indices in one of the - above forms.
- -
NODE INDICES
- -
Many of the widget commands for tablelist widgets take a node index as - argument.  A node index is either the word root, - denoting the invisible root node of a tablelist used as a tree widget, or a - regular row index in one of the above forms, specifying a particular item - of the tablelist.
- -
In the widget command descriptions below, arguments named - nodeIndex, parentNodeIndex, and - targetParentNodeIndex always contain node indices.
- -
COLUMN INDICES
- -
Many of the widget commands for tablelist widgets take one or more - column indices as arguments.  A column index specifies a particular - column of the tablelist, in any of the following ways:
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
numberSpecifies the column as a numerical index, where 0 - corresponds to the first column in the tablelist.
active   Indicates the column containing the element that has the location - cursor.  If the selection type is cell then - this element will be displayed according to the value of the - -activestyle - configuration option when the tablelist has the keyboard focus.  - This element is specified with the activatecell widget command.
anchorIndicates the column containing the anchor point for the cell - selection, which is set with the  cellselection anchor  widget - command.
endIndicates the last column of the tablelist, except for the - commands insertcolumns and insertcolumnlist, as well as for - the target of the movecolumn command, in which cases it - refers to the column just after the last one.
lastIndicates the last column of the tablelist.
leftIndicates the leftmost column visible in the tablelist - window.
rightIndicates the rightmost column visible in the tablelist - window.
@x,yIndicates the column that covers the point in the tablelist - window specified by x and y - (in pixel coordinates).  If no column covers that point, then - the closest column to that point is used.  The coordinates - x and y are expected to be - relative to the tablelist window itself (not its body - component).
nameSpecifies the column by the value of its -name configuration option.  - name must be different from all the above column - indices, and should be unique (if several columns have the same name - then this value is considered to indicate the first matching - column).
-
- -
In the widget command descriptions below, arguments named - columnIndex, firstColumn, - lastColumn, sourceColumn, and - targetColumn always contain column indices in one of - the above forms.
- -
CELL INDICES
- -
Many of the widget commands for tablelist widgets take one or more cell - indices as arguments.  A cell index specifies a particular cell of the - tablelist, in any of the following ways:
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
row,colIndicates the cell having the row index row - and column index col.  - row may be a number, a full key (of the form - knumber), active, - anchor, end (where the latter - indicates the last row in the tablelist), last, - top, bottom, or a row - name.  col may be a number, - active, anchor, - end, last, - left, right, or a column - name.
active   Indicates the element that has the location cursor.  If the - selection type is cell then this element will be - displayed according to the value of the -activestyle configuration option when - the tablelist has the keyboard focus.  This element is specified - with the activatecell - widget command.
anchorIndicates the anchor point for the cell selection, which is set - with the  cellselection - anchor  widget command.
endIndicates the last cell in the last row of the tablelist.
lastIndicates the last cell in the last row of the tablelist (same as - end).
@x,yIndicates the cell that covers the point in the tablelist window - specified by x and y (in - pixel coordinates).  If no cell covers that point, then the - closest cell to that point is used.  The coordinates - x and y are expected to be - relative to the tablelist window itself (not its body - component).
-
- -
In the widget command descriptions below, arguments named - cellIndex, firstCell, and - lastCell always contain cell indices in one of the - above forms.
- -
WIDGET COMMAND
- -
- The tablelist::tablelist command creates a new Tcl - command whose name is pathName.  This command - may be used to invoke various operations on the widget.  It has the - following general form: - -
-
-pathName option ?arg arg ...?
-
-
-
- -
option and the args determine - the exact behavior of the command.  The following commands are - possible for tablelist widgets:
- -
-
-
pathName activate - index
- -
Sets the active item to the one indicated by - index if the tablelist's state is not - disabled.  If index is - outside the range of items in the tablelist or it refers to a - non-viewable item then the closest viewable - item is activated.  The active item is drawn as specified by the - -activestyle - configuration option when the widget has the input focus and the - selection type is row.  Its index may be - retrieved with the index active.  Returns an - empty string.
- -
pathName - activatecell cellIndex
- -
Sets the active element to the one indicated by - cellIndex if the tablelist's state is not - disabled.  If cellIndex is - outside the range of elements in the tablelist or it refers to a - non-viewable element, then the closest - viewable element is activated.  The active element is drawn as - specified by the -activestyle configuration option when - the widget has the input focus and the selection type is - cell.  Its index may be retrieved with the - cell index active.  Returns an empty - string.
- -
pathName - applysorting itemList
- -
Sorts the elements of itemList according to the - parameters of the most recent sort, sortbycolumn, or sortbycolumnlist invocation and - returns a new list in sorted order.  The - itemList argument is supposed to be a well-formed - list of lists, where the length of each sublist is expected to be no - less than the number of columns of the tablelist widget.  If the - items haven't been sorted at all, or the sort information was reset by - invoking resetsortinfo, then no sorting takes - place and the return value will be identical to - itemList.
- -
REMARK:  This subcommand is usually invoked - from within the command specified as the value of the -expandcommand configuration option, - for a tablelist row whose children have not yet been inserted into the - widget.  The most efficient way to insert the child items in the - correct order is to add them to a list, sort this list via - applysorting, and then insert the items of the - sorted list by invoking the insertchildlist subcommand.
- -
pathName attrib - ?name? ?value name value ...?
- -
Queries or modifies the attributes of the widget.  If no - name is specified, the command returns a list of - pairs, each of which contains the name and the value of an attribute - for pathName.  If name is - specified with no value, then the command returns - the value of the one named attribute, or an empty string if no - corresponding value exists (you can use the hasattrib subcommand to distinguish this - case from the one that the value of an existing attribute is an - empty string).  If one or more - name-value pairs are specified, - then the command sets the given widget attribute(s) to the given - value(s); in this case the return value is an empty string.  - name may be an arbitrary string.
- -
pathName bbox - index
- -
Returns a list of four numbers describing the bounding box of the - row given by index.  The first two elements of - the list give the x and y coordinates of the upper-left corner of the - screen area covered by the row (specified in pixels relative to the - widget) and the last two elements give the width and height of the - area, in pixels.  If no part of the row given by - index is visible on the screen, or if - index refers to a non-existent row, then the result - is an empty string; if the row is partially visible, the result gives - the full area of the row, including any parts that are not - visible.
- -
pathName - bodypath
- -
Returns the path name of the body component of the widget.
- -
pathName - bodytag
- -
Returns the name of a binding tag whose name depends on the path - name of the tablelist widget and which is associated with the - tablelist's body, the separators, as well as the message and label - widgets used for displaying multi-line elements and images, - respectively.  This binding tag precedes the tag TablelistBody in the list of binding - tags of the tablelist descendants mentioned above, and is designed to - be used when defining individual binding scripts for tablelist - widgets.  The main advantage of using this tag instead of the path - name of the tablelist's body is that it enables you to write event - handling scripts that are valid not only for the tablelist's body but - also for the separators, multi-line cells, and embedded images.
- -
pathName - canceledediting
- -
Returns the value 1 if the most recent interactive - cell editing was canceled (by the user or programmatically, with the - aid of the cancelediting subcommand) and - 0 otherwise.
- -
REMARK:  By invoking this subcommand from - within the Tcl command specified by the -editendcommand configuration option, - you can find out whether the editing session was canceled or terminated - normally.  Remember that this Tcl command will be invoked in both - cases mentioned above if the -forceeditendcommand option was - set to true.
- -
pathName - cancelediting
- -
This subcommand cancels the interactive editing of the contents of - the cell whose index was passed to the editcell subcommand, destroys the temporary - widget embedded into the cell, and restores the original cell - contents.  This command enables you to cancel the interactive cell - editing from within the Tcl command specified by the -editstartcommand configuration - option if that pre-edit callback encounters an error when preparing the - text to be inserted into the edit window.  The command is also - invoked implicitly by pressing the Escape key when a cell - is being edited.  The return value is an empty string.  - Immediately before returning this value, the command generates the - virtual event - <<TablelistCellRestored>>.  For Tk - versions 8.5 or higher, this virtual event is generated with its - -data option set to a list consisting of the - numerical row and column indices of the cell whose content is being - edited.  If no cell was being edited when the command was invoked - then an empty string is returned without generating a virtual - event.
- -
pathName cellattrib - cellIndex ?name? ?value name value - ...?
- -
Queries or modifies the attributes of the cell given by - cellIndex.  If no name is - specified, the command returns a list of pairs, each of which contains - the name and the value of an attribute for the cell.  If - name is specified with no - value, then the command returns the value of the - one named cell attribute, or an empty string if no corresponding value - exists (you can use the hascellattrib subcommand to distinguish - this case from the one that the value of an existing cell - attribute is an empty string).  If one or more - name-value pairs are specified, - then the command sets the given cell attribute(s) to the given - value(s); in this case the return value is an empty string.  - name may be an arbitrary string.
- -
pathName cellbbox - cellIndex
- -
Returns a list of four numbers describing the bounding box of the - cell given by cellIndex.  The first two - elements of the list give the x and y coordinates of the upper-left - corner of the screen area covered by the cell (specified in pixels - relative to the widget) and the last two elements give the width and - height of the area, in pixels.  If no part of the cell given by - cellIndex is visible on the screen, or if - cellIndex refers to a non-existent cell, then the - result is an empty string; if the cell is partially visible, the result - gives the full area of the cell, including any parts that are not - visible.
- -
pathName cellcget - cellIndex option
- -
Returns the current value of the cell configuration option given by - option for the cell specified by - cellIndexoption may - have any of the values accepted by the cellconfigure command.
- -
pathName - cellconfigure cellIndex ?option? value - option value ...?
- -
Queries or modifies the configuration options of the cell given by - cellIndex.  If no option - is specified, the command returns a list describing all of the - available options for the cell (see - Tk_ConfigureInfo for information on the format of - this list).  If option is specified with no - value, then the command returns a list describing - the one named option (this list will be identical to the corresponding - sublist of the value returned if no option is - specified).  If one or more - option-value pairs are - specified, then the command modifies the given cell option(s) to have - the given value(s); in this case the return value is an empty - string.  option may have any of the values - described in the CELL CONFIGURATION OPTIONS - section.
- -
pathName cellindex - cellIndex
- -
Returns the canonical cell index value that corresponds to - cellIndex, in the form - row,col, where - row and col are integers.
- -
pathName - cellselection option args
- -
This command is used to adjust the cell selection within a - tablelist widget.  It has several forms, depending on - option:
- -
-
-
pathName cellselection - anchor cellIndex
- -
Sets the cell selection anchor to the element given by - cellIndex.  If - cellIndex refers to a nonexistent or - non-viewable element, then the closest - viewable element is used.  The cell selection anchor is the - end of the cell selection that is fixed while dragging out a cell - selection with the mouse if the selection type is - cell.  The cell index - anchor may be used to refer to the anchor - element.
- -
pathName cellselection - clear firstCell lastCell
- pathName cellselection clear - cellIndexList
- -
If any of the elements between firstCell - and lastCell (inclusive) or corresponding to - the cell indices specified by the list - cellIndexList are selected, they are - deselected.  The selection state is not changed for elements - outside the range given in the first form of the command or - different from those specified by the cell index list given in its - second form.
- -
pathName cellselection - includes cellIndex
- -
Returns 1 if the element indicated by - cellIndex is currently selected, 0 - if it isn't.
- -
pathName cellselection - set firstCell lastCell
- pathName cellselection set - cellIndexList
- -
Selects all of the selectable elements in the range - between firstCell and - lastCell, inclusive, or corresponding to the - indices specified by the list cellIndexList, - without affecting the selection state of any other elements.  - An element is viewed as selectable if and only if the value of the - -selectable option of - the row containing it is true.
-
-
- -
If the tablelist's state is disabled and - option is different from - includes then the command just returns an empty - string, without performing any of the above actions.
- -
pathName cget - option
- -
Returns the current value of the configuration option given by - option, which may have any of the values accepted - by the tablelist::tablelist command.
- -
pathName childcount - nodeIndex
- -
Returns the number of children of the tree node indicated by - nodeIndex.  If this argument is specified as - root then the return value will be the number of - top-level items of the tablelist widget.
- -
pathName childindex - index
- -
Returns the numerical index of the row given by - index in the list of children of its parent - node.
- -
pathName childkeys - nodeIndex
- -
Returns the list of full keys of the children of the tree node - indicated by nodeIndex.  If this argument is - specified as root then the return value will be the - list of full keys of the top-level items contained in the tablelist - widget.
- -
pathName collapse - index ?-fully|-partly?
- -
This subcommand collapses the specified row of a tablelist used as - a tree widget, i.e., elides all its descendants.  The optional - argument -fully (which is the default) indicates - that the command will be performed recursively, i.e., all of the - descendants of the node specified by index will be - collapsed, so that a subsequent invocation of the non-recursive version - of the expand(all) subcommand - will only display the row's children but no further descendants of - it.  The -partly option (which is used by the - default bindings) restricts the operation to just one hierarchy level, - implying that by a subsequent invocation of the non-recursive version - of the expand(all) subcommand exactly the same - descendants will be displayed again that were visible prior to - collapsing the row.
- -
Before hiding the descendants of a row, the command - specified as the value of the -collapsecommand option (if any) is - automatically concatenated with the name of the tablelist widget and - the row index, and the resulting script is evaluated in the global - scope.
- -
For technical reasons (the use of the - -elide text widget tag option for collapsing a - row), this subcommand is not supported for Tk versions earlier than - 8.3.
- -
pathName - collapseall ?-fully|-partly?
- -
This subcommand collapses all top-level rows of a tablelist used as - a tree widget, i.e., elides all their descendants.  The optional - argument -fully (which is the default) indicates - that the command will be performed recursively, i.e., all of the - descendants of the top-level nodes will be collapsed, so that a - subsequent invocation of the non-recursive version of the - expandall subcommand will - only display ther children but no further descendants of them.  - The -partly option restricts the operation to just - one hierarchy level, implying that by a subsequent invocation of the - non-recursive version of the expandall subcommand - exactly the same items will be displayed again that were visible prior - to collapsing the top-level ones.
- -
Before hiding the descendants of a row, the command - specified as the value of the -collapsecommand option (if any) is - automatically concatenated with the name of the tablelist widget and - the row index, and the resulting script is evaluated in the global - scope.
- -
For technical reasons (the use of the - -elide text widget tag option for collapsing a - row), this subcommand is not supported for Tk versions earlier than - 8.3.
- -
pathName - columnattrib columnIndex ?name? ?value - name value ...?
- -
Queries or modifies the attributes of the column given by - columnIndex.  If no name - is specified, the command returns a list of pairs, each of which - contains the name and the value of an attribute for the column.  - If name is specified with no - value, then the command returns the value of the - one named column attribute, or an empty string if no corresponding - value exists (you can use the hascolumnattrib subcommand to - distinguish this case from the one that the value of an existing - column attribute is an empty string).  If one or more - name-value pairs are specified, - then the command sets the given column attribute(s) to the given - value(s); in this case the return value is an empty string.  - name may be an arbitrary string.
- -
pathName columncget - columnIndex option
- -
Returns the current value of the column configuration option given - by option for the column specified by - columnIndexoption may - have any of the values accepted by the columnconfigure command.
- -
pathName - columnconfigure columnIndex ?option? ?value - option value ...?
- -
Queries or modifies the configuration options of the column given - by columnIndex.  If no - option is specified, the command returns a list - describing all of the available options for the column (see - Tk_ConfigureInfo for information on the format of - this list).  If option is specified with no - value, then the command returns a list describing - the one named option (this list will be identical to the corresponding - sublist of the value returned if no option is - specified).  If one or more - option-value pairs are - specified, then the command modifies the given column option(s) to have - the given value(s); in this case the return value is an empty - string.  option may have any of the values - described in the COLUMN CONFIGURATION - OPTIONS section.
- -
pathName - columncount
- -
Returns the number of columns in the tablelist widget.
- -
pathName - columnindex columnIndex
- -
Returns the integer column index value that corresponds to - columnIndex.
- -
pathName - columnwidth columnIndex - ?-requested|-stretched|-total?
- -
Returns the current width in pixels of the column specified by - columnIndex.  If the optional argument is - -requested (which is the default) then the return - value is the number of pixels corresponding to the column width - specified by the -columns - widget or -width column - configuration option (possibly overridden by interactive column - resizing); if the column width was specified as 0 (and was - not changed by interactive column resizing) then the return value is - the actual number of pixels corresponding to the widest viewable element of the column, including its - header.  With the -stretched option, the - command returns the column width obtained by increasing the value - described above by the number of additional pixels that might have been - added to the requested column width by a stretch operation (see the - -stretch widget and - -stretchable column - configuration options).  Finally, if the optional argument is - -total then the return value is the stretched - column width increased by the number of pixels corresponding to the - left and right margins within the column; this value equals the width - of the header label if the tablelist widget is mapped.
- -
pathName - configcelllist cellConfigSpecList
- -
- For each cell index, option, and value specified by the list - cellConfigSpecList, the command modifies the - given option of the given cell to have the given value.  The - argument cellConfigSpecList must be a list of the - form - -
-
-cellIndex option value cellIndex option value ...
-
-
-
- -
where each option may have any of the values - described in the CELL CONFIGURATION OPTIONS - section.  The return value is an empty string.
- -
- This command has the same effect as - -
-
-eval [list pathName configcells] cellConfigSpecList
-
-
-
- -
but it is more efficient and easier to use.
- -
pathName - configcells ?cellIndex option value - cellIndex option value ...?
- -
For each cellIndex, option, - and value, the command modifies the given option of - the given cell to have the given value.  Each - option may have any of the values described in the - CELL CONFIGURATION OPTIONS section.  - The return value is an empty string.
- -
pathName - configcolumnlist columnConfigSpecList
- -
- For each column index, option, and value specified by the list - columnConfigSpecList, the command modifies the - given option of the given column to have the given value.  The - argument columnConfigSpecList must be a list of - the form - -
-
-columnIndex option value columnIndex option value ...
-
-
-
- -
where each option may have any of the values - described in the COLUMN CONFIGURATION - OPTIONS section.  The return value is an empty string.
- -
- This command has the same effect as - -
-
-eval [list pathName configcolumns] columnConfigSpecList
-
-
-
- -
but it is more efficient and easier to use.
- -
pathName - configcolumns ?columnIndex option value - columnIndex option value ...?
- -
For each columnIndex, - option, and value, the command - modifies the given option of the given column to have the given - value.  Each option may have any of the values - described in the COLUMN CONFIGURATION - OPTIONS section.  The return value is an empty string.
- -
pathName - configrowlist rowConfigSpecList
- -
- For each row index, option, and value specified by the list - rowConfigSpecList, the command modifies the given - option of the given row to have the given value.  The argument - rowConfigSpecList must be a list of the form - -
-
-index option value index option value ...
-
-
-
- -
where each option may have any of the values - described in the ROW CONFIGURATION OPTIONS - section.  The return value is an empty string.
- -
- This command has the same effect as - -
-
-eval [list pathName configrows] rowConfigSpecList
-
-
-
- -
but it is more efficient and easier to use.
- -
pathName configrows - ?index option value index option - value ...?
- -
For each index, option, and - value, the command modifies the given option of the - given row to have the given value.  Each - option may have any of the values described in the - ROW CONFIGURATION OPTIONS section.  The - return value is an empty string.
- -
pathName configure - ?option? ?value option value - ...?
- -
Queries or modifies the configuration options of the widget.  - If no option is specified, the command returns a - list describing all of the available options for - pathName (see Tk_ConfigureInfo - for information on the format of this list).  If - option is specified with no - value, then the command returns a list describing - the one named option (this list will be identical to the corresponding - sublist of the value returned if no option is - specified).  If one or more - option-value pairs are - specified, then the command modifies the given widget option(s) to have - the given value(s); in this case the return value is an empty - string.  option may have any of the values - accepted by the tablelist::tablelist command.
- -
pathName containing - y
- -
Given a y-coordinate within the tablelist window, this command - returns the index of the tablelist item containing that - y-coordinate.  If no corresponding item is found then the return - value is -1.  The coordinate y is - expected to be relative to the tablelist window itself (not its body - component).
- -
pathName - containingcell x y
- -
Given an x- and a y-coordinate within the tablelist window, this - command returns the index of the tablelist cell containing the point - having these coordinates.  If no corresponding cell is found then - the row or column component (or both) of the return value is - -1.  The coordinates x and - y are expected to be relative to the tablelist - window itself (not its body component).
- -
pathName - containingcolumn x
- -
Given an x-coordinate within the tablelist window, this command - returns the index of the tablelist column containing that - x-coordinate.  If no corresponding column is found then the return - value is -1.  The coordinate x is - expected to be relative to the tablelist window itself (not its body - component).
- -
pathName - cornerlabelpath
- -
Returns the path name of the label widget contained in the corner - frame (see the cornerpath - subcommand.  When using Tablelist_tile, the return value will be a - ttk::label widget of the same style as the header labels.  The - global visual options set for the header labels are automatically - applied to this (ttk::)label widget, too.
- -
pathName - cornerpath
- -
Returns the path name of a frame widget that is a sibling of the - tablelist and is automatically created and destroyed together with the - latter's header.  This frame is called the corner frame, - because it is designed to be shown to the right of the tablelist - widget's top-right corner when managing the vertical scrollbar on Mac - OS X Aqua (see below).  The corner frame contains a label or - ttk::label widget, depending on whether the package Tablelist or - Tablelist_tile is being used (see the cornerlabelpath subcommand).  - Whenever the height of the tablelist's header changes, the height of - the corner frame as well as that of the above-mentioned (ttk::)label - widget is updated accordingly.
- -
- REMARK:  This subcommand enables you to manage the - vertical scrollbar (if any) to appear below the tablelist widget's - header, thus respecting the native look & feel on Mac OS X - Aqua.  As shown in the following example, it is recommended to - always create a scrolled tablelist along with the scrollbar(s) as - children of a (ttk::)frame widget: - -
-
-# Add some entries to the Tk option database
-set winSys [tk windowingsystem]
-if {[string compare $winSys "x11"] != 0} {
-    option add *ScrollArea.borderWidth                  1
-    option add *ScrollArea.relief                       sunken
-    option add *ScrollArea.Tablelist.borderWidth        0
-    option add *ScrollArea.Tablelist.highlightThickness 0
-}
-
-. . .
-
-# Create the tablelist and the scrollbars as
-# children of a frame of class ScrollArea
-set frm [(ttk::)frame ... -class ScrollArea]
-set tbl $frm.tbl
-set vsb $frm.vsb
-set hsb $frm.hsb
-tablelist::tablelist $tbl ... \
-    -xscrollcommand [list $hsb set] -yscrollcommand [list $vsb set]
-scrollbar $vsb -orient vertical   -command [list $tbl yview]
-scrollbar $hsb -orient horizontal -command [list $tbl xview]
-
-. . .
-
-# Manage the widgets within the frame
-grid $tbl -row 0 -rowspan 2 -column 0 -sticky news
-if {[string compare $winSys "aqua"] == 0} {
-    grid [$tbl cornerpath] -row 0 -column 1 -sticky ew
-    grid $vsb              -row 1 -column 1 -sticky ns
-} else {
-    grid $vsb -row 0 -rowspan 2 -column 1 -sticky ns
-}
-grid $hsb -row 2 -column 0 -sticky ew
-grid rowconfigure    $frm 1 -weight 1
-grid columnconfigure $frm 0 -weight 1
-
-# Manage the frame
-pack $frm -expand yes -fill both
-
-
-
- -
pathName - curcellselection
- -
Returns a list containing the canonical indices (of the form - row,col, where row and - col are numbers) of all of the elements in the - tablelist that are currently selected.  If there are no such - elements in the tablelist then an empty string is returned.
- -
pathName - curselection
- -
Returns a list containing the numerical indices of all of the items - in the tablelist that contain at least one selected element.  If - there are no such items in the tablelist then an empty string is - returned.
- -
pathName delete - first last
- pathName delete indexList
- -
Deletes one or more items of the tablelist if its state is not - disabled.  In the first form of the command, - first and last are indices - specifying the first and last items in the range to delete.  The - command's second form accepts a list indexList of - indices specifying the items to be deleted.  In both cases, all - descendants of the specified items will be deleted, too.  The - return value is an empty string.
- -
pathName - deletecolumns firstColumn lastColumn
- pathName deletecolumns - columnIndexList
- -
Deletes one or more columns of the tablelist if its - state is not - disabled.  In the first form of the command, - firstColumn and lastColumn are - indices specifying the first and last columns in the range to - delete.  The command's second form accepts a list - columnIndexList of indices specifying the columns - to be deleted.  Returns an empty string.
- -
pathName depth - nodeIndex
- -
Returns the number of steps from the tree node indicated by - nodeIndex to the root - node.  The latter's depth is 0, that of the top-level rows is 1, - and so on.
- -
pathName - descendantcount nodeIndex
- -
Returns the number of descendants of the tree node indicated by - nodeIndex.  If this argument is specified as - root then the return value will be the number of - items of the tablelist widget.
- -
pathName editcell - cellIndex
- -
Starts the interactive editing of the cell's contents if the - tablelist's state is not - disabled and the cell is viewable and editable.  Returns an empty - string.  See the INTERACTIVE CELL - EDITING section for details on editablity and on the editing - process.
- -
pathName - editinfo
- -
Returns a three-element list containing information about the - tablelist cell whose content is being edited.  The first element - of the list is the full key (of the form - knumber) associated with the item containing - the tablelist element that is being edited.  The second and third - elements are the cell's row and column indices.  If currently no - cell is being edited then the return value is the list  {"" - -1 -1}.
- -
pathName - editwinpath
- -
Returns the path name of the temporary embedded widget used for - interactive cell editing, created by the editcell subcommand.  If no cell is - currently being edited then the return value is an empty string.  - This subcommand enables you to access the edit window from within the - commands specified by the -editstartcommand and - -editendcommand - configuration options.
- -
pathName - editwintag
- -
Returns the name of a binding tag whose name depends on the path - name of the tablelist widget and which is associated with some of the - components of the temporary embedded widget used for interactive cell - editing.  These components depend on the edit window: the widget - itself in case of a Tk or tile checkbutton or menubutton; the edit - window's entry children in case of a mentry widget; the only entry or - entry-like component of the edit window in all other cases (see also - the entrypath - subcommand).  This binding tag precedes the tag TablelistEdit in the list of binding - tags of the edit window components mentioned above, and is designed to - be used when defining individual binding scripts for controlling the - interactive cell editing.
- -
- For example, the following command will replace the standard behavior - of the Return key during cell editing in the tablelist - widget .tbl with that of the Tab key: - -
-
-bind [.tbl editwintag] <Return> "[bind TablelistEdit <Tab>]; break"
-
-
-
- -
pathName entrypath
- -
Returns the path name of the entry or entry-like component of the - temporary embedded widget used for interactive cell editing, created by - the editcell - subcommand.  If no cell is currently being edited or the editing - is taking place with the aid of a Tk or tile checkbutton, Tk or tile - menubutton, or mentry widget, then the return value is an empty string; - otherwise it is the path name of a Tk or tile entry, text or ctext, Tk - or tile spinbox, or BWidget Entry widget, which can be the edit window - itself or one of its descendants.  This subcommand enables you to - access the entry or entry-like component of the temporary embedded - widget from within the commands specified by the -editstartcommand and - -editendcommand - configuration options.
- -
pathName expand - index ?-fully|-partly?
- -
This subcommand expands the specified row of a tablelist used as a - tree widget, i.e., makes all its children visible.  The optional - argument -fully (which is the default) indicates - that the command will be performed recursively, i.e., all of the - descendants of the node specified by index will be - displayed.  The -partly option (which is used - by the default bindings) restricts the operation to just one hierarchy - level, indicating that only the children of the specified node will be - displayed, without changing the expanded/collapsed state of the child - nodes.
- -
Before displaying the children of a row, the command - specified as the value of the -expandcommand option (if any) is - automatically concatenated with the name of the tablelist widget and - the row index, and the resulting script is evaluated in the global - scope.  This enables you to insert a tree node's children on - demand, just before expanding it.
- -
For technical reasons (the use of the - -elide text widget tag option for collapsing a - row), this subcommand is not supported for Tk versions earlier than - 8.3.
- -
pathName expandall - ?-fully|-partly?
- -
This subcommand expands all top-level rows of a tablelist used as a - tree widget, i.e., makes all their children visible.  The optional - argument -fully (which is the default) indicates - that the command will be performed recursively, i.e., all of the - descendants of the top-level nodes will be displayed.  The - -partly option restricts the operation to just one - hierarchy level, indicating that only the children of the top-level - nodes will be displayed, without changing the expanded/collapsed state - of the child nodes.
- -
Before displaying the children of a row, the command - specified as the value of the -expandcommand option (if any) is - automatically concatenated with the name of the tablelist widget and - the row index, and the resulting script is evaluated in the global - scope.  This enables you to insert a tree node's children on - demand, just before expanding it.
- -
For technical reasons (the use of the - -elide text widget tag option for collapsing a - row), this subcommand is not supported for Tk versions earlier than - 8.3.
- -
pathName - expandedkeys
- -
Returns the list of full keys of the expanded items.
- -
pathName fillcolumn - columnIndex text
- -
Sets all the elements of the specified column to the value - text.
- -
pathName - findcolumnname name
- -
Returns the index of the first column whose name (given by the - -name column configuration - option) equals name.  If no column has the - specified name then the return value is -1.
- -
pathName - findrowname name ?-descend? ?-parent - nodeIndex?
- -
Returns the row index of the first child of the tree node indicated - by nodeIndex whose name (given by the - -name row configuration - option) equals name.  The - -descend option extends the search to all - descendants of the tree node given by the -parent - option.  The default is to restrict the search to the parent - node's children only.  The default parent is - root.  When searching for the given name, the - items will be visited in the order of their row indices.  If none - of the relevant rows has the specified name then the return value is - -1.
- -
pathName - finishediting
- -
This subcommand attempts to terminate the interactive editing of - the contents of the cell whose index was passed to the - editcell subcommand by - destroying the temporary widget embedded into the cell and updating the - cell's contents.  The exact steps involved are as follows:  - First, the widget's final text is compared to its original one.  - If they are equal then the edit window is destroyed and the cell's - original contents are restored.  If the two strings are different - and the value of the -editendcommand configuration option - is a nonempty string, then the widget's final text is passed to that - command as its last argument (following the tablelist's path name as - well as the cell's row and column indices), the resulting script is - evaluated in the global scope, and the return value becomes the cell's - new contents after destroying the edit window.  However, if from - within this script the rejectinput subcommand was invoked then - the cell's value is not changed and the embedded widget remains - displayed in the cell; in this case the command returns the boolean - value 0.  In all the other cases, the return value is - 1.  Immediately before returning the value - 1, the command generates the virtual event - <<TablelistCellUpdated>>.  For Tk - versions 8.5 or higher, this virtual event is generated with its - -data option set to a list consisting of the - numerical row and column indices of the cell whose content is being - edited.  If no cell was being edited when the command was invoked - then the same value 1 is returned but no virtual event is - generated.
- -
This subcommand is called implicitly by pressing - Return or KP_Enter (together with - Control if the edit window is a text or ctext widget) when - editing a cell, or by clicking with the left mouse button anywhere in - the tablelist's body, outside the cell just being edited, or moving - into another editable cell by using keyboard navigation.  If the - editing was started with the left mouse button, the edit window is a Tk - or tile checkbutton, and the value of the -instanttoggle option is true, then - this subcommand will be invoked automatically, without any user - interaction.
- -
REMARK:  There are also situations where an - explicit invocation of this subcommand is needed, in order to - make sure that the cell just being edited gets updated with the text - entered by the user.  For example, if a tablelist widget is part - of a dialog used for editing some data, then the command associated - with the button designed to accept the data should call this - subcommand, because otherwise, if the button is pressed during - interactive cell editing then the text entered into the edit window - will get lost.
- -
pathName - formatinfo
- -
This command is designed to be invoked from within a Tcl command - specified as the value of the -formatcommand column configuration - option.  It returns a three-element list containing information - about the tablelist cell whose content is being formatted with the aid - of that command.  The first element of the list is the full key - (of the form knumber) associated with the - item containing the tablelist element that is being formatted.  - The second and third elements are the cell's row and column - indices.
- -
- REMARK:  This subcommand is needed in cases where the - result of the formatting should depend on the cell's row.  To be - able to use it, specify the value of the - -formatcommand column configuration option - as  [list formatCommand - pathName],  like in the following example: - -
-
-.tbl columnconfigure 1 -formatcommand [list formatValue .tbl]
-
-proc formatValue {tbl val} {
-    # Get information about the cell whose content is being formatted
-    foreach {key row col} [$tbl formatinfo] {}
-
-    # Return a string depending on $val and $row (or $key)
-    . . .
-}
-
-
-
- -
pathName get first - last
- pathName get indexList
- -
The first form of the command returns a list whose elements are all - of the tablelist items (i.e., row contents) between - first and last, - inclusive.  The value returned by the second form depends on the - number of elements in the list indexList: if the - latter contains exactly one index then the return value is the - tablelist item indicated by that index (or an empty string if the index - refers to a non-existent item); otherwise the command returns the list - of all of the tablelist items corresponding to the indices specified by - indexList.
- -
pathName getcells - firstCell lastCell
- pathName getcells cellIndexList
- -
The first form of the command returns a list whose elements are all - of the tablelist elements (i.e., cell contents) between - firstCell and lastCell, - inclusive.  The value returned by the second form depends on the - number of elements in the list cellIndexList: if - the latter contains exactly one cell index then the return value is the - tablelist element indicated by that cell index; otherwise the command - returns the list of all of the tablelist elements corresponding to the - cell indices specified by cellIndexList.
- -
pathName getcolumns - firstColumn lastColumn
- pathName getcolumns - columnIndexList
- -
The first form of the command returns a list whose elements are - lists themselves, where each of the sublists corresponds to exactly one - column between firstColumn and - lastColumn, inclusive, and consists of all of the - tablelist elements contained in that column.  The value returned - by the second form depends on the number of elements in the list - columnIndexList: if the latter contains exactly one - column index then the return value is a list consisting of all of the - tablelist elements contained in the column indicated by that column - index; otherwise the command returns a list whose elements are lists - themselves, where each of the sublists corresponds to exactly one - column index in columnIndexList and consists of all - of the tablelist elements contained in that column.
- -
pathName - getformatted first last
- pathName getformatted indexList
- -
The first form of the command returns a list whose elements are all - of the formatted tablelist items (i.e., - formatted row contents) between first and - last, inclusive.  The value returned by the - second form depends on the number of elements in the list - indexList: if the latter contains exactly one index - then the return value is the formatted tablelist item indicated by that - index (or an empty string if the index refers to a non-existent item); - otherwise the command returns the list of all of the formatted - tablelist items corresponding to the indices specified by - indexList.
- -
pathName - getformattedcells firstCell lastCell
- pathName getformattedcells - cellIndexList
- -
The first form of the command returns a list whose elements are all - of the formatted tablelist elements (i.e., - formatted cell contents) between firstCell and - lastCell, inclusive.  The value returned by - the second form depends on the number of elements in the list - cellIndexList: if the latter contains exactly one - cell index then the return value is the formatted tablelist element - indicated by that cell index; otherwise the command returns the list of - all of the formatted tablelist elements corresponding to the cell - indices specified by cellIndexList.
- -
pathName - getformattedcolumns firstColumn - lastColumn
- pathName getformattedcolumns - columnIndexList
- -
The first form of the command returns a list whose elements are - lists themselves, where each of the sublists corresponds to exactly one - column between firstColumn and - lastColumn, inclusive, and consists of all of the - formatted tablelist elements contained in - that column.  The value returned by the second form depends on the - number of elements in the list columnIndexList: if - the latter contains exactly one column index then the return value is a - list consisting of all of the formatted tablelist elements contained in - the column indicated by that column index; otherwise the command - returns a list whose elements are lists themselves, where each of the - sublists corresponds to exactly one column index in - columnIndexList and consists of all of the - formatted tablelist elements contained in that column.
- -
pathName - getfullkeys first last
- pathName getfullkeys indexList
- -
The first form of the command returns a list whose elements are all - of the full keys associated with the tablelist items between - first and last, - inclusive.  The value returned by the second form depends on the - number of elements in the list indexList: if the - latter contains exactly one index then the return value is the full key - associated with the tablelist item indicated by that index (or an empty - string if the index refers to a non-existent item); otherwise the - command returns the list of all of the full keys associated with the - tablelist items corresponding to the indices specified by - indexList.
- -
Each item of a tablelist widget has a unique sequence - number that remains unchanged until the item is deleted, thus acting as - a key that uniquely identifies the item even if the latter's position - (i.e., numerical row index) changes.  This command provides - read-only access to the full keys obtained by prepending the letter - k to these internal item IDs.
- -
pathName getkeys - first last
- pathName getkeys indexList
- -
The first form of the command returns a list whose elements are all - of the sequence numbers associated with the tablelist items between - first and last, - inclusive.  The value returned by the second form depends on the - number of elements in the list indexList: if the - latter contains exactly one index then the return value is the sequence - number associated with the tablelist item indicated by that index (or - an empty string if the index refers to a non-existent item); otherwise - the command returns the list of all of the sequence numbers associated - with the tablelist items corresponding to the indices specified by - indexList.
- -
Each item of a tablelist widget has a unique sequence - number that remains unchanged until the item is deleted, thus acting as - a key that uniquely identifies the item even if the latter's position - (i.e., numerical row index) changes.  This command provides - read-only access to these internal item IDs.
- -
pathName hasattrib - name
- -
Returns 1 if the attribute name - exists and 0 otherwise.
- -
pathName - hascellattrib cellIndex name
- -
Returns 1 if the attribute name - for the cell given by cellIndex exists and - 0 otherwise.
- -
pathName - hascolumnattrib columnIndex name
- -
Returns 1 if the attribute name - for the column given by columnIndex exists and - 0 otherwise.
- -
pathName - hasrowattrib index name
- -
Returns 1 if the attribute name - for the row given by index exists and - 0 otherwise.
- -
pathName - hidetargetmark
- -
Hides the horizontal gap or vertical bar displayed by the - showtargetmark - command.  No error is generated if the target indicator is not - visible at the time the command is invoked.
- -
This command is designed to be used during a drag & - drop operation for which the tablelist widget (or its body component) - was registered as a drop target.  See the DRAG & DROP SUPPORT section for - details and examples.
- -
pathName - imagelabelpath cellIndex
- -
Returns the path name of the label widget containing the image - embedded into the cell given by cellIndex, as - specified with the -image - option of the cellconfigure subcommand.  If no - image is currently embedded into the cell then the return value is an - empty string.
- -
- REMARK:  This subcommand comes in handy if you want to - associate a binding script with the embedded images.  The - recommended way to achieve this is shown in the following example: - -
-
-bind [.tbl bodytag] <Button-1> {printClickedImage %W %x %y}
-proc printClickedImage {w x y} { - foreach {tbl x y} [tablelist::convEventFields $w $x $y] {} - set cellIdx [$tbl containingcell $x $y] - scan $cellIdx "%d,%d" row col - if {$row >= 0 && $col >= 0 && - [string compare $w [$tbl imagelabelpath $cellIdx]] == 0} { - puts "clicked the image of cell $cellIdx" - } -} -
-
-
- -
pathName index - index
- -
Returns the integer row index value that corresponds to - index.  For compatibility with the Tk core - listbox, if index is end then - the return value is the number of items in the tablelist (not the index - of the last item).  To get the numerical index of the last item, - you can pass the word last as - index argument.
- -
pathName insert - index ?item item ...?
- -
Inserts zero or more new items in the widget's internal list just - before the item given by index if the tablelist's - state is not - disabled.  If index equals - the number of items or is specified as end then the - new items are added to the end of the widget's list.  Tabulator - characters are displayed as \t (i.e., a backslash followed - by a t) but are inserted unchanged into the internal - list.  Newline characters will force line breaks, i.e., will give - rise to multi-line elements (which are displayed in embedded message - widgets, created on demand).  The return value is the list of full - keys associated with the items just inserted.
- -
REMARK:  This subcommand is not suitable for - inserting items into a tablelist designed for displaying a tree - hierarchy.  For such tablelist widgets use the insertchildren or insertchildlist subcommand.
- -
pathName - insertchildlist parentNodeIndex childIndex - itemList
- -
Inserts the items of the list itemList in the - widget's internal list of children of the node specified by - parentNodeIndex just before the item given by - childIndex if the tablelist's state is not - disabledchildIndex must - be a number, last (specifying the parent's last - child), or end; if it equals the number of children - of the node given by parentNodeIndex or is - specified as end then the new items are added to - the end of the parent's list of children.  Tabulator characters - are displayed as \t (i.e., a backslash followed by a - t) but are inserted unchanged into the internal - list.  Newline characters will force line breaks, i.e., will give - rise to multi-line elements (which are displayed in embedded message - widgets, created on demand).  The return value is the list of full - keys associated with the items just inserted.
- -
- This command has the same effect as - -
-
-eval [list pathName insertchildren parentNodeIndex childIndex] itemList
-
-
-
- -
but it is more efficient and easier to use.
- -
For technical reasons (the use of the - -elide text widget tag option for collapsing a - row), this subcommand is not supported for Tk versions earlier than - 8.3.
- -
REMARK:  You can achieve a quite significant - speadup by using this subcommand to insert a whole list of items rather - than using multiple invocations of insertchildren.
- -
pathName - insertchildren parentNodeIndex childIndex - ?item item ...?
- -
Inserts zero or more new items in the widget's internal list of - children of the node specified by parentNodeIndex - just before the item given by childIndex if the - tablelist's state is not - disabledchildIndex must - be a number, last (specifying the parent's last - child), or end; if it equals the number of children - of the node given by parentNodeIndex or is - specified as end then the new items are added to - the end of the parent's list of children.  Tabulator characters - are displayed as \t (i.e., a backslash followed by a - t) but are inserted unchanged into the internal - list.  Newline characters will force line breaks, i.e., will give - rise to multi-line elements (which are displayed in embedded message - widgets, created on demand).  The return value is the list of full - keys associated with the items just inserted.
- -
For technical reasons (the use of the - -elide text widget tag option for collapsing a - row), this subcommand is not supported for Tk versions earlier than - 8.3.
- -
REMARK:  It is explicitly allowed to - abbreviate the name insertchildren as - insertchild.  This comes in handy when using - this subcommand to insert just one child item.
- -
pathName - insertcolumnlist columnIndex - columnList
- -
Inserts the columns specified by the list - columnList just before the column given by - columnIndex if the tablelist's state is not - disabled.  If columnIndex - equals the number of columns or is specified as end - then the new columns are added to the end of the column list.  The - argument columnList must be a list containing the - width, title, and optional alignment specifications for the new - columns, in the same form as in the case of the -columns configuration option.  The - return value is an empty string.  The elements of the new columns - are initially empty strings; the easiest way to change these values is - to use the fillcolumn - subcommand or the -text - column configuration option.
- -
- This command has the same effect as - -
-
-eval [list pathName insertcolumns columnIndex] columnList
-
-
-
- -
but it is more efficient and easier to use.
- -
pathName - insertcolumns columnIndex ?width title - ?alignment? width title ?alignment? - ...?
- -
Inserts zero or more new columns just before the column given by - columnIndex if the tablelist's state is not - disabled.  If columnIndex - equals the number of columns or is specified as end - then the new columns are added to the end of the column list.  The - arguments following the column index have the same meanings as in the - case of the -columns - configuration option.  The return value is an empty string.  - The elements of the new columns are initially empty strings; the - easiest way to change these values is to use the fillcolumn subcommand or the - -text column configuration - option.
- -
pathName insertlist - index itemList
- -
Inserts the items of the list itemList in the - widget's internal list just before the item given by - index if the tablelist's state is not - disabled.  If index equals - the number of items or is specified as end then the - new items are added to the end of the widget's list.  Tabulator - characters are displayed as \t (i.e., a backslash followed - by a t) but are inserted unchanged into the internal - list.  Newline characters will force line breaks, i.e., will give - rise to multi-line elements (which are displayed in embedded message - widgets, created on demand).  The return value is the list of full - keys associated with the items just inserted.
- -
- This command has the same effect as - -
-
-eval [list pathName insert index] itemList
-
-
-
- -
but it is more efficient and easier to use.
- -
REMARK 1:  You can achieve a quite - significant speadup by using this subcommand to insert a whole list of - items rather than using multiple invocations of insert.
- -
REMARK 2:  This subcommand is not suitable - for inserting items into a tablelist designed for displaying a tree - hierarchy.  For such tablelist widgets use the insertchildlist or insertchildren subcommand.
- -
pathName - iselemsnipped cellIndex fullTextName
- -
Returns the value 1 if the text displayed in the cell - specified by cellIndex is snipped and - 0 otherwise.  In both cases, the full (unsnipped) - cell text is stored in the variable having the name given by - fullTextName; this full text can be the cell's - contents or the string obtained from the latter by using the - -formatcommand - option of the cell's column.  The most common invocation of this - command occurs within the procedure specified as the value of the - -tooltipaddcommand - configuration option.
- -
pathName isexpanded - index
- -
Returns the value 1 if the row indicated by - index is expanded and 0 - otherwise.
- -
pathName - istitlesnipped columnIndex - fullTextName
- -
Returns the value 1 if the text displayed in the - header label specified by columnIndex is snipped - and 0 otherwise.  In both cases, the full (unsnipped) - label text is stored in the variable having the name given by - fullTextName.  The most common invocation of - this command occurs within the procedure specified as the value of the - -tooltipaddcommand - configuration option.
- -
pathName isviewable - index
- -
Returns the value 1 if the row indicated by - index is viewable and 0 - otherwise.  A tablelist row is called viewable if the value of its - -hide option is false and - all its ancestors are (partly) expanded.   Likewise, a tablelist - cell is called viewable if its row is viewable and the value of its - column's -hide option is - false.
- -
pathName - itemlistvar
- -
- Returns the name of a variable used by Tablelist to hold the widget's - internal list.  The recommended way to use this variable is to - create a link to it with the aid of the upvar - command, like in the following example: - -
-
-upvar #0 [.tbl itemlistvar] itemList
-
-
-
- -
In this example, the value of the variable itemList - will be the internal list of the tablelist widget - .tbl.  Each element of the widget's internal list - corresponds to one item, and it is in turn a list whose elements - correspond to the elements of that item, except that it has one - additional element, holding the item's full key.
- -
REMARK:  The itemlistvar - command provides an efficient way for accessing this internal list, - instead of retrieving the items with the get subcommand or using the -listvariable option (these methods - consume significantly more memory).  It can be useful in - situations where the elements of a tablelist widget are to be accessed - for creating text files, HTML output, XML data, database commands, - etc.  This should, however, be a strictly readonly access; - otherwise the results will be unpredictable!
- -
pathName labelpath - columnIndex
- -
Returns the path name of the header label corresponding to the - column indicated by columnIndex.
- -
pathName - labels
- -
Returns a list containing the path names of all header labels of - the widget.
- -
pathName - labeltag
- -
Returns the name of a binding tag whose name depends on the path - name of the tablelist widget and which is associated with the header - labels as well as with the additional widgets placed by Tablelist into - the latters for displaying header images and sort arrows.  This - binding tag is designed to be used when defining non-default binding - scripts for the header labels.  From within such event handling - scripts you can retrieve the column number and the tablelist widget's - path name with the aid of the helper commands tablelist::getTablelistColumn - and tablelist::getTablelistPath.
- -
pathName move - sourceIndex targetIndex
- pathName move sourceIndex - targetParentNodeIndex targetChildIndex
- -
The first form of the command moves the item indicated by - sourceIndex just before the one given by - targetIndex if the tablelist's state is not - disabled.  If targetIndex - equals the nunber of items or is specified as end - then the source item is moved after the last one.  The item - specified by targetIndex must have the same parent - as the one given by sourceIndex, or else it must be - the item just below the last descendant of the source node's - parent.
- -
The command's second form moves the item indicated by - sourceIndex just before the node having the parent - indicated by targetParentNodeIndex and the index - targetChildIndex in the parent's list of children - if the tablelist's state is - not disabled.  - targetChildIndex must be a number, - last (specifying the target parent's last child), - or end; if it equals the number of children of the - target parent node or is specified as end then the - source item is moved after the target parent node's last child.
- -
Both forms of the command preserve the node hierarchy - under the source item, by moving its descendants accordingly.  The - return value is an empty string.
- -
pathName movecolumn - sourceColumn targetColumn
- -
Moves the column indicated by sourceColumn just - before the one given by targetColumn if the - tablelist's state is not - disabled.  If targetColumn - equals the number of columns or is specified as end - then the source column is moved after the last one.  Returns an - empty string.
- -
pathName nearest - y
- -
Given a y-coordinate within the tablelist window, this command - returns the index of the viewable tablelist - item nearest to that y-coordinate.  The coordinate - y is expected to be relative to the tablelist - window itself (not its body component).
- -
pathName - nearestcell x y
- -
Given an x- and a y-coordinate within the tablelist window, this - command returns the index of the viewable - tablelist cell nearest to the point having these coordinates.  The - coordinates x and y are - expected to be relative to the tablelist window itself (not its body - component).
- -
pathName - nearestcolumn x
- -
Given an x-coordinate within the tablelist window, this command - returns the index of the non-hidden tablelist column nearest to that - x-coordinate.  The coordinate x is expected to - be relative to the tablelist window itself (not its body - component).
- -
pathName noderow - parentNodeIndex childIndex
- -
Returns the numerical row index of the node having the parent - indicated by parentNodeIndex and the index - childIndex in the parent's list of children.  - childIndex must be a number, - last (specifying the parent's last child), or - end; if it equals the number of children of the - parent node or is specified as end then the return - value will be the row index of the item following the parent node's - last descendant.
- -
pathName parentkey - nodeIndex
- -
Returns the full key of the parent of the tree node indicated by - nodeIndex.  If this argument is specified as - root then the return value will be an empty - string.  If nodeIndex identifies a top-level - item then the subcommand will return root.  - For all other items the return value will be a full key of the form - knumber.
- -
pathName - refreshsorting ?parentNodeIndex?
- -
Sorts the children of the tablelist node specified by - parentNodeIndex according to the parameters of the - most recent sort, - sortbycolumn, or - sortbycolumnlist - invocation.  If the items haven't been sorted at all, or the sort - information was reset by invoking resetsortinfo, then no sorting takes - place.  The optional argument parentNodeIndex - defaults to root, meaning that all the items are to - be sorted per default.  The return value is an empty string.
- -
pathName - rejectinput
- -
If invoked from within the Tcl command specified by the - -editendcommand - configuration option, then this subcommand prevents the termination of - the interactive editing of the contents of the cell whose index was - passed to the editcell - subcommand.  It invokes the seecell subcommand to make sure the - respective cell becomes visible (in case it was scrolled out of view), - and sets the focus to the temporary widget embedded into the - cell.  This command enables you to reject the widget's text during - the final validation of the string intended to become the new cell - contents.  The return value is an empty string.
- -
pathName - resetsortinfo
- -
Resets the information about the sorting of the items.  - Subsequent invocations of sortcolumn and sortorder will return -1 and - an empty string, respectively.  Similarly, subsequent invocations - of sortcolumnlist and - sortorderlist will - return an empty string.  This command also removes any existing - up- or down-arrows displayed by an earlier invocation of - sortbycolumn or - sortbycolumnlist.  The return - value is an empty string.
- -
pathName rowattrib - index ?name? ?value name value - ...?
- -
Queries or modifies the attributes of the row given by - index.  If no name is - specified, the command returns a list of pairs, each of which contains - the name and the value of an attribute for the row.  If - name is specified with no - value, then the command returns the value of the - one named row attribute, or an empty string if no corresponding value - exists (you can use the hasrowattrib subcommand to distinguish - this case from the one that the value of an existing row - attribute is an empty string).  If one or more - name-value pairs are specified, - then the command sets the given row attribute(s) to the given value(s); - in this case the return value is an empty string.  - name may be an arbitrary string.
- -
pathName rowcget - index option
- -
Returns the current value of the row configuration option given by - option for the row specified by - indexoption may have - any of the values accepted by the rowconfigure command.
- -
pathName - rowconfigure index ?option? ?value - option value ...?
- -
Queries or modifies the configuration options of the row given by - index.  If no option is - specified, the command returns a list describing all of the available - options for the row (see Tk_ConfigureInfo for - information on the format of this list).  If - option is specified with no - value, then the command returns a list describing - the one named option (this list will be identical to the corresponding - sublist of the value returned if no option is - specified).  If one or more - option-value pairs are - specified, then the command modifies the given row option(s) to have - the given value(s); in this case the return value is an empty - string.  option may have any of the values - described in the ROW CONFIGURATION OPTIONS - section.
- -
pathName scan - option args
- -
This command is used to implement scanning on tablelist - widgets.  It has two forms, depending on - option:
- -
-
-
pathName scan mark - x y
- -
Records x and y and the - current view in the tablelist window; used in conjunction with - later  scan dragto  - commands.  Typically this command is associated with a mouse - button press in the body component of the widget.  It returns - an empty string.  The coordinates x and - y are expected to be relative to the tablelist - window itself (not its body component).
- -
pathName scan dragto - x y
- -
This command computes the difference between its - x and y arguments to the - last  scan mark  command for - the widget.  It then adjusts the view (the vertical one only - in the body component) by 10 times the difference in - coordinates.  This command is typically associated with mouse - motion events in the body component of the widget, to produce the - effect of dragging the table at high speed through the - window.  The return value is an empty string.  The - coordinates x and y are - expected to be relative to the tablelist window itself (not its - body component).
-
-
- -
pathName - searchcolumn columnIndex pattern - ?options?
- -
This subcommand searches the elements of the column given by - columnIndex to see if one of them matches - pattern.  If a match is found, the row index - of the first matching element is returned as result (unless the option - -all is specified).  If not, the return value - is -1.  One or more of the following options may be - specified to control the search:
- -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-allChanges the result to be the list of all matching row - indices, which will be in numeric order (or in reverse numeric - order when used with the -backwards - option).
-backwardsThe search will proceed backward through the given column's - elements.
-check commandSpecifies an additional condition to be fulfilled by the - matching elements.  If an element of the specified column - matches the given pattern and command is a nonempty - string, then the latter is automatically concatenated with the - name of the tablelist widget, the element's row index, the - numerical equivalent of columnIndex, as well - as the element itself or its formatted version (depending on the presence - of the -formatted option), the resulting - script is evaluated in the global scope, and the return value - (which must be a boolean) will determine whether the element in - question will still be viewed as matching or not.  The - default command is an empty string.  This option - enables you to pass arbitrary additional matching criteria to the - searching process.
-descendSearch the elements of the specified column in all - descendants of the tree node given by the - -parent option.  The elements will be - visited in the order of their row indices (or in reverse order of - their row indices when used with the - -backwards option).  The default is to - restrict the search to the parent node's children only.
-exactThe matching element(s) must be identical to the literal - string pattern.
-formattedExamine the formatted versions - of the elements rather than the internal cell values.
-globTreat pattern as a glob-style pattern and - match it against the elements using the same rules as the  - string match  command.
-nocaseCauses comparisons to be handled in a case-insensitive - manner.  Has no effect if combined with the - -numeric option.
-notThis option negates the sense of the match, returning the row - index of the first non-matching element (or, in the presence of - the -all option, the list of row indices of - all non-matching elements) of the given column.
-numericThe elements are to be compared to - pattern as integer or floating-point values, - using the == comparison operator.  This - option is only meaningful when used with - -exact.
-parent - nodeIndex  This option restricts the search to the children (or - descendants, when used with -descend) of the - tree node given by nodeIndex.  The - default parent is root.
-regexpTreat pattern as a regular expression and - match it against the elements using the rules described in the - re_syntax reference page.
-start indexThe elements of the specified column are to be searched - (forwards or backwards) starting at the row given by - index.  This option makes it easy to - provide incremental search.
-
- -
If all matching style options - -exact, -glob, and - -regexp are omitted then the matching style - defaults to -glob.  If more than one of them - is specified, the last matching style given takes precedence.
- -
Before examining the children (or descendants, when used - with the -descend option) of a row whose children - have not been inserted yet, the command specified as the value of the - -populatecommand - option (if any) is automatically concatenated with the name of the - tablelist widget and the row index, and the resulting script is - evaluated in the global scope.  This enables you to insert the - children on demand, just before searching them for the specified - pattern.
- -
pathName see - index
- -
Adjusts the view in the tablelist so that the item given by - index is visible.  If the item is already - visible then the command has no effect; if the item is near one edge of - the window then the tablelist scrolls to bring the item into view at - the edge; otherwise the tablelist scrolls to center the item.
- -
pathName seecell - cellIndex
- -
Adjusts the view in the tablelist so that the cell given by - cellIndex is visible.  If the cell is already - visible then the command has no effect; if the cell is near one edge of - the window then the tablelist scrolls to bring the cell into view at - the edge; otherwise the tablelist scrolls to center the cell.  If - the value of the -titlecolumns option is positive then - the centering of the cell is only done vertically; the horizontal - scrolling (which in this case is performed column-wise) will just bring - the cell into view next to the title columns or at the right edge of - the window.
- -
id="seecolumn">pathName seecolumn - columnIndex
- -
Adjusts the view in the tablelist so that the column given by - columnIndex is visible.  If the column is - already visible then the command has no effect; if the column is near - one edge of the window then the tablelist scrolls horizontally to bring - the column into view at the edge; otherwise the tablelist scrolls - horizontally to center the column.  If the value of the - -titlecolumns option is - positive then the horizontal scrolling (which in this case is performed - column-wise) will just bring the column into view next to the title - columns or at the right edge of the window.
- -
pathName selection - option args
- -
This command is used to adjust the selection within a tablelist - widget.  It has several forms, depending on - option:
- -
-
-
pathName selection anchor - index
- -
Sets the selection anchor to the item given by - index.  If index - refers to a nonexistent or non-viewable - item, then the closest viewable item is used.  The selection - anchor is the end of the selection that is fixed while dragging out - a selection with the mouse if the selection type is - row.  The index anchor - may be used to refer to the anchor item.
- -
pathName selection clear - first last
- pathName selection clear - indexList
- -
If any of the items between first and - last (inclusive) or corresponding to the - indices specified by the list indexList contain - at least one selected cell, they are deselected.  The - selection state is not changed for items outside the range given in - the first form of the command or different from those specified by - the index list given in its second form.
- -
pathName selection - includes index
- -
Returns 1 if the item indicated by - index contains at least one selected cell, - 0 if it doesn't.
- -
pathName selection set - first last
- pathName selection set - indexList
- -
Selects all of the selectable items in the range between - first and last, inclusive, - or corresponding to the indices specified by the list - indexList, without affecting the selection - state of any other items.
-
-
- -
If the tablelist's state is disabled and - option is different from - includes then the command just returns an empty - string, without performing any of the above actions.
- -
pathName - separatorpath ?columnIndex?
- -
If the optional argument is not specified, then this command - returns the path name of the special separator displayed to mark the - end of the title columns if the value of the -titlecolumns option is positive and an - empty string otherwise.  If the optional argument is present, then - the command returns the path name of the separator attached to the - right edge of the header label indicated by - columnIndex if the value of the -showseparators configuration option - is true and an empty string otherwise.
- -
pathName - separators
- -
Returns a list containing the path names of all column - separators.  If the value of the -titlecolumns option is positive then - the first element of the list will be the path name of the special - separator displayed to mark the end of the title columns.  Whether - the path names of the other separators are included in the list, - depends on the value of the -showseparators configuration - option.
- -
pathName - showtargetmark before|inside - index
- -
Displays a drop target indicator having the form of a horizontal - gap or vertical bar before or inside the row specified by - index.  If the subcommand's name is followed - by before and index equals the - number of items or is specified as end then the - horizontal gap will be shown just after the tablelist's last - row.  If the subcommand is used with the - inside option then the index - end is interpreted as indicating the widget's last - item.
- -
This command is designed to be used during a drag & - drop operation for which the tablelist widget (or its body component) - was registered as a drop target.  See the DRAG & DROP SUPPORT section for - details and examples.
- -
pathName size
- -
Returns the total number of items in the tablelist widget.
- -
pathName sort - ?-increasing|-decreasing?
- -
Sorts the items in increasing or decreasing order, as specified by - the optional argument.  The default is - -increasing.  Uses the value of the - -sortcommand widget - configuration option as comparison command.  - sort also removes any existing up- or down-arrows - displayed by an earlier invocation of sortbycolumn or sortbycolumnlist.  After - sorting the items, the command conditionally adjusts the vertical view - as follows: (a) if interactive cell editing is in progress then the - cell being edited is brought into view; (b) else, if exactly one item - is selected then the view is shifted to bring that item into view; (c) - else, if the tablelist's body is the most recent window to have the - input focus among all the windows in the same top-level as the widget - itself then the currently active item is brought into view.
- -
pathName - sortbycolumn columnIndex - ?-increasing|-decreasing?
- -
Sorts the items based on the elements of the column given by - columnIndex, in increasing or decreasing order, as - specified by the optional argument.  The default is - -increasing.  The sorting process is - controlled by the values of the -sortmode and -sortcommand options for the given - column.  If both the value of the -showarrow configuration option and that of - the -showarrow option - for the specified column are true then an up- or down-arrow indicating - the sort order will be placed into the column's label.  The shape - of the arrow depends on the command's optional argument and on the - value of the -incrarrowtype configuration - option.  If the label's text is right-aligned then the arrow will - be displayed on the left side of the label, otherwise on its right - side.  After sorting the items, the vertical view is adjusted in - the same way as in the case of the sort subcommand.
- -
The actions described above are only performed if the - specified column's -showlinenumbers option hasn't - been set to true.
- -
pathName - sortbycolumnlist columnIndexList - ?sortOrderList?
- -
Sorts the items based on the elements of the columns given by the - columnIndexList argument, which must be a list of - distinct column indices.  Only those elements of this list are - considered significant that identify columns whose -showlinenumbers option hasn't - been set to true.
- -
The items are first sorted based on the column specified - by the last significant element of columnIndexList, - then based on the one given by the last but one significant element, - and so on.  The order of each sort operation is taken from the - optional argument sortOrderList, whose elements - must be (abbreviations of) increasing or - decreasing.  If this argument was not - specified or contains less elements than - columnIndexList then the missing sort orders are - assumed to be increasing.  Each sorting - process is controlled by the values of the -sortmode and -sortcommand options for the - respective column.  If the column's index was specified among the - first 9 significant elements of columnIndexList and - both the value of the -showarrow configuration option and that of - the -showarrow option - for that column are true then an up- or down-arrow indicating the sort - order will be placed into the column's label.  The shape of the - arrow depends on the respective sort order and on the value of the - -incrarrowtype - configuration option.  If the label's text is right-aligned then - the arrow will be displayed on the left side of the label, otherwise on - its right side.  If more than one sort arrows are to be displayed - then the first 9 sort ranks (1 for the first significant - element of columnIndexList, 2 for the - second one, and so on) will also be shown to the right of the - arrows.  After sorting the items, the vertical view is adjusted in - the same way as in the case of the sort subcommand.
- -
pathName - sortcolumn
- -
Returns the numerical index of the column by which the items were - last sorted with the aid of the sortbycolumn or sortbycolumnlist command, or - -1 if they were last sorted with the sort command or haven't been sorted at all, or - the sort information was reset by invoking resetsortinfo.  If called from - within the command specified as the value of the - -sortcommand widget or - column configuration option, then the - return value of this subcommand refers to the sorting in progress - rather than the most recent one.
- -
pathName - sortcolumnlist
- -
Returns a list consisting of the numerical indices of the columns - by which the items were last sorted with the aid of the - sortbycolumnlist or - sortbycolumn command - (in the second case the list will contain exactly one element), or an - empty string if they were last sorted with the sort command or haven't been sorted at all, or - the sort information was reset by invoking resetsortinfo.  If called from - within the command specified as the value of the - -sortcommand widget or - column configuration option, then the - return value of this subcommand refers to the sorting in progress - rather than the most recent one.
- -
pathName - sortorder
- -
Returns the sort order (as increasing or - decreasing) from the last sorting performed by the - sort, sortbycolumn, or sortbycolumnlist command, or an - empty string if the items haven't been sorted at all, or the sort - information was reset by invoking resetsortinfo.  If called from - within the command specified as the value of the - -sortcommand widget or - column configuration option, then the - return value of this subcommand refers to the sorting in progress - rather than the most recent one.
- -
pathName - sortorderlist
- -
Returns a list consisting of the sort orders (as - increasing or decreasing) from - the last invocation of the sortbycolumnlist or - sortbycolumn command - (in the second case the list will contain exactly one element), or an - empty string if the items were last sorted with the sort command or haven't been sorted at all, or - the sort information was reset by invoking resetsortinfo.  If called from - within the command specified as the value of the - -sortcommand widget or - column configuration option, then the - return value of this subcommand refers to the sorting in progress - rather than the most recent one.
- -
pathName - targetmarkpath
- -
Returns the path name of the drop target indicator (displayed as a - horizontal gap or vertical bar) belonging to the tablelist's body.
- -
pathName - targetmarkpos y - ?-any|-horizontal|-vertical?
- -
Given a y-coordinate within the tablelist window, this command - returns a two-element list containing the arguments to be passed to the - showtargetmark - subcommand in order to display the drop target indicator corresponding - to that y-coordinate.  The first list element will be the string - before or inside, and the - second one a numerical row index.  These list elements depend on - the relative position of y within the containing - row (if any), as well as on the optional second argument:  The - default option -any allows both - before and inside as first - element of the result list, while the options - -horizontal and -vertical - restrict the value of the first list element to - before and inside, - respectively.  If the option -vertical was - specified and no tablelist item contains the given y-position, then the - return value is the list  {inside -1}.  - The coordinate y is expected to be relative to the - tablelist window itself (not its body component).
- -
This command is designed to be used during a drag & - drop operation for which the tablelist widget (or its body component) - was registered as a drop target.  See the DRAG & DROP SUPPORT section for - details and examples.
- -
pathName - togglecolumnhide firstColumn lastColumn
- pathName togglecolumnhide - columnIndexList
- -
Toggles the value of the -hide option for one or more columns of the - tablelist widget.  In the first form of the command, - firstColumn and lastColumn are - indices specifying the first and last columns in the range whose - visibility is to be toggled.  The command's second form accepts a - list columnIndexList of indices specifying the - columns whose visibility is to be toggled.  Returns an empty - string.  After toggling the hidden state of the specified columns, - the <<TablelistColHiddenStateChanged>> - virtual event is generated.  For Tk versions 8.5 or higher, this - virtual event is generated with its -data option - set to a list consisting of the numerical column indices of the columns - whose -hide option was toggled.  The main - advantage of using this command instead of invoking columnconfigure for each of the - specified columns is that it causes only one redisplay of the widget's - contents, thus being significantly faster.
- -
pathName - togglerowhide first last
- pathName togglerowhide indexList
- -
Toggles the value of the -hide option for one or more rows of the - tablelist widget.  In the first form of the command, - first and last are indices - specifying the first and last rows in the range whose visibility is to - be toggled.  The command's second form accepts a list - indexList of indices specifying the rows whose - visibility is to be toggled.  Returns an empty string.  After - toggling the hidden state of the specified rows, the - <<TablelistRowHiddenStateChanged>> - virtual event is generated.  For Tk versions 8.5 or higher, this - virtual event is generated with its -data option - set to a list consisting of the numerical row indices of the rows whose - -hide option was toggled.  Just like the - -hide row configuration option, this subcommand is - not supported for Tk versions earlier than 8.3.
- -
CAUTION:  Tk versions 8.3 - 8.4.12 had a bug - that caused a segmentation fault if the whole content of a text widget - was elided.  This bug was also present in Tk 8.5.a1 - - 8.5.a3.  When using one of these earlier Tk versions, this bug - will produce a crash if all the rows of a tablelist widget are - hidden.  It is your responsibility to avoid such situations when - using a Tk version having this bug!
- -
pathName - toplevelkey index
- -
If the item identified by index is a top-level - one then the subcommand returns the full key of that item.  - Otherwise the return value is the full key of the unique top-level item - having the given item among its descendants.
- -
pathName - unsetattrib name
- -
Unsets the attribute name.  Returns an - empty string.
- -
pathName - unsetcellattrib cellIndex name
- -
Unsets the attribute name for the cell given by - cellIndex.  Returns an empty string.
- -
pathName - unsetcolumnattrib columnIndex name
- -
Unsets the attribute name for the column given - by columnIndex.  Returns an empty string.
- -
pathName - unsetrowattrib index name
- -
Unsets the attribute name for the row given by - index.  Returns an empty string.
- -
pathName - viewablerowcount ?first last?
- -
Returns the number of viewable rows in - the index range given by first and - last.  If these optional indices are not - specified then first defaults to 0 and - last defaults to one less the total number of - items, i.e., the index range comprises all rows.
- -
pathName windowpath - cellIndex
- -
Returns the path name of the window contained in the cell given by - cellIndex, created with the -window option of the cellconfigure subcommand.  If no - window is currently embedded into the cell then the return value is an - empty string.
- -
pathName xview - args
- -
This command is used to query and change the horizontal position of - the information in the widget's window.  It can take any of the - following forms:
- -
-
-
pathName xview
- -
Returns a list containing two elements.  Each element is a - real fraction between 0 and 1; together - they describe the horizontal span that is visible in the - window.  For example, if the first element is .2 - and the second element is .6, 20% of the tablelist's - scrollable text is off-screen to the left, the middle 40% is - visible in the window, and 40% of the scrollable text is off-screen - to the right.  These are the same values passed to scrollbars - via the -xscrollcommand option.
- -
pathName xview - units
- -
If the value of the -titlecolumns option is positive - then this command adjusts the view in the window so that the column - whose offset from the end of the title column area equals - units non-hidden columns is displayed next to - the title columns.  Otherwise the command adjusts the view in - the window so that the character position given by - units is displayed at the left edge of the - window.  Character positions are defined by the width of the - character 0.
- -
pathName xview moveto - fraction
- -
Adjusts the view in the window so that - fraction of the total width of the scrollable - tablelist text is off-screen to the left.  - fraction must be a fraction between - 0 and 1.
- -
pathName xview scroll - number what
- -
This command shifts the view in the window left or right - according to number and - whatnumber must be - an integer.  what must be either - units or pages or an - abbreviation of one of these.  If what is - units, the view adjusts left or right by - number non-hidden columns or character units - (the width of the 0 character) on the display, - depending on the value of the -titlecolumns option; if - what is pages then the view - adjusts by number screenfuls.  If - number is negative then columns or characters - farther to the left become visible; if it is positive then columns - or characters farther to the right become visible.
-
-
- -
pathName yview - args
- -
This command is used to query and change the vertical position of - the text in the window of the widget's body component.  It can - take any of the following forms:
- -
-
-
pathName yview
- -
Returns a list containing two elements, both of which are real - fractions between 0 and 1.  The - first element gives the position of the viewable tablelist item at the top of the window, - relative to the tablelist as a whole (0.5 means it is - halfway through the tablelist, for example).  The second - element gives the position of the viewable tablelist item just - after the last one in the window, relative to the tablelist as a - whole.  These are the same values passed to scrollbars via the - -yscrollcommand option.
- -
pathName yview - units
- -
Adjusts the view in the window so that the item whose offset - equals units viewable - rows is displayed at the top of the window.
- -
pathName yview moveto - fraction
- -
Adjusts the view in the window so that the viewable item given by - fraction appears at the top of the - window.  fraction is a fraction between - 0 and 1; 0 indicates the - first viewable item in the tablelist, 0.33 indicates - the viewable item one-third the way through the tablelist, and so - on.
- -
pathName yview scroll - number what
- -
This command shifts the view in the window up or down according - to number and what.  - number must be an integer.  - what must be either units - or pages or an abbreviation of one of - these.  If what is - units, the view adjusts up or down by - number viewable rows; - if it is pages then the view adjusts by - number screenfuls.  If - number is negative then earlier items become - visible; if it is positive then later items become visible.
-
-
-
-
- -
DEFAULT AND INDIVIDUAL BINDINGS FOR - THE TABLELIST BODY
- -
- The body component of a tablelist is implemented as a text widget whose - binding tag Text is replaced with a new binding tag - called TablelistBody.  The latter has all the - events of the Listbox widget class, and several of - its binding scripts are obtained from those of - Listbox by replacing the event fields - %W, %x, and - %y with the path name of the tablelist widget and the - x and y coordinates relative to the latter.  These values are - assigned to the help variables tablelist::W, - tablelist::x, and tablelist::y by - invoking the helper command tablelist::convEventFields - as follows: - -
-
-foreach {tablelist::W tablelist::x tablelist::y} \
-    [tablelist::convEventFields %W %x %y] {}
-
-
-
- -
This conversion of the event fields is necessary because the Tcl - command associated with a tablelist expects any coordinates relative to the - widget itself, not its body component.  It makes use of help variables - from the tablelist namespace in order to avoid any - conflicts with global variables.
- -
- Several of the events have no %x and - %y fields; in this case another helper command - tablelist::getTablelistPath - is used to set the help variable tablelist::W to the - path name of the tablelist widget: - -
-
-set tablelist::W [tablelist::getTablelistPath %W]
-
-
-
- -
The binding tag TablelistBody replaces the class - name (Frame or TSeparator) of the - separator widgets, too.  It also replaces the binding tag - Message of the message widgets used to display - multi-line elements, as well as the binding tag Label - of the label widgets used to display embedded images.  This makes sure - that the default handling of the mouse events on the column separators, - multi-line cells, and embedded images is the same as in the rest of the - tablelist's body.
- -
- When defining individual bindings for tablelist widgets, the same - conversion of the event fields is needed as for the default - bindings.  For example, the binding script below for the tablelist - widget .tbl prints the index of the cell where mouse button - 1 was clicked: - -
-
-bind [.tbl bodytag] <Button-1> {
-    foreach {tablelist::W tablelist::x tablelist::y} \
-        [tablelist::convEventFields %W %x %y] {}
-    puts "clicked on cell [.tbl containingcell $tablelist::x $tablelist::y]"
-}
-
-
-
- -
By associating the script with the binding tag returned by the - bodytag subcommand instead of - just with the path name of the tablelist's body we make sure to have the - same event handling for the separators, multi-line cells, and embedded - images as for the rest of the tablelist's body.
- -
- The following improved version of the binding script above uses a - procedure and thus eliminates the need for prefixing the converted - variables with "tablelist::": - -
-
-bind [.tbl bodytag] <Button-1> {printClickedCell %W %x %y}
-proc printClickedCell {w x y} { - foreach {tbl x y} [tablelist::convEventFields $w $x $y] {} - puts "clicked on cell [$tbl containingcell $x $y]" -} -
-
-
- -
The bindings associated with the binding tag - TablelistBody, created automatically by the - tablelist::tablelist command, ensure that the body - component of a tablelist has the same default behavior as a listbox - widget.  If the selection type is row (which is - the default) then everything described in the "DEFAULT BINDINGS" section of - the listbox manual entry applies to the body component of a - tablelist, too.  The only difference is that the word "element" in - that manual page has to be replaced with "item" when applying the - description to the body of a tablelist widget.
- -
If the selection type is cell then - everything described in the "DEFAULT BINDINGS" section of the - listbox manual entry applies to the body component of a tablelist, - too, with the following extensions and changes:
- -
-
    -
  1. If Tab or Shift-Tab is - pressed, the location cursor (active element) moves to the - next/previous element.  If the selection mode is - browse or extended then the new - active element is also selected and all other elements are - deselected.  In extended mode the new active - element becomes the selection anchor.  Notice that these bindings - replace the common inter-widget navigation via Tab and - Shift-Tab with inter-cell navigation.  Just like in - the case of the text widget, Control-Tab and - Control-Shift-Tab are intended to be used for - widget-to-widget keyboard navigation.  Unfortunately, this won't - always work because some window managers intercept the latter key - sequences and use them for their own purposes (like inter-workplace - navigation).  For this reason, Tablelist supports the additional - key sequences Meta-Tab and Meta-Shift-Tab as - replacements for Control-Tab and - Control-Shift-Tab, respectively.
  2. - -
  3. If the Left or Right key is - pressed, the location cursor (active element) moves to the - previous/next element of the active row.  If the selection mode is - browse or extended then the new - active element is also selected and all other elements are - deselected.  In extended mode the new active - element becomes the selection anchor.
  4. - -
  5. In extended mode, - Shift-Left and Shift-Right move the location - cursor (active element) to the previous/next element of the active row - and also extend the selection to that element in a fashion similar to - dragging with mouse button 1.
  6. - -
  7. If the Home or End key is - pressed, the location cursor (active element) moves to the first/last - element of the active row, the new active element is selected, and all - other elements are deselected.
  8. - -
  9. In extended mode, - Shift-Home and Shift-End extend the selection - to the first/last element of the active row.  In - multiple mode, Shift-Home and - Shift-End move the location cursor to the first/last - element of the active row.
  10. - -
  11. If the location cursor is in an editable cell then - Return and KP_Enter start the interactive - editing of the active element.
  12. -
-
- -
Just like in the case of the listbox widget, any changes to - the selection will automatically generate the virtual event - <<ListboxSelect>>.  Instead of this - event (which is supported for compatibility reasons), the virtual event - <<TablelistSelect>> can be used to be made - aware of any changes to tablelist selection.  Both events will be - generated independently of the selection type.
- -
- LOCAL DRAG & DROP:  The following binding associated with - the binding tag TablelistBody is only valid if the - selection mode is single or - multiple: - -
-

If mouse button 1 is clicked on an item and then dragged outside - that item, and the value of the -movablerows configuration option is - true, then the mouse cursor takes on the shape specified by the - -movecursor option, - indicating that the item in question is being moved to another - position.  The new item position (if any) is visualized with the - aid of a gap placed before the target row or a bar placed inside the - latter (depending on the current mouse position), indicating whether - the source item would be moved before this row or become a child of - it.  This local drag & drop operation ends when mouse - button 1 is released, and can be canceled by pressing the - Escape key.  In both cases, the mouse cursor is reset - to its original value, specified by the -cursor - configuration option.  After releasing mouse button 1 in the - presence of a valid target, the source item is moved before the target - row or just before the latter's first child, and the virtual event - <<TablelistRowMoved>> is - generated.  For Tk versions 8.5 or higher, this virtual event is - generated with its -data option set to a list of - length 3, whose elements are derived from the arguments passed to the - second form of the move - subcommand invoked for moving the source row to its new position.  - The first list element will be the full key corresponding to the first - argument, the second one will be root or the full - key corresponding to the second argument, and the third list element - will be identical to the third argument passed to the - move subcommand.

- -

Notice that, depending on the current mouse position during the - local drag & drop, there can be a corresponding potential target - row or not.  For instance, a tree item cannot become a sibling of - one of its descendants, and not all items might be allowed to have - children or to become top-level ones (example: in a file manager, - regular file items cannot be parents of other items and should not be - allowed to become top-level ones).  To decide whether the row - corresponding to the y-coordinate of the current mouse position - represents a valid potential target, the Tablelist code first checks - whether moving the source item before that row or making it a child of - the latter is allowed from the point of view of the general tree - structure.  If this is the case and the move operation would - change the source item's parent (and the Tk version is at least 8.3), - and the command specified as the value of the -acceptchildcommand configuration - option is a nonempty string, then this command is concatenated with the - name of the tablelist widget, the node index of the would-be new parent - node, and the row index of the dragged item, the resulting script is - evaluated in the global scope, and if the return value (which must be a - boolean) is false, then the source item will not be allowed to be moved - to the current mouse position.  Likewise, if the command specified - as the value of the -acceptdropcommand configuration - option is a nonempty string, then this command is concatenated with the - name of the tablelist widget, the row index of the would-be new target - row, and the row index of the dragged item, the resulting script is - evaluated in the global scope, and if the return value (which must be a - boolean) is false, then the source item will not be allowed to be moved - to the current mouse position.

- -

Recall that if the selection mode is multiple - then pressing mouse button 1 on a selected item or element - normally deselects that item or element (depending on the selection - type).  However, if in addition the value of the -movablerows configuration option is true - then the clicked row is a potential drag source for the local drag - & drop operation described above, and for this reason the clicked - item or element will only be deselected when releasing mouse - button 1 over the same item or element.

-
-
- -
DRAG SOURCE SUPPORT FOR GLOBAL - DRAG & DROP:  Besides the local drag & drop, the default - bindings also support the TkDND compiled extension and the drag & drop - framework included in BWidget, as well as custom drag & drop - implementations.  A tablelist widget is viewed as a drag source for - mouse button 1 if its body component was registered as such via - the  tkdnd::drag_source register  or the - Widget DragSite::register command, or the tablelist's - -customdragsource - option was set to true.  The default bindings provide drag source - support as described below:
- -
-
    -
  1. If the selection mode is extended - then pressing mouse button 1 on a selected item or element - normally deselects all the other items or elements (depending on the - selection type).  However, if the tablelist is a drag source for - mouse button 1, then the other items or elements will only be - deselected when releasing mouse button 1 over the clicked item - or element.  This is because the mouse click might be followed by - a drag, intended for all currently selected items or elements.
  2. - -
  3. Similarly, if the selection mode is - multiple then pressing mouse button 1 on a - selected item or element normally deselects that item or element - (depending on the selection type).  However, if the tablelist is a - drag source for mouse button 1, then the clicked item or element will - only be deselected when releasing mouse button 1 over the same - item or element.  Again, this is because the mouse click might be - followed by a drag, intended for all currently selected items or - elements.
  4. - -
  5. Whenever the mouse leaves the tablelist window with - button 1 down. the default bindings normally perform an automatic - scrolling, just like in the case of the Tk listbox widget.  - However, if the tablelist is a drag source for mouse button 1, then the - automatic scrolling will be suppressed, in order to avoid any conflicts - with the drag operation.
  6. -
-
- -
TREE WIDGET BINDINGS:  The following bindings - associated with the binding tag TablelistBody apply to - tablelists used as tree widgets:
- -
-
    -
  1. Pressing mouse button 1 over an expand/collapse control - toggles the expanded/collapsed state of the corresponding row.
  2. - -
  3. If the current active row contains an expand/collapse - control in collapsed state then the Right, - plus, and KP_Add keys expand the - corresponding row by invoking the non-recursive version of the - expand subcommand.
  4. - -
  5. If the current active row contains an expand/collapse - control in expanded state then the Left, - minus, and KP_Subtract keys collapse the - corresponding row by invoking the non-recursive version of the - collapse subcommand.
  6. -
-
- -
DEFAULT AND INDIVIDUAL BINDINGS FOR - THE HEADER LABELS
- -
The tablelist::tablelist command automatically - creates the following bindings for the header labels:
- -
-
    -
  1. If the mouse pointer is on the right edge of a header - label or within a few pixels of its right edge, and both the value of - the -resizablecolumns configuration - option and that of the -resizable option for the column - corresponding to that label are true, then the mouse cursor takes on - the shape specified by the -resizecursor option.  By clicking - mouse button 1 in this area and moving the mouse while its button 1 is - down, the column corresponding to that label will be resized by the - amount of the cursor motion.  The interactive column resizing ends - when mouse button 1 is released, and can be canceled by pressing the - Escape key.  In both cases, the mouse cursor is reset - to its original value, specified by the -cursor - configuration option.  When the column resize operation is - finished, the virtual event - <<TablelistColumnResized>> is - generated, with its -data option set to the - numerical column index for Tk versions 8.5 or higher.
  2. - -
  3. If mouse button 1 is pressed over a header label but - outside the resize area described above and then dragged outside the - label, and the value of the -movablecolumns configuration option - is true, then the mouse cursor takes on the shape specified by the - -movecolumncursor - option, indicating that the column in question is being moved to - another position, visualized with the aid of a gap placed before the - label of the target column.  This operation ends when mouse button - 1 is released, and can be canceled by pressing the Escape - key when the mouse pointer is outside the label.  In both cases, - the mouse cursor is reset to its original value, specified by the - -cursor configuration option.  After releasing - mouse button 1, the source column is moved before the one indicated by - the gap mentioned above and the virtual event - <<TablelistColumnMoved>> is - generated.  For Tk versions 8.5 or higher, this virtual event is - generated with its -data option set to a list of - length 4, whose first two elements are identical to the two numerical - column indices passed to the movecolumn subcommand invoked for moving - the source column to its new position, and the last two elements are - the corresponding column names, retrieved with the aid of the  - columncget ... - -name  subcommand.
  4. - -
  5. If mouse button 1 is pressed over a header label but - outside the resize area described above and later released over the - same label, and the command specified by the -labelcommand option is a nonempty - string, then this command is concatenated with the name of the - tablelist widget and the column index of the respective label, and the - resulting script is evaluated in the global scope.  If another - nonempty label command was specified at column level by using the - columnconfigure - option of the Tcl command associated with the tablelist widget, then - that column-specific command will be used instead of the global - one.  If mouse button 1 was pressed together with the - Shift key then the widget- or column-specific command - mentioned above will be replaced with the one specified by the - -labelcommand2 option - at widget or column level.
  6. - -
  7. The Tablelist package defines the virtual - event <<Button3>> as - <Button-3> for all windowing systems and - additionally as <Control-Button-1> for Mac OS - Classic and Mac OS X Aqua.  If this event occurs over a header - label and both the value of the -resizablecolumns configuration - option and that of the -resizable option for the column - corresponding to that label are true, then the width of that column is - set to zero, i.e., it is made just large enough to hold all the - elements in the column, including the header (but no larger than the - maximum width indicated by the -maxwidth column configuration option), - and the virtual event - <<TablelistColumnResized>> is - generated, with its -data option set to the - numerical column index for Tk versions 8.5 or higher.  The same - action is triggered by double-clicking the resize area of a header - label.
  8. - -
  9. The Tablelist package defines the virtual event - <<ShiftButton3>> as - <Shift-Button-3> for all windowing systems - and additionally as <Shift-Control-Button-1> - for Mac OS Classic and Mac OS X Aqua.  If this event occurs over a - header label and both the value of the -resizablecolumns configuration - option and that of the -resizable option for the column - corresponding to that label are true, then the width of that column is - set to its last static width (if any) and the virtual event - <<TablelistColumnResized>> is - generated, with its -data option set to the - numerical column index for Tk versions 8.5 or higher.  The same - action is triggered by double-clicking the resize area of a header - label with the Shift key held down.
  10. -
-
- -
If the tablelist's state is disabled then none of - the above actions occur: the labels are completely insensitive.
- -
- If you want to define non-default bindings for the header labels, it is - recommended to associate them with the binding tag whose name is returned - by the labeltag subcommand - and make use of the helper commands tablelist::getTablelistColumn - and tablelist::getTablelistPath.  - For example, to replace the default binding for - <Button-3> with a script that performs a - column-dependent action, you can proceed like in the code shown below: - -
-
-bind [.tbl labeltag] <Button-3> {
-    puts "right-clicked on header label no. [tablelist::getTablelistColumn %W]"
-    break
-}
-
-
-
- -
DEFAULT BINDINGS FOR INTERACTIVE CELL - EDITING
- -
The tablelist::tablelist command extends and - partially redefines the bindings of some of the components of the temporary - embedded widget used for interactive cell editing, which is started by - pressing mouse button 1 in an editable cell (see the -editselectedonly option for details) or - using keyboard navigation to move from one editable cell into - another.  If the selection type is cell and the - location cursor is in an editable cell, then the interactive editing of the - active element can also be started by pressing Return or - KP_Enter.
- -
The affected components of the temporary embedded widget - depend on the edit window: the widget itself in case of a Tk or tile - checkbutton or menubutton; the edit window's entry children in case of a - mentry widget; the only entry or entry-like component of the edit window in - all other cases (see also the entrypath subcommand).  The list of - binding tags of these edit window components contains two addditional tags, - inserted just before their path names: the binding tag whose name is - returned by the editwintag - subcommand, followed by the tag TablelistEdit.  - The bindings described below are associated with the tag - TablelistEdit, and can be overridden for individual - tablelist widgets by making use of the binding tag given by the - editwintag subcommand.
- -
-
    -
  1. Control-i inserts a tabulator character - into the edit window's entry or entry-like components (if any), at the - point of the insertion cursor.
  2. - -
  3. Control-j inserts a newline character into - the edit window's entry or entry-like components (if any), at the point - of the insertion cursor.
  4. - -
  5. If the edit window is a text or ctext widget then - Return and KP_Enter insert a newline - character at the point of the insertion cursor.  Otherwise they - terminate the editing and destroy the edit window.
  6. - -
  7. Control-Return and - Control-KP_Enter terminate the editing and destroy the - edit window.
  8. - -
  9. Escape aborts the editing and destroys the - edit window.
  10. - -
  11. A click with the left mouse button anywhere in the - tablelist's body, outside the cell just being edited, terminates the - editing in the current cell and destroys the edit window or moves it - into the cell that was just clicked into if the latter is - editable.
  12. - -
  13. When editing a cell that is not the only editable cell - of the tablelist widget, Tab and Shift-Tab - terminate the editing in the current cell, move the edit window into - the next/previous editable cell of the tablelist, select the contents - of the edit window's first entry or entry-like component (if any), and - set the insertion cursor to its end.  If the new edit window is a - text or ctext widget then its contents are left unselected.  - Notice that these bindings replace the common inter-widget navigation - via Tab and Shift-Tab with inter-cell - navigation.  Just like in the case of the text widget, - Control-Tab and Control-Shift-Tab are - intended to be used for widget-to-widget keyboard navigation during - interactive cell editing.  Unfortunately, this won't always work - because some window managers intercept the latter key sequences and use - them for their own purposes (like inter-workplace navigation).  - For this reason, Tablelist supports the additional key sequences - Meta-Tab and Meta-Shift-Tab as replacements - for Control-Tab and Control-Shift-Tab, - respectively.
  14. - -
  15. When editing a cell that is not the first/last editable - cell within its row, Alt-Left/Alt-Right - (Command-Left/Command-Right on Mac OS Classic - and Mac OS X Aqua) terminates the editing in the current cell, moves - the edit window into the previous/next editable cell of the row, - selects the contents of the edit window's first entry or entry-like - component (if any), and sets the insertion cursor to its end.  If - the new edit window is a text or ctext widget then its contents are - left unselected.  The key sequence - Meta-Left/Meta-Right has the same effect as - Alt-Left/Alt-Right.  If - tk_strictMotif is false and the edit window is not - a text or ctext widget then Meta-b and Meta-f - behave the same as Alt-Left and Alt-Right, - respectively.  If the edit window is a Tk or tile checkbutton or - menubutton widget then Left/Right has the - same effect as Alt-Left/Alt-Right.
  16. - -
  17. When editing a cell that is not the first/last editable - cell within its column, Alt-Up/Alt-Down - (Command-Up/Command-Down on Mac OS Classic - and Mac OS X Aqua) terminates the editing in the current cell, moves - the edit window one line up/down within the column, selects the - contents of the edit window's first entry or entry-like component (if - any), and sets the insertion cursor to its end.  If the new edit - window is a text or ctext widget then its contents are left - unselected.  The key sequence - Meta-Up/Meta-Down has the same effect as - Alt-Up/Alt-Down.  If - tk_strictMotif is false and the edit window is not - a text or ctext widget or an Iwidgets combobox, then - Control-p and Control-n behave the same as - Alt-Up and Alt-Down, respectively.  If - the edit window is a Tk or tile entry, Tk or tile checkbutton, Tk or - tile menubutton, BWidget Entry, Iwidgets entryfield/spinner/spinint, or - a mentry widget of type "FixedPoint", then - Up/Down has the same effect as - Alt-Up/Alt-Down.
  18. - -
  19. When editing a cell that is not the first/last editable - cell within its column, Alt-Prior/Alt-Next - (Command-Prior/Command-Next on Mac OS Classic - and Mac OS X Aqua) terminates the editing in the current cell, moves - the edit window up/down by one page within the column, selects the - contents of the edit window's first entry or entry-like component (if - any), and sets the insertion cursor to its end.  If the new edit - window is a text or ctext widget then its contents are left - unselected.  The key sequence - Meta-Prior/Meta-Next has the same effect as - Alt-Prior/Alt-Next.  If the edit window - is not a text or ctext widget, BWidget SpinBox, Oakley combobox, or a - mentry widget of type "Date", "Time", - "DateTime", "IPAddr", or - "IPv6Addr", then Prior/Next has - the same effect as Alt-Prior/Alt-Next.
  20. - -
  21. When editing a cell that is not the only editable cell - of the tablelist widget, Alt-Home/Alt-End - (Command-Home/Command-End on Mac OS Classic - and Mac OS X Aqua) terminates the editing in the current cell, moves - the edit window into the first/last editable cell of the tablelist, - selects the contents of the edit window's first entry or entry-like - component (if any), and sets the insertion cursor to its end.  If - the new edit window is a text or ctext widget then its contents are - left unselected.  The key sequence - Meta-Home/Meta-End has the same effect as - Alt-Home/Alt-End.  If - tk_strictMotif is false and the edit window is not - a text or ctext widget then Meta-< and - Meta-> behave the same as Alt-Home and - Alt-End, respectively.  If the edit window is not a - text or ctext widget then - Control-Home/Control-End has the same effect - as Alt-Home/Alt-End.
  22. -
-
- -
Before moving the edit window, the key sequences mentioned - under 7 - 11 move the active item or element and change the (cell)selection - and the (cell)selection anchor in the body of the tablelist widget.  - For example, if Alt-Up/Alt-Down or - Meta-Up/Meta-Down - (Command-Up/Command-Down on Mac OS Classic and - Mac OS X Aqua) is pressed when editing a cell that is not the first/last - editable cell within its column, then the active item or element (depending - on the selection type) moves one line up/down.  If the selection mode - is browse or extended then the new - active item or element is also selected and all other items or elements are - deselected.  In extended mode the new active item - or element becomes the (cell)selection anchor.  This is exactly the - same behavior as the one exhibited by the Up and - Down keys in the tablelist's body.
- -
If the tablelist's state is disabled then none of - the above actions occur.
- -
KEYWORDS
- -
tablelist, multi-column, listbox, tree, widget
-
- -
-

Contents     Start page

-
- - DELETED tablelist5.13/doc/tileWidgets.png Index: tablelist5.13/doc/tileWidgets.png ================================================================== --- tablelist5.13/doc/tileWidgets.png +++ tablelist5.13/doc/tileWidgets.png cannot compute difference between binary files DELETED tablelist5.13/doc/ubuntu.png Index: tablelist5.13/doc/ubuntu.png ================================================================== --- tablelist5.13/doc/ubuntu.png +++ tablelist5.13/doc/ubuntu.png cannot compute difference between binary files DELETED tablelist5.13/doc/vistaAero.png Index: tablelist5.13/doc/vistaAero.png ================================================================== --- tablelist5.13/doc/vistaAero.png +++ tablelist5.13/doc/vistaAero.png cannot compute difference between binary files DELETED tablelist5.13/doc/vistaClassic.png Index: tablelist5.13/doc/vistaClassic.png ================================================================== --- tablelist5.13/doc/vistaClassic.png +++ tablelist5.13/doc/vistaClassic.png cannot compute difference between binary files DELETED tablelist5.13/doc/win7Aero.png Index: tablelist5.13/doc/win7Aero.png ================================================================== --- tablelist5.13/doc/win7Aero.png +++ tablelist5.13/doc/win7Aero.png cannot compute difference between binary files DELETED tablelist5.13/doc/win7Classic.png Index: tablelist5.13/doc/win7Classic.png ================================================================== --- tablelist5.13/doc/win7Classic.png +++ tablelist5.13/doc/win7Classic.png cannot compute difference between binary files DELETED tablelist5.13/doc/winnative.png Index: tablelist5.13/doc/winnative.png ================================================================== --- tablelist5.13/doc/winnative.png +++ tablelist5.13/doc/winnative.png cannot compute difference between binary files DELETED tablelist5.13/doc/winxpBlue.png Index: tablelist5.13/doc/winxpBlue.png ================================================================== --- tablelist5.13/doc/winxpBlue.png +++ tablelist5.13/doc/winxpBlue.png cannot compute difference between binary files DELETED tablelist5.13/doc/winxpOlive.png Index: tablelist5.13/doc/winxpOlive.png ================================================================== --- tablelist5.13/doc/winxpOlive.png +++ tablelist5.13/doc/winxpOlive.png cannot compute difference between binary files DELETED tablelist5.13/doc/winxpSilver.png Index: tablelist5.13/doc/winxpSilver.png ================================================================== --- tablelist5.13/doc/winxpSilver.png +++ tablelist5.13/doc/winxpSilver.png cannot compute difference between binary files DELETED tablelist5.13/pkgIndex.tcl Index: tablelist5.13/pkgIndex.tcl ================================================================== --- tablelist5.13/pkgIndex.tcl +++ tablelist5.13/pkgIndex.tcl @@ -1,28 +0,0 @@ -#============================================================================== -# Tablelist and Tablelist_tile package index file. -# -# Copyright (c) 2000-2015 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) -#============================================================================== - -# -# Regular packages: -# -package ifneeded tablelist 5.13 \ - [list source [file join $dir tablelist.tcl]] -package ifneeded tablelist_tile 5.13 \ - [list source [file join $dir tablelist_tile.tcl]] - -# -# Aliases: -# -package ifneeded Tablelist 5.13 \ - [list package require -exact tablelist 5.13] -package ifneeded Tablelist_tile 5.13 \ - [list package require -exact tablelist_tile 5.13] - -# -# Code common to all packages: -# -package ifneeded tablelist::common 5.13 \ - "namespace eval ::tablelist { proc DIR {} {return [list $dir]} } ;\ - source [list [file join $dir tablelistPublic.tcl]]" DELETED tablelist5.13/scripts/mwutil.tcl Index: tablelist5.13/scripts/mwutil.tcl ================================================================== --- tablelist5.13/scripts/mwutil.tcl +++ tablelist5.13/scripts/mwutil.tcl @@ -1,513 +0,0 @@ -#============================================================================== -# Contains utility procedures for mega-widgets. -# -# Structure of the module: -# - Namespace initialization -# - Public utility procedures -# -# Copyright (c) 2000-2015 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) -#============================================================================== - -package require Tcl 8 -package require Tk 8 - -# -# Namespace initialization -# ======================== -# - -namespace eval mwutil { - # - # Public variables: - # - variable version 2.8 - variable library [file dirname [info script]] - - # - # Public procedures: - # - namespace export wrongNumArgs getAncestorByClass convEventFields \ - defineKeyNav processTraversal focusNext focusPrev \ - configureWidget fullConfigOpt fullOpt enumOpts \ - configureSubCmd attribSubCmd hasattribSubCmd \ - unsetattribSubCmd getScrollInfo - - # - # Make modified versions of the procedures tk_focusNext and - # tk_focusPrev, to be invoked in the processTraversal command - # - proc makeFocusProcs {} { - # - # Enforce the evaluation of the Tk library file "focus.tcl" - # - tk_focusNext . - - # - # Build the procedures focusNext and focusPrev - # - foreach direction {Next Prev} { - set procBody [info body tk_focus$direction] - regsub -all {winfo children} $procBody {getChildren $class} procBody - proc focus$direction {w class} $procBody - } - } - makeFocusProcs - - # - # Invoked in the procedures focusNext and focusPrev defined above: - # - proc getChildren {class w} { - if {[string compare [winfo class $w] $class] == 0} { - return {} - } else { - return [winfo children $w] - } - } -} - -# -# Public utility procedures -# ========================= -# - -#------------------------------------------------------------------------------ -# mwutil::wrongNumArgs -# -# Generates a "wrong # args" error message. -#------------------------------------------------------------------------------ -proc mwutil::wrongNumArgs args { - set optList {} - foreach arg $args { - lappend optList \"$arg\" - } - return -code error "wrong # args: should be [enumOpts $optList]" -} - -#------------------------------------------------------------------------------ -# mwutil::getAncestorByClass -# -# Gets the path name of the widget of the specified class from the path name w -# of one of its descendants. It is assumed that all of the ancestors of w -# exist (but w itself needn't exist). -#------------------------------------------------------------------------------ -proc mwutil::getAncestorByClass {w class} { - regexp {^(\..+)\..+$} $w dummy win - while {[string compare [winfo class $win] $class] != 0} { - set win [winfo parent $win] - } - - return $win -} - -#------------------------------------------------------------------------------ -# mwutil::convEventFields -# -# Gets the path name of the widget of the specified class and the x and y -# coordinates relative to the latter from the path name w of one of its -# descendants and from the x and y coordinates relative to the latter. -#------------------------------------------------------------------------------ -proc mwutil::convEventFields {w x y class} { - set win [getAncestorByClass $w $class] - set _x [expr {$x + [winfo rootx $w] - [winfo rootx $win]}] - set _y [expr {$y + [winfo rooty $w] - [winfo rooty $win]}] - - return [list $win $_x $_y] -} - -#------------------------------------------------------------------------------ -# mwutil::defineKeyNav -# -# For a given mega-widget class, the procedure defines the binding tag -# ${class}KeyNav as a partial replacement for "all", by substituting the -# scripts bound to the events , , and <> with new -# ones which propagate these events to the mega-widget of the given class -# containing the widget to which the event was reported. (The event -# was replaced with <> in Tk 8.3.0.) This tag is -# designed to be inserted before "all" in the list of binding tags of a -# descendant of a mega-widget of the specified class. -#------------------------------------------------------------------------------ -proc mwutil::defineKeyNav class { - foreach event { <>} { - bind ${class}KeyNav $event \ - [list mwutil::processTraversal %W $class $event] - } - - bind Entry <> { %W selection range 0 end; %W icursor end } - bind Spinbox <> { %W selection range 0 end; %W icursor end } -} - -#------------------------------------------------------------------------------ -# mwutil::processTraversal -# -# Processes the given traversal event for the mega-widget of the specified -# class containing the widget w if that mega-widget is not the only widget -# receiving the focus during keyboard traversal within its top-level widget. -#------------------------------------------------------------------------------ -proc mwutil::processTraversal {w class event} { - set win [getAncestorByClass $w $class] - - if {[string compare $event ""] == 0} { - set target [focusNext $win $class] - } else { - set target [focusPrev $win $class] - } - - if {[string compare $target $win] != 0} { - set focus [focus] - if {[string length $focus] != 0} { - event generate $focus <> - } - - focus $target - event generate $target <> - } - - return -code break "" -} - -#------------------------------------------------------------------------------ -# mwutil::configureWidget -# -# Configures the widget win by processing the command-line arguments specified -# in optValPairs and, if the value of initialize is true, also those database -# options that don't match any command-line arguments. -#------------------------------------------------------------------------------ -proc mwutil::configureWidget {win configSpecsName configCmd cgetCmd \ - optValPairs initialize} { - upvar $configSpecsName configSpecs - - # - # Process the command-line arguments - # - set cmdLineOpts {} - set savedVals {} - set failed 0 - set count [llength $optValPairs] - foreach {opt val} $optValPairs { - if {[catch {fullConfigOpt $opt configSpecs} result] != 0} { - set failed 1 - break - } - if {$count == 1} { - set result "value for \"$opt\" missing" - set failed 1 - break - } - set opt $result - lappend cmdLineOpts $opt - lappend savedVals [eval $cgetCmd [list $win $opt]] - if {[catch {eval $configCmd [list $win $opt $val]} result] != 0} { - set failed 1 - break - } - incr count -2 - } - - if {$failed} { - # - # Restore the saved values - # - foreach opt $cmdLineOpts val $savedVals { - eval $configCmd [list $win $opt $val] - } - - return -code error $result - } - - if {$initialize} { - # - # Process those configuration options that were not - # given as command-line arguments; use the corresponding - # values from the option database if available - # - foreach opt [lsort [array names configSpecs]] { - if {[llength $configSpecs($opt)] == 1 || - [lsearch -exact $cmdLineOpts $opt] >= 0} { - continue - } - set dbName [lindex $configSpecs($opt) 0] - set dbClass [lindex $configSpecs($opt) 1] - set dbValue [option get $win $dbName $dbClass] - if {[string length $dbValue] == 0} { - set default [lindex $configSpecs($opt) 3] - eval $configCmd [list $win $opt $default] - } else { - if {[catch { - eval $configCmd [list $win $opt $dbValue] - } result] != 0} { - return -code error $result - } - } - } - } - - return "" -} - -#------------------------------------------------------------------------------ -# mwutil::fullConfigOpt -# -# Returns the full configuration option corresponding to the possibly -# abbreviated option opt. -#------------------------------------------------------------------------------ -proc mwutil::fullConfigOpt {opt configSpecsName} { - upvar $configSpecsName configSpecs - - if {[info exists configSpecs($opt)]} { - if {[llength $configSpecs($opt)] == 1} { - return $configSpecs($opt) - } else { - return $opt - } - } - - set optList [lsort [array names configSpecs]] - set count 0 - foreach elem $optList { - if {[string first $opt $elem] == 0} { - incr count - if {$count == 1} { - set option $elem - } else { - break - } - } - } - - if {$count == 1} { - if {[llength $configSpecs($option)] == 1} { - return $configSpecs($option) - } else { - return $option - } - } elseif {$count == 0} { - ### return -code error "unknown option \"$opt\"" - return -code error \ - "bad option \"$opt\": must be [enumOpts $optList]" - } else { - ### return -code error "unknown option \"$opt\"" - return -code error \ - "ambiguous option \"$opt\": must be [enumOpts $optList]" - } -} - -#------------------------------------------------------------------------------ -# mwutil::fullOpt -# -# Returns the full option corresponding to the possibly abbreviated option opt. -#------------------------------------------------------------------------------ -proc mwutil::fullOpt {kind opt optList} { - if {[lsearch -exact $optList $opt] >= 0} { - return $opt - } - - set count 0 - foreach elem $optList { - if {[string first $opt $elem] == 0} { - incr count - if {$count == 1} { - set option $elem - } else { - break - } - } - } - - if {$count == 1} { - return $option - } elseif {$count == 0} { - return -code error \ - "bad $kind \"$opt\": must be [enumOpts $optList]" - } else { - return -code error \ - "ambiguous $kind \"$opt\": must be [enumOpts $optList]" - } -} - -#------------------------------------------------------------------------------ -# mwutil::enumOpts -# -# Returns a string consisting of the elements of the given list, separated by -# commas and spaces. -#------------------------------------------------------------------------------ -proc mwutil::enumOpts optList { - set optCount [llength $optList] - set n 1 - foreach opt $optList { - if {$n == 1} { - set str $opt - } elseif {$n < $optCount} { - append str ", $opt" - } else { - if {$optCount > 2} { - append str "," - } - append str " or $opt" - } - - incr n - } - - return $str -} - -#------------------------------------------------------------------------------ -# mwutil::configureSubCmd -# -# This procedure is invoked to process configuration subcommands. -#------------------------------------------------------------------------------ -proc mwutil::configureSubCmd {win configSpecsName configCmd cgetCmd argList} { - upvar $configSpecsName configSpecs - - set argCount [llength $argList] - if {$argCount > 1} { - # - # Set the specified configuration options to the given values - # - return [configureWidget $win configSpecs $configCmd $cgetCmd $argList 0] - } elseif {$argCount == 1} { - # - # Return the description of the specified configuration option - # - set opt [fullConfigOpt [lindex $argList 0] configSpecs] - set dbName [lindex $configSpecs($opt) 0] - set dbClass [lindex $configSpecs($opt) 1] - set default [lindex $configSpecs($opt) 3] - return [list $opt $dbName $dbClass $default \ - [eval $cgetCmd [list $win $opt]]] - } else { - # - # Return a list describing all available configuration options - # - foreach opt [lsort [array names configSpecs]] { - if {[llength $configSpecs($opt)] == 1} { - set alias $configSpecs($opt) - if {$::tk_version >= 8.1} { - lappend result [list $opt $alias] - } else { - set dbName [lindex $configSpecs($alias) 0] - lappend result [list $opt $dbName] - } - } else { - set dbName [lindex $configSpecs($opt) 0] - set dbClass [lindex $configSpecs($opt) 1] - set default [lindex $configSpecs($opt) 3] - lappend result [list $opt $dbName $dbClass $default \ - [eval $cgetCmd [list $win $opt]]] - } - } - return $result - } -} - -#------------------------------------------------------------------------------ -# mwutil::attribSubCmd -# -# This procedure is invoked to process *attrib subcommands. -#------------------------------------------------------------------------------ -proc mwutil::attribSubCmd {win prefix argList} { - set classNs [string tolower [winfo class $win]] - upvar ::${classNs}::ns${win}::attribs attribs - - set argCount [llength $argList] - if {$argCount > 1} { - # - # Set the specified attributes to the given values - # - if {$argCount % 2 != 0} { - return -code error "value for \"[lindex $argList end]\" missing" - } - foreach {attr val} $argList { - set attribs($prefix-$attr) $val - } - return "" - } elseif {$argCount == 1} { - # - # Return the value of the specified attribute - # - set attr [lindex $argList 0] - set name $prefix-$attr - if {[info exists attribs($name)]} { - return $attribs($name) - } else { - return "" - } - } else { - # - # Return the current list of attribute names and values - # - set len [string length "$prefix-"] - set result {} - foreach name [lsort [array names attribs "$prefix-*"]] { - set attr [string range $name $len end] - lappend result [list $attr $attribs($name)] - } - return $result - } -} - -#------------------------------------------------------------------------------ -# mwutil::hasattribSubCmd -# -# This procedure is invoked to process has*attrib subcommands. -#------------------------------------------------------------------------------ -proc mwutil::hasattribSubCmd {win prefix attr} { - set classNs [string tolower [winfo class $win]] - upvar ::${classNs}::ns${win}::attribs attribs - - return [info exists attribs($prefix-$attr)] -} - -#------------------------------------------------------------------------------ -# mwutil::unsetattribSubCmd -# -# This procedure is invoked to process unset*attrib subcommands. -#------------------------------------------------------------------------------ -proc mwutil::unsetattribSubCmd {win prefix attr} { - set classNs [string tolower [winfo class $win]] - upvar ::${classNs}::ns${win}::attribs attribs - - set name $prefix-$attr - if {[info exists attribs($name)]} { - unset attribs($name) - } - - return "" -} - -#------------------------------------------------------------------------------ -# mwutil::getScrollInfo -# -# Parses a list of arguments of the form "moveto " or "scroll -# units|pages" and returns the corresponding list consisting of two or -# three properly formatted elements. -#------------------------------------------------------------------------------ -proc mwutil::getScrollInfo argList { - set argCount [llength $argList] - set opt [lindex $argList 0] - - if {[string first $opt "moveto"] == 0} { - if {$argCount != 2} { - wrongNumArgs "moveto fraction" - } - - set fraction [format "%f" [lindex $argList 1]] - return [list moveto $fraction] - } elseif {[string first $opt "scroll"] == 0} { - if {$argCount != 3} { - wrongNumArgs "scroll number units|pages" - } - - set number [format "%d" [lindex $argList 1]] - set what [lindex $argList 2] - if {[string first $what "units"] == 0} { - return [list scroll $number units] - } elseif {[string first $what "pages"] == 0} { - return [list scroll $number pages] - } else { - return -code error "bad argument \"$what\": must be units or pages" - } - } else { - return -code error "unknown option \"$opt\": must be moveto or scroll" - } -} DELETED tablelist5.13/scripts/pencil.cur Index: tablelist5.13/scripts/pencil.cur ================================================================== --- tablelist5.13/scripts/pencil.cur +++ tablelist5.13/scripts/pencil.cur cannot compute difference between binary files DELETED tablelist5.13/scripts/repair.tcl Index: tablelist5.13/scripts/repair.tcl ================================================================== --- tablelist5.13/scripts/repair.tcl +++ tablelist5.13/scripts/repair.tcl @@ -1,84 +0,0 @@ -#!/usr/bin/env wish - -#============================================================================== -# Creates new versions of the files "tablelistWidget.tcl", "tablelistBind.tcl", -# "tablelistConfig.tcl", "tablelistEdit.tcl", "tablelistMove.tcl", -# "tablelistSort.tcl", and "tablelistUtil.tcl" by defining the procedure -# "arrElemExists" and replacing all invocations of "[info exists -# ()]" with "[arrElemExists ]". This works around a -# bug in Tcl versions 8.2, 8.3.0 - 8.3.2, and 8.4a1 (fixed in Tcl 8.3.3 and -# 8.4a2), which causes excessive memory use when calling "info exists" on -# non-existent array elements. -# -# Copyright (c) 2001-2015 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) -#============================================================================== - -set procDef { - # - # The following procedure returns 1 if arrName($name) exists and - # 0 otherwise. It is a (partial) replacement for [info exists - # arrName($name)], which -- due to a bug in Tcl versions 8.2, - # 8.3.0 - 8.3.2, and 8.4a1 (fixed in Tcl 8.3.3 and 8.4a2) -- - # causes excessive memory use if arrName($name) doesn't exist. - # The first version of the procedure assumes that the second - # argument doesn't contain glob-style special characters. - # - if {[regexp {^8\.(2\.[0-3]|3\.[0-2]|4a1)$} $tk_patchLevel]} { - proc arrElemExists {arrName name} { - upvar $arrName arr - return [llength [array names arr $name]] - } - } else { - proc arrElemExists {arrName name} { - upvar $arrName arr - return [info exists arr($name)] ;# this is much faster - } - } -} - -file copy tablelistWidget.tcl tablelistWidget.tcl.BAK - -set fi [open tablelistWidget.tcl.BAK r] -set fo [open tablelistWidget.tcl w] - -for {set n 1} {[gets $fi line] >= 0} {incr n} { - if {$n == 19} { - puts -nonewline $fo $line - puts $fo $procDef - } else { - regsub -all {\[info exists (tablelist::[^\(]+)\(([^\]]+)\)\]} $line \ - {[tablelist::arrElemExists \1 \2]} line - regsub -all {\[info exists ([^\(]+)\(([^\]]+)\)\]} $line \ - {[arrElemExists \1 \2]} line - puts $fo $line - } -} - -close $fi -close $fo - -puts "\nMade backup copy \"tablelistWidget.tcl.BAK\"." -puts "Created new version of the file \"tablelistWidget.tcl\"." - -foreach file {tablelistBind.tcl tablelistConfig.tcl tablelistEdit.tcl - tablelistMove.tcl tablelistSort.tcl tablelistThemes.tcl - tablelistUtil.tcl} { - file copy $file $file.BAK - - set fi [open $file.BAK r] - set fo [open $file w] - - while {[gets $fi line] >= 0} { - regsub -all {\[info exists (tablelist::[^\(]+)\(([^\]]+)\)\]} $line \ - {[tablelist::arrElemExists \1 \2]} line - regsub -all {\[info exists ([^\(]+)\(([^\]]+)\)\]} $line \ - {[arrElemExists \1 \2]} line - puts $fo $line - } - - close $fi - close $fo - - puts "\nMade backup copy \"$file.BAK\"." - puts "Created new version of the file \"$file\"." -} DELETED tablelist5.13/scripts/tablelistBind.tcl Index: tablelist5.13/scripts/tablelistBind.tcl ================================================================== --- tablelist5.13/scripts/tablelistBind.tcl +++ tablelist5.13/scripts/tablelistBind.tcl @@ -1,3381 +0,0 @@ -#============================================================================== -# Contains public and private procedures used in tablelist bindings. -# -# Structure of the module: -# - Public helper procedures -# - Binding tag Tablelist -# - Binding tag TablelistWindow -# - Binding tag TablelistBody -# - Binding tags TablelistLabel, TablelistSubLabel, and TablelistArrow -# -# Copyright (c) 2000-2015 Csaba Nemethi (E-mail: csaba.nemethi@t-online.de) -#============================================================================== - -# -# Public helper procedures -# ======================== -# - -#------------------------------------------------------------------------------ -# tablelist::getTablelistColumn -# -# Gets the column number from the path name w of a (sub)label or sort arrow of -# a tablelist widget. -#------------------------------------------------------------------------------ -proc tablelist::getTablelistColumn w { - if {[regexp {^(\..+)\.hdr\.t\.f\.l([0-9]+)(-[it]l)?$} $w dummy win col] || - [regexp {^(\..+)\.hdr\.t\.f\.c([0-9]+)$} $w dummy win col]} { - return $col - } else { - return -1 - } -} - -#------------------------------------------------------------------------------ -# tablelist::getTablelistPath -# -# Gets the path name of the tablelist widget from the path name w of one of its -# descendants. It is assumed that all of the ancestors of w exist (but w -# itself needn't exist). -#------------------------------------------------------------------------------ -proc tablelist::getTablelistPath w { - return [mwutil::getAncestorByClass $w Tablelist] -} - -#------------------------------------------------------------------------------ -# tablelist::convEventFields -# -# Gets the path name of the tablelist widget and the x and y coordinates -# relative to the latter from the path name w of one of its descendants and -# from the x and y coordinates relative to the latter. -#------------------------------------------------------------------------------ -proc tablelist::convEventFields {w x y} { - return [mwutil::convEventFields $w $x $y Tablelist] -} - -# -# Binding tag Tablelist -# ===================== -# - -#------------------------------------------------------------------------------ -# tablelist::addActiveTag -# -# This procedure is invoked when the tablelist widget win gains the keyboard -# focus. It moves the "active" tag to the line or cell that displays the -# active item or element of the widget in its body text child. -#------------------------------------------------------------------------------ -proc tablelist::addActiveTag win { - upvar ::tablelist::ns${win}::data data - set data(ownsFocus) 1 - - # - # Conditionally move the "active" tag to the line - # or cell that displays the active item or element - # - if {![info exists data(dispId)]} { - moveActiveTag $win - } -} - -#------------------------------------------------------------------------------ -# tablelist::removeActiveTag -# -# This procedure is invoked when the tablelist widget win loses the keyboard -# focus. It removes the "active" tag from the body text child of the widget. -#------------------------------------------------------------------------------ -proc tablelist::removeActiveTag win { - upvar ::tablelist::ns${win}::data data - set data(ownsFocus) 0 - - $data(body) tag remove active 1.0 end -} - -#------------------------------------------------------------------------------ -# tablelist::cleanup -# -# This procedure is invoked when the tablelist widget win is destroyed. It -# executes some cleanup operations. -#------------------------------------------------------------------------------ -proc tablelist::cleanup win { - # - # Cancel the execution of all delayed handleMotion, updateKeyToRowMap, - # adjustSeps, makeStripes, showLineNumbers, stretchColumns, updateColors, - # updateScrlColOffset, updateHScrlbar, updateVScrlbar, updateView, - # synchronize, displayItems, moveTo, horizAutoScan, forceRedraw, - # doCellConfig, redisplay, redisplayCol, and destroyWidgets commands - # - upvar ::tablelist::ns${win}::data data - foreach id {motionId mapId sepsId stripesId lineNumsId stretchId colorsId - offsetId hScrlbarId vScrlbarId viewId syncId dispId moveToId - afterId redrawId reconfigId} { - if {[info exists data($id)]} { - after cancel $data($id) - } - } - foreach name [array names data *redispId] { - after cancel $data($name) - } - foreach destroyId $data(destroyIdList) { - after cancel $destroyId - } - - # - # If there is a list variable associated with the - # widget then remove the trace set on this variable - # - upvar #0 $data(-listvariable) var - if {$data(hasListVar) && [info exists var]} { - trace vdelete var wu $data(listVarTraceCmd) - } - - # - # Destroy any existing bindings for data(bodyTag), - # data(labelTag), and data(editwinTag) - # - foreach event [bind $data(bodyTag)] { - bind $data(bodyTag) $event "" - } - foreach event [bind $data(labelTag)] { - bind $data(labelTag) $event "" - } - foreach event [bind $data(editwinTag)] { - bind $data(editwinTag) $event "" - } - - # - # Delete the bitmaps displaying the sort ranks - # and the images used to display the sort arrows - # - for {set rank 1} {$rank < 10} {incr rank} { - image delete sortRank$rank$win - } - for {set col 0} {$col < $data(colCount)} {incr col} { - set w $data(hdrTxtFrCanv)$col - foreach shape {triangleUp darkLineUp lightLineUp - triangleDn darkLineDn lightLineDn} { - catch {image delete $shape$w} - } - } - - destroy $data(corner) - - namespace delete ::tablelist::ns$win - catch {rename ::$win ""} -} - -#------------------------------------------------------------------------------ -# tablelist::updateCanvases -# -# This procedure handles the events and by configuring -# the canvases displaying sort arrows. -#------------------------------------------------------------------------------ -proc tablelist::updateCanvases win { - upvar ::tablelist::ns${win}::data data - foreach col $data(arrowColList) { - configCanvas $win $col - raiseArrow $win $col - } -} - -#------------------------------------------------------------------------------ -# tablelist::updateConfigSpecs -# -# This procedure handles the virtual event <> by updating the -# theme-specific default values of some tablelist configuration options. -#------------------------------------------------------------------------------ -proc tablelist::updateConfigSpecs win { - # - # This might be an "after idle" callback; check whether the window exists - # - if {![array exists ::tablelist::ns${win}::data]} { - return "" - } - - set currentTheme [getCurrentTheme] - upvar ::tablelist::ns${win}::data data - if {[string compare $currentTheme $data(currentTheme)] == 0} { - if {[string compare $currentTheme "tileqt"] == 0} { - set widgetStyle [tileqt_currentThemeName] - if {[info exists ::env(KDE_SESSION_VERSION)] && - [string length $::env(KDE_SESSION_VERSION)] != 0} { - set colorScheme [getKdeConfigVal "General" "ColorScheme"] - } else { - set colorScheme [getKdeConfigVal "KDE" "colorScheme"] - } - if {[string compare $widgetStyle $data(widgetStyle)] == 0 && - [string compare $colorScheme $data(colorScheme)] == 0} { - return "" - } - } else { - return "" - } - } - - # - # Populate the array tmp with values corresponding to the old theme - # and the array themeDefaults with values corresponding to the new one - # - array set tmp $data(themeDefaults) - setThemeDefaults - - # - # Set those configuration options whose values equal the old - # theme-specific defaults to the new theme-specific ones - # - variable themeDefaults - foreach opt {-background -foreground -disabledforeground -stripebackground - -selectbackground -selectforeground -selectborderwidth -font - -labelforeground -labelfont -labelborderwidth -labelpady - -treestyle} { - if {[string compare $data($opt) $tmp($opt)] == 0} { - doConfig $win $opt $themeDefaults($opt) - } - } - if {[string compare $data(-arrowcolor) $tmp(-arrowcolor)] == 0 && - [string compare $data(-arrowstyle) $tmp(-arrowstyle)] == 0} { - foreach opt {-arrowcolor -arrowdisabledcolor -arrowstyle} { - doConfig $win $opt $themeDefaults($opt) - } - } - foreach opt {-background -foreground} { - doConfig $win $opt $data($opt) ;# sets the bg color of the separators - } - updateCanvases $win - - # - # Destroy and recreate the edit window if present - # - if {[set editCol $data(editCol)] >= 0} { - set editRow $data(editRow) - saveEditData $win - destroy $data(bodyFr) - doEditCell $win $editRow $editCol 1 - } - - # - # Destroy and recreate the embedded windows - # - if {$data(winCount) != 0} { - for {set row 0} {$row < $data(itemCount)} {incr row} { - for {set col 0} {$col < $data(colCount)} {incr col} { - set key [lindex $data(keyList) $row] - if {[info exists data($key,$col-window)]} { - set val $data($key,$col-window) - doCellConfig $row $col $win -window "" - doCellConfig $row $col $win -window $val - } - } - } - } - - set data(currentTheme) $currentTheme - set data(themeDefaults) [array get themeDefaults] - if {[string compare $currentTheme "tileqt"] == 0} { - set data(widgetStyle) [tileqt_currentThemeName] - if {[info exists ::env(KDE_SESSION_VERSION)] && - [string length $::env(KDE_SESSION_VERSION)] != 0} { - set data(colorScheme) [getKdeConfigVal "General" "ColorScheme"] - } else { - set data(colorScheme) [getKdeConfigVal "KDE" "colorScheme"] - } - } else { - set data(widgetStyle) "" - set data(colorScheme) "" - } -} - -# -# Binding tag TablelistWindow -# =========================== -# - -#------------------------------------------------------------------------------ -# tablelist::cleanupWindow -# -# This procedure is invoked when a window aux embedded into a tablelist widget -# is destroyed. It invokes the cleanup script associated with the cell -# containing the window, if any. -#------------------------------------------------------------------------------ -proc tablelist::cleanupWindow aux { - regexp {^(.+)\.body\.frm_(k[0-9]+),([0-9]+)$} $aux dummy win key col - upvar ::tablelist::ns${win}::data data - if {[info exists data($key,$col-windowdestroy)]} { - set row [keyToRow $win $key] - uplevel #0 $data($key,$col-windowdestroy) [list $win $row $col $aux.w] - } -} - -# -# Binding tag TablelistBody -# ========================= -# - -#------------------------------------------------------------------------------ -# tablelist::defineTablelistBody -# -# Defines the bindings for the binding tag TablelistBody. -#------------------------------------------------------------------------------ -proc tablelist::defineTablelistBody {} { - variable priv - array set priv { - x "" - y "" - afterId "" - prevRow "" - prevCol "" - prevActExpCollCtrlCell "" - selection {} - selClearPending 0 - selChangePending 0 - justClicked 0 - justReleased 0 - clickedInEditWin 0 - clickedExpCollCtrl 0 - } - - foreach event { } { - bind TablelistBody $event [format { - tablelist::handleMotionDelayed %%W %%x %%y %%X %%Y %s - } $event] - } - bind TablelistBody { - if {[winfo exists %W]} { - foreach {tablelist::W tablelist::x tablelist::y} \ - [tablelist::convEventFields %W %x %y] {} - - set tablelist::priv(x) $tablelist::x - set tablelist::priv(y) $tablelist::y - set tablelist::priv(row) [$tablelist::W nearest $tablelist::y] - set tablelist::priv(col) [$tablelist::W nearestcolumn $tablelist::x] - set tablelist::priv(justClicked) 1 - after 300 [list set tablelist::priv(justClicked) 0] - set tablelist::priv(clickedInEditWin) 0 - if {[$tablelist::W cget -setfocus] && - [string compare [$tablelist::W cget -state] "normal"] == 0} { - focus [$tablelist::W bodypath] - } - if {[tablelist::wasExpCollCtrlClicked %W %x %y]} { - set tablelist::priv(clickedExpCollCtrl) 1 - if {[string length [$tablelist::W editwinpath]] != 0} { - tablelist::doFinishEditing $tablelist::W - } - } else { - tablelist::condEditContainingCell $tablelist::W \ - $tablelist::x $tablelist::y - set tablelist::priv(row) \ - [$tablelist::W nearest $tablelist::y] - set tablelist::priv(col) \ - [$tablelist::W nearestcolumn $tablelist::x] - tablelist::condBeginMove $tablelist::W $tablelist::priv(row) - tablelist::beginSelect $tablelist::W \ - $tablelist::priv(row) $tablelist::priv(col) 1 - } - } - } - bind TablelistBody { - if {[winfo exists %W]} { - foreach {tablelist::W tablelist::x tablelist::y} \ - [tablelist::convEventFields %W %x %y] {} - - if {[$tablelist::W cget -editselectedonly]} { - tablelist::condEditContainingCell $tablelist::W \ - $tablelist::x $tablelist::y - } - } - } - bind TablelistBody { - if {$tablelist::priv(justClicked)} { - continue - } - - foreach {tablelist::W tablelist::x tablelist::y} \ - [tablelist::convEventFields %W %x %y] {} - - if {[string length $tablelist::priv(x)] == 0 || - [string length $tablelist::priv(y)] == 0} { - set tablelist::priv(x) $tablelist::x - set tablelist::priv(y) $tablelist::y - } - set tablelist::priv(prevX) $tablelist::priv(x) - set tablelist::priv(prevY) $tablelist::priv(y) - set tablelist::priv(x) $tablelist::x - set tablelist::priv(y) $tablelist::y - tablelist::condAutoScan $tablelist::W - if {!$tablelist::priv(clickedExpCollCtrl)} { - tablelist::motion $tablelist::W \ - [$tablelist::W nearest $tablelist::y] \ - [$tablelist::W nearestcolumn $tablelist::x] 1 - tablelist::condShowTarget $tablelist::W $tablelist::y - } - } - bind TablelistBody { - if {[winfo exists %W]} { - foreach {tablelist::W tablelist::x tablelist::y} \ - [tablelist::convEventFields %W %x %y] {} - - set tablelist::priv(x) "" - set tablelist::priv(y) "" - after cancel $tablelist::priv(afterId) - set tablelist::priv(afterId) "" - set tablelist::priv(justReleased) 1 - after 100 [list set tablelist::priv(justReleased) 0] - set tablelist::priv(releasedInEditWin) 0 - if {!$tablelist::priv(clickedExpCollCtrl)} { - if {$tablelist::priv(justClicked)} { - tablelist::moveOrActivate $tablelist::W \ - $tablelist::priv(row) $tablelist::priv(col) 1 - } else { - tablelist::moveOrActivate $tablelist::W \ - [$tablelist::W nearest $tablelist::y] \ - [$tablelist::W nearestcolumn $tablelist::x] \ - [expr {$tablelist::x >= 0 && - $tablelist::x < [winfo width $tablelist::W] && - $tablelist::y >= [winfo y $tablelist::W.body] && - $tablelist::y < [winfo height $tablelist::W]}] - } - } - set tablelist::priv(clickedExpCollCtrl) 0 - after 100 [list tablelist::condEvalInvokeCmd $tablelist::W] - } - } - bind TablelistBody { - foreach {tablelist::W tablelist::x tablelist::y} \ - [tablelist::convEventFields %W %x %y] {} - - tablelist::beginExtend $tablelist::W \ - [$tablelist::W nearest $tablelist::y] \ - [$tablelist::W nearestcolumn $tablelist::x] - } - bind TablelistBody { - foreach {tablelist::W tablelist::x tablelist::y} \ - [tablelist::convEventFields %W %x %y] {} - - tablelist::beginToggle $tablelist::W \ - [$tablelist::W nearest $tablelist::y] \ - [$tablelist::W nearestcolumn $tablelist::x] - } - - bind TablelistBody { - tablelist::condEditActiveCell [tablelist::getTablelistPath %W] - } - bind TablelistBody { - tablelist::condEditActiveCell [tablelist::getTablelistPath %W] - } - bind TablelistBody { - tablelist::nextPrevCell [tablelist::getTablelistPath %W] 1 - } - bind TablelistBody { - tablelist::nextPrevCell [tablelist::getTablelistPath %W] -1 - } - bind TablelistBody <> { - tablelist::nextPrevCell [tablelist::getTablelistPath %W] -1 - } - bind TablelistBody { - tablelist::plusMinus [tablelist::getTablelistPath %W] plus - } - bind TablelistBody { - tablelist::plusMinus [tablelist::getTablelistPath %W] minus - } - bind TablelistBody { - tablelist::plusMinus [tablelist::getTablelistPath %W] plus - } - bind TablelistBody { - tablelist::plusMinus [tablelist::getTablelistPath %W] minus - } - - foreach {virtual event} { - PrevLine NextLine - PrevChar NextChar - LineStart LineEnd - PrevWord NextWord - - SelectPrevLine SelectNextLine - SelectPrevChar SelectNextChar - SelectLineStart SelectLineEnd - SelectAll SelectNone } { - if {[llength [event info <<$virtual>>]] == 0} { - set eventArr($virtual) $event - } else { - set eventArr($virtual) <<$virtual>> - } - } - - bind TablelistBody $eventArr(PrevLine) { - tablelist::upDown [tablelist::getTablelistPath %W] -1 - } - bind TablelistBody $eventArr(NextLine) { - tablelist::upDown [tablelist::getTablelistPath %W] 1 - } - bind TablelistBody $eventArr(PrevChar) { - tablelist::leftRight [tablelist::getTablelistPath %W] -1 - } - bind TablelistBody $eventArr(NextChar) { - tablelist::leftRight [tablelist::getTablelistPath %W] 1 - } - bind TablelistBody { - tablelist::priorNext [tablelist::getTablelistPath %W] -1 - } - bind TablelistBody { - tablelist::priorNext [tablelist::getTablelistPath %W] 1 - } - bind TablelistBody $eventArr(LineStart) { - tablelist::homeEnd [tablelist::getTablelistPath %W] Home - } - bind TablelistBody $eventArr(LineEnd) { - tablelist::homeEnd [tablelist::getTablelistPath %W] End - } - bind TablelistBody { - tablelist::firstLast [tablelist::getTablelistPath %W] first - } - bind TablelistBody { - tablelist::firstLast [tablelist::getTablelistPath %W] last - } - bind TablelistBody $eventArr(SelectPrevLine) { - tablelist::extendUpDown [tablelist::getTablelistPath %W] -1 - } - bind TablelistBody $eventArr(SelectNextLine) { - tablelist::extendUpDown [tablelist::getTablelistPath %W] 1 - } - bind TablelistBody $eventArr(SelectPrevChar) { - tablelist::extendLeftRight [tablelist::getTablelistPath %W] -1 - } - bind TablelistBody $eventArr(SelectNextChar) { - tablelist::extendLeftRight [tablelist::getTablelistPath %W] 1 - } - bind TablelistBody $eventArr(SelectLineStart) { - tablelist::extendToHomeEnd [tablelist::getTablelistPath %W] Home - } - bind TablelistBody $eventArr(SelectLineEnd) { - tablelist::extendToHomeEnd [tablelist::getTablelistPath %W] End - } - bind TablelistBody { - tablelist::extendToFirstLast [tablelist::getTablelistPath %W] first - } - bind TablelistBody { - tablelist::extendToFirstLast [tablelist::getTablelistPath %W] last - } - bind TablelistBody { - set tablelist::W [tablelist::getTablelistPath %W] - - tablelist::beginSelect $tablelist::W \ - [$tablelist::W index active] [$tablelist::W columnindex active] - } - bind TablelistBody element. This uses the -# input.size default falue. -# -# Arguments: -# name The form element name -# args Additional attributes for the INPUT tag -# -# Results: -# The html fragment - -proc ::html::textInput {name {value {}} args} { - ::set html "\n" - return $html -} - -# ::html::textInputRow -- -# -# Format a table row containing a text input element and a label. -# -# Arguments: -# label Label to display next to the form element -# name The form element name -# args Additional attributes for the INPUT tag -# -# Results: -# The html fragment - -proc ::html::textInputRow {label name {value {}} args} { - ::set html [row $label [::eval [linsert $args 0 html::textInput $name $value]]] - return $html -} - -# ::html::passwordInputRow -- -# -# Format a table row containing a password input element and a label. -# -# Arguments: -# label Label to display next to the form element -# name The form element name -# -# Results: -# The html fragment - -proc ::html::passwordInputRow {label {name password}} { - ::set html [row $label [passwordInput $name]] - return $html -} - -# ::html::passwordInput -- -# -# Return an element. -# -# Arguments: -# name The form element name. Defaults to "password" -# -# Results: -# The html fragment - -proc ::html::passwordInput {{name password}} { - ::set html "\n" - return $html -} - -# ::html::checkbox -- -# -# Format a checkbox so that it retains its state based on -# the current CGI values -# -# Arguments: -# name The form element name -# value The value associated with the checkbox -# -# Results: -# The html fragment - -proc ::html::checkbox {name value} { - ::set html "\n" -} - -# ::html::checkValue -# -# Like html::formalue, but for checkboxes that need CHECKED -# -# Arguments: -# name The name of the form element -# defvalue A default value to use, if not appears in the CGI -# inputs -# -# Retults: -# A string like: -# name="fred" value="freds value" CHECKED - - -proc ::html::checkValue {name {value 1}} { - ::foreach v [ncgi::valueList $name] { - ::if {[string compare $value $v] == 0} { - return "name=\"$name\" value=\"[quoteFormValue $value]\" checked" - } - } - return "name=\"$name\" value=\"[quoteFormValue $value]\"" -} - -# ::html::radioValue -# -# Like html::formValue, but for radioboxes that need CHECKED -# -# Arguments: -# name The name of the form element -# value The value associated with the radio button. -# -# Retults: -# A string like: -# name="fred" value="freds value" CHECKED - -proc ::html::radioValue {name value {defaultSelection {}}} { - ::if {[string equal $value [ncgi::value $name $defaultSelection]]} { - return "name=\"$name\" value=\"[quoteFormValue $value]\" checked" - } else { - return "name=\"$name\" value=\"[quoteFormValue $value]\"" - } -} - -# ::html::radioSet -- -# -# Display a set of radio buttons while looking for an existing -# value from the query data, if any. - -proc ::html::radioSet {key sep list {defaultSelection {}}} { - ::set html "" - ::set s "" - ::foreach {label v} $list { - append html "$s $label" - ::set s $sep - } - return $html -} - -# ::html::checkSet -- -# -# Display a set of check buttons while looking for an existing -# value from the query data, if any. - -proc ::html::checkSet {key sep list} { - ::set s "" - ::foreach {label v} $list { - append html "$s $label" - ::set s $sep - } - return $html -} - -# ::html::select -- -# -# Format a \n" - ::foreach {label v} $choices { - ::if {[lsearch -exact $def $v] != -1} { - ::set SEL " selected" - } else { - ::set SEL "" - } - append html "