From 5c754a2a7dbb6305a140012bd24f68e32b2375ff Mon Sep 17 00:00:00 2001 From: patthoyts Date: Mon, 4 Jan 2010 12:11:47 +0000 Subject: Make the filebox demo prettier --- ChangeLog | 2 +- library/demos/filebox.tcl | 17 ++++++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 222905c..290fe73 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,7 @@ 2010-01-04 Pat Thoyts + * library/demos/filebox.tcl: Make prettier using ttk. * library/demos/fontchoose.tcl: Fix display of demo code. - * library/tk.tcl: Correctly handle quoted ampersands in AmpMenuArgs 2010-01-03 Donal K. Fellows diff --git a/library/demos/filebox.tcl b/library/demos/filebox.tcl index 63c7d59..445052e 100644 --- a/library/demos/filebox.tcl +++ b/library/demos/filebox.tcl @@ -2,7 +2,7 @@ # # This demonstration script prompts the user to select a file. # -# RCS: @(#) $Id: filebox.tcl,v 1.10 2009/04/10 16:42:01 das Exp $ +# RCS: @(#) $Id: filebox.tcl,v 1.11 2010/01/04 12:11:48 patthoyts Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." @@ -17,7 +17,10 @@ wm title $w "File Selection Dialogs" wm iconname $w "filebox" positionWindow $w -label $w.msg -font $font -wraplength 4i -justify left -text "Enter a file name in the entry box or click on the \"Browse\" buttons to select a file name using the file selection dialog." +ttk::frame $w._bg +place $w._bg -x 0 -y 0 -relwidth 1 -relheight 1 + +ttk::label $w.msg -font $font -wraplength 4i -justify left -text "Enter a file name in the entry box or click on the \"Browse\" buttons to select a file name using the file selection dialog." pack $w.msg -side top ## See Code / Dismiss buttons @@ -25,10 +28,10 @@ set btns [addSeeDismiss $w.buttons $w] pack $btns -side bottom -fill x foreach i {open save} { - set f [frame $w.$i] - label $f.lab -text "Select a file to $i: " -anchor e - entry $f.ent -width 20 - button $f.but -text "Browse ..." -command "fileDialog $w $f.ent $i" + set f [ttk::frame $w.$i] + ttk::label $f.lab -text "Select a file to $i: " -anchor e + ttk::entry $f.ent -width 20 + ttk::button $f.but -text "Browse ..." -command "fileDialog $w $f.ent $i" pack $f.lab -side left pack $f.ent -side left -expand yes -fill x pack $f.but -side left @@ -36,7 +39,7 @@ foreach i {open save} { } if {[tk windowingsystem] eq "x11"} { - checkbutton $w.strict -text "Use Motif Style Dialog" \ + ttk::checkbutton $w.strict -text "Use Motif Style Dialog" \ -variable tk_strictMotif -onvalue 1 -offvalue 0 pack $w.strict -anchor c -- cgit v0.12