From 3104c8cb09be0275aa34df07c62550b23320266b Mon Sep 17 00:00:00 2001 From: "jenglish@flightlab.com" Date: Thu, 11 Dec 2008 18:13:08 +0000 Subject: library/demos/*.tcl: Omit contraindicated [package require Ttk]. Remove logic that switches [ttk::scrollbar]s to [tk::scrollbar]s based on [tk windowingsystem]; this is already handled in library/ttk/scrollbar.tcl. --- ChangeLog | 7 +++++++ library/demos/combo.tcl | 3 +-- library/demos/mclist.tcl | 12 +++--------- library/demos/msgbox.tcl | 3 +-- library/demos/toolbar.tcl | 3 +-- library/demos/tree.tcl | 12 +++--------- library/demos/ttkbut.tcl | 3 +-- library/demos/ttkmenu.tcl | 3 +-- library/demos/ttknote.tcl | 9 ++------- library/demos/ttkpane.tcl | 3 +-- library/demos/ttkprogress.tcl | 3 +-- library/demos/widget | 3 +-- library/msgbox.tcl | 4 +--- library/tkfbox.tcl | 4 +--- 14 files changed, 25 insertions(+), 47 deletions(-) diff --git a/ChangeLog b/ChangeLog index 793c5a9..b715a9f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-12-11 Joe English + + * library/demos/*.tcl: Omit contraindicated [package require Ttk]. + Remove logic that switches [ttk::scrollbar]s to [tk::scrollbar]s + based on [tk windowingsystem]; this is already handled in + library/ttk/scrollbar.tcl. + 2008-12-10 Daniel Steffen TIP #324 IMPLEMENTATION diff --git a/library/demos/combo.tcl b/library/demos/combo.tcl index 521e37b..2545d8b 100644 --- a/library/demos/combo.tcl +++ b/library/demos/combo.tcl @@ -2,14 +2,13 @@ # # This demonstration script creates several combobox widgets. # -# RCS: @(#) $Id: combo.tcl,v 1.3 2007/12/13 15:27:07 dgp Exp $ +# RCS: @(#) $Id: combo.tcl,v 1.4 2008/12/11 18:13:08 jenglish Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk -package require Ttk set w .combo catch {destroy $w} diff --git a/library/demos/mclist.tcl b/library/demos/mclist.tcl index 18d8781..27ea1ea 100644 --- a/library/demos/mclist.tcl +++ b/library/demos/mclist.tcl @@ -3,14 +3,13 @@ # This demonstration script creates a toplevel window containing a Ttk # tree widget configured as a multi-column listbox. # -# RCS: @(#) $Id: mclist.tcl,v 1.3 2007/12/13 15:27:07 dgp Exp $ +# RCS: @(#) $Id: mclist.tcl,v 1.4 2008/12/11 18:13:08 jenglish Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk -package require Ttk set w .mclist catch {destroy $w} @@ -29,13 +28,8 @@ pack [addSeeDismiss $w.seeDismiss $w] -side bottom -fill x ttk::frame $w.container ttk::treeview $w.tree -columns {country capital currency} -show headings \ -yscroll "$w.vsb set" -xscroll "$w.hsb set" -if {[tk windowingsystem] ne "aqua"} { - ttk::scrollbar $w.vsb -orient vertical -command "$w.tree yview" - ttk::scrollbar $w.hsb -orient horizontal -command "$w.tree xview" -} else { - scrollbar $w.vsb -orient vertical -command "$w.tree yview" - scrollbar $w.hsb -orient horizontal -command "$w.tree xview" -} +ttk::scrollbar $w.vsb -orient vertical -command "$w.tree yview" +ttk::scrollbar $w.hsb -orient horizontal -command "$w.tree xview" pack $w.container -fill both -expand 1 grid $w.tree $w.vsb -in $w.container -sticky nsew grid $w.hsb -in $w.container -sticky nsew diff --git a/library/demos/msgbox.tcl b/library/demos/msgbox.tcl index fb986e1..1e09cb5 100644 --- a/library/demos/msgbox.tcl +++ b/library/demos/msgbox.tcl @@ -2,14 +2,13 @@ # # This demonstration script creates message boxes of various type # -# RCS: @(#) $Id: msgbox.tcl,v 1.6 2007/12/13 15:27:07 dgp Exp $ +# RCS: @(#) $Id: msgbox.tcl,v 1.7 2008/12/11 18:13:08 jenglish Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk -package require Ttk set w .msgbox catch {destroy $w} diff --git a/library/demos/toolbar.tcl b/library/demos/toolbar.tcl index 74a490f..81724eb 100644 --- a/library/demos/toolbar.tcl +++ b/library/demos/toolbar.tcl @@ -2,14 +2,13 @@ # # This demonstration script creates a toolbar that can be torn off. # -# RCS: @(#) $Id: toolbar.tcl,v 1.3 2007/12/13 15:27:07 dgp Exp $ +# RCS: @(#) $Id: toolbar.tcl,v 1.4 2008/12/11 18:13:08 jenglish Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk -package require Ttk set w .toolbar destroy $w diff --git a/library/demos/tree.tcl b/library/demos/tree.tcl index b46943a..828560d 100644 --- a/library/demos/tree.tcl +++ b/library/demos/tree.tcl @@ -3,14 +3,13 @@ # This demonstration script creates a toplevel window containing a Ttk # tree widget. # -# RCS: @(#) $Id: tree.tcl,v 1.4 2007/12/13 15:27:07 dgp Exp $ +# RCS: @(#) $Id: tree.tcl,v 1.5 2008/12/11 18:13:08 jenglish Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk -package require Ttk set w .tree catch {destroy $w} @@ -74,13 +73,8 @@ proc populateTree {tree node} { ## Create the tree and set it up ttk::treeview $w.tree -columns {fullpath type size} -displaycolumns {size} \ -yscroll "$w.vsb set" -xscroll "$w.hsb set" -if {[tk windowingsystem] ne "aqua"} { - ttk::scrollbar $w.vsb -orient vertical -command "$w.tree yview" - ttk::scrollbar $w.hsb -orient horizontal -command "$w.tree xview" -} else { - scrollbar $w.vsb -orient vertical -command "$w.tree yview" - scrollbar $w.hsb -orient horizontal -command "$w.tree xview" -} +ttk::scrollbar $w.vsb -orient vertical -command "$w.tree yview" +ttk::scrollbar $w.hsb -orient horizontal -command "$w.tree xview" $w.tree heading \#0 -text "Directory Structure" $w.tree heading size -text "File Size" $w.tree column size -stretch 0 -width 70 diff --git a/library/demos/ttkbut.tcl b/library/demos/ttkbut.tcl index 3d5d3a8..5235cdc 100644 --- a/library/demos/ttkbut.tcl +++ b/library/demos/ttkbut.tcl @@ -4,14 +4,13 @@ # simple Ttk widgets, such as labels, labelframes, buttons, checkbuttons and # radiobuttons. # -# RCS: @(#) $Id: ttkbut.tcl,v 1.4 2007/12/13 15:27:07 dgp Exp $ +# RCS: @(#) $Id: ttkbut.tcl,v 1.5 2008/12/11 18:13:08 jenglish Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk -package require Ttk set w .ttkbut catch {destroy $w} diff --git a/library/demos/ttkmenu.tcl b/library/demos/ttkmenu.tcl index 235b4b1..59a9452 100644 --- a/library/demos/ttkmenu.tcl +++ b/library/demos/ttkmenu.tcl @@ -3,14 +3,13 @@ # This demonstration script creates a toplevel window containing several Ttk # menubutton widgets. # -# RCS: @(#) $Id: ttkmenu.tcl,v 1.3 2007/12/13 15:27:07 dgp Exp $ +# RCS: @(#) $Id: ttkmenu.tcl,v 1.4 2008/12/11 18:13:08 jenglish Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk -package require Ttk set w .ttkmenu catch {destroy $w} diff --git a/library/demos/ttknote.tcl b/library/demos/ttknote.tcl index f7c70a3..5a4e728 100644 --- a/library/demos/ttknote.tcl +++ b/library/demos/ttknote.tcl @@ -3,14 +3,13 @@ # This demonstration script creates a toplevel window containing a Ttk # notebook widget. # -# RCS: @(#) $Id: ttknote.tcl,v 1.5 2007/12/13 15:27:07 dgp Exp $ +# RCS: @(#) $Id: ttknote.tcl,v 1.6 2008/12/11 18:13:08 jenglish Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk -package require Ttk set w .ttknote catch {destroy $w} @@ -55,10 +54,6 @@ ttk::frame $w.note.editor $w.note add $w.note.editor -text "Text Editor" -underline 0 text $w.note.editor.t -width 40 -height 10 -wrap char \ -yscroll "$w.note.editor.s set" -if {[tk windowingsystem] ne "aqua"} { - ttk::scrollbar $w.note.editor.s -orient vertical -command "$w.note.editor.t yview" -} else { - scrollbar $w.note.editor.s -orient vertical -command "$w.note.editor.t yview" -} +ttk::scrollbar $w.note.editor.s -orient vertical -command "$w.note.editor.t yview" pack $w.note.editor.s -side right -fill y -padx {0 2} -pady 2 pack $w.note.editor.t -fill both -expand 1 -pady 2 -padx {2 0} diff --git a/library/demos/ttkpane.tcl b/library/demos/ttkpane.tcl index a99a845..9664ad2 100644 --- a/library/demos/ttkpane.tcl +++ b/library/demos/ttkpane.tcl @@ -2,14 +2,13 @@ # # This demonstration script creates a Ttk pane with some content. # -# RCS: @(#) $Id: ttkpane.tcl,v 1.4 2008/06/24 13:37:32 patthoyts Exp $ +# RCS: @(#) $Id: ttkpane.tcl,v 1.5 2008/12/11 18:13:08 jenglish Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk -package require Ttk set w .ttkpane catch {destroy $w} diff --git a/library/demos/ttkprogress.tcl b/library/demos/ttkprogress.tcl index 2db6d59..98388b5 100644 --- a/library/demos/ttkprogress.tcl +++ b/library/demos/ttkprogress.tcl @@ -2,14 +2,13 @@ # # This demonstration script creates several progress bar widgets. # -# RCS: @(#) $Id: ttkprogress.tcl,v 1.3 2007/12/13 15:27:07 dgp Exp $ +# RCS: @(#) $Id: ttkprogress.tcl,v 1.4 2008/12/11 18:13:08 jenglish Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." } package require Tk -package require Ttk set w .ttkprogress catch {destroy $w} diff --git a/library/demos/widget b/library/demos/widget index 9182904..e9e2d51 100644 --- a/library/demos/widget +++ b/library/demos/widget @@ -10,12 +10,11 @@ exec wish "$0" "$@" # separate ".tcl" files is this directory, which are sourced by this script as # needed. # -# RCS: @(#) $Id: widget,v 1.51 2008/03/11 22:30:17 das Exp $ +# RCS: @(#) $Id: widget,v 1.52 2008/12/11 18:13:08 jenglish Exp $ package require Tcl 8.5 package require Tk 8.5 package require msgcat -package require Ttk eval destroy [winfo child .] set tk_demoDirectory [file join [pwd] [file dirname [info script]]] diff --git a/library/msgbox.tcl b/library/msgbox.tcl index 04d26a7..33c50bc 100644 --- a/library/msgbox.tcl +++ b/library/msgbox.tcl @@ -3,7 +3,7 @@ # Implements messageboxes for platforms that do not have native # messagebox support. # -# RCS: @(#) $Id: msgbox.tcl,v 1.36 2008/01/31 23:33:42 hobbs Exp $ +# RCS: @(#) $Id: msgbox.tcl,v 1.37 2008/12/11 18:13:08 jenglish Exp $ # # Copyright (c) 1994-1997 Sun Microsystems, Inc. # @@ -11,8 +11,6 @@ # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -package require Ttk - # Ensure existence of ::tk::dialog namespace # namespace eval ::tk::dialog {} diff --git a/library/tkfbox.tcl b/library/tkfbox.tcl index 3f8dc9f..98cde58 100644 --- a/library/tkfbox.tcl +++ b/library/tkfbox.tcl @@ -11,7 +11,7 @@ # files by clicking on the file icons or by entering a filename # in the "Filename:" entry. # -# RCS: @(#) $Id: tkfbox.tcl,v 1.69 2008/08/25 17:13:04 tmh Exp $ +# RCS: @(#) $Id: tkfbox.tcl,v 1.70 2008/12/11 18:13:08 jenglish Exp $ # # Copyright (c) 1994-1998 Sun Microsystems, Inc. # @@ -19,8 +19,6 @@ # of this file, and for a DISCLAIMER OF ALL WARRANTIES. # -package require Ttk - #---------------------------------------------------------------------- # # I C O N L I S T -- cgit v0.12