diff options
author | das <das> | 2007-10-26 07:56:00 (GMT) |
---|---|---|
committer | das <das> | 2007-10-26 07:56:00 (GMT) |
commit | a220ddc7b2805c63cd68bddcdba097b7f37c3372 (patch) | |
tree | 117b3bf0532b3905f95465da1304c4fdeb3c2e2c /library/demos/filebox.tcl | |
parent | 2cd3d962db7f314e1251de41c7b4c100e64768d5 (diff) | |
download | tk-a220ddc7b2805c63cd68bddcdba097b7f37c3372.zip tk-a220ddc7b2805c63cd68bddcdba097b7f37c3372.tar.gz tk-a220ddc7b2805c63cd68bddcdba097b7f37c3372.tar.bz2 |
* macosx/tkMacOSXDialog.c: TIP#242 cleanup.
* library/demos/filebox.tcl: demo TIP#242 -typevariable.
Diffstat (limited to 'library/demos/filebox.tcl')
-rw-r--r-- | library/demos/filebox.tcl | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/library/demos/filebox.tcl b/library/demos/filebox.tcl index e27974b..c64888e 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.6 2004/12/21 11:56:35 dkf Exp $ +# RCS: @(#) $Id: filebox.tcl,v 1.7 2007/10/26 07:56:02 das Exp $ if {![info exists widgetDemo]} { error "This script should be run from the \"widget\" demo." @@ -61,10 +61,13 @@ proc fileDialog {w ent operation} { {"All files" *} } if {$operation == "open"} { - set file [tk_getOpenFile -filetypes $types -parent $w] + set type "Tcl Scripts" + set file [tk_getOpenFile -filetypes $types -parent $w \ + -typevariable type] + puts "You selected filetype \"$type\"" } else { set file [tk_getSaveFile -filetypes $types -parent $w \ - -initialfile Untitled -defaultextension .txt] + -initialfile Untitled -defaultextension .txt] } if {[string compare $file ""]} { $ent delete 0 end |