diff options
author | dgp <dgp@noemail.net> | 2001-08-01 16:21:11 (GMT) |
---|---|---|
committer | dgp <dgp@noemail.net> | 2001-08-01 16:21:11 (GMT) |
commit | 467c9e4b5370192c9785e29cda3a170e70a710e8 (patch) | |
tree | 38846cbe94cc8aac068898282ced4624f130770e /library/choosedir.tcl | |
parent | c68eaf7c36bd99f3ea38a1d823c04e7e537f9a7e (diff) | |
download | tk-467c9e4b5370192c9785e29cda3a170e70a710e8.zip tk-467c9e4b5370192c9785e29cda3a170e70a710e8.tar.gz tk-467c9e4b5370192c9785e29cda3a170e70a710e8.tar.bz2 |
Merged changes from feature branch dgp-privates-into-namespace,
implementing TIP 44. All Tk commands and variables matching
tk[A-Z]* are now in the ::tk namespace.
FossilOrigin-Name: 3c0c681d8883f0843b9dcb3f402c2773f6a438a7
Diffstat (limited to 'library/choosedir.tcl')
-rw-r--r-- | library/choosedir.tcl | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/library/choosedir.tcl b/library/choosedir.tcl index d9aa79d..ee4dfb1 100644 --- a/library/choosedir.tcl +++ b/library/choosedir.tcl @@ -5,7 +5,7 @@ # Copyright (c) 1998-2000 by Scriptics Corporation. # All rights reserved. # -# RCS: @(#) $Id: choosedir.tcl,v 1.9 2000/06/30 06:38:38 ericm Exp $ +# RCS: @(#) $Id: choosedir.tcl,v 1.10 2001/08/01 16:21:11 dgp Exp $ # Make sure the tk::dialog namespace, in which all dialogs should live, exists namespace eval ::tk::dialog {} @@ -15,15 +15,15 @@ namespace eval ::tk::dialog::file {} namespace eval ::tk::dialog::file::chooseDir { } -# ::tk::dialog::file::tkChooseDirectory -- +# ::tk::dialog::file::chooseDir:: -- # # Implements the TK directory selection dialog. # # Arguments: # args Options parsed by the procedure. # -proc ::tk::dialog::file::chooseDir::tkChooseDirectory {args} { - global tkPriv +proc ::tk::dialog::file::chooseDir:: {args} { + variable ::tk::Priv set dataName __tk_choosedir upvar ::tk::dialog::file::$dataName data ::tk::dialog::file::chooseDir::Config $dataName $args @@ -81,7 +81,7 @@ proc ::tk::dialog::file::chooseDir::tkChooseDirectory {args} { # may take the focus away so we can't redirect it. Finally, # restore any grab that was in effect. - tkwait variable tkPriv(selectFilePath) + vwait ::tk::Priv(selectFilePath) ::tk::RestoreFocusGrab $w $data(ent) withdraw @@ -96,7 +96,7 @@ proc ::tk::dialog::file::chooseDir::tkChooseDirectory {args} { # Return value to user # - return $tkPriv(selectFilePath) + return $Priv(selectFilePath) } # ::tk::dialog::file::chooseDir::Config -- @@ -182,9 +182,9 @@ proc ::tk::dialog::file::chooseDir::OkCmd {w} { # 4b. If the value is different from the current directory, change to # that directory. - set selection [tkIconList_Curselection $data(icons)] + set selection [tk::IconList_Curselection $data(icons)] if { [llength $selection] != 0 } { - set iconText [tkIconList_Get $data(icons) [lindex $selection 0]] + set iconText [tk::IconList_Get $data(icons) [lindex $selection 0]] set iconText [file join $data(selectPath) $iconText] ::tk::dialog::file::chooseDir::Done $w $iconText } else { @@ -220,9 +220,9 @@ proc ::tk::dialog::file::chooseDir::OkCmd {w} { proc ::tk::dialog::file::chooseDir::DblClick {w} { upvar ::tk::dialog::file::[winfo name $w] data - set selection [tkIconList_Curselection $data(icons)] + set selection [tk::IconList_Curselection $data(icons)] if { [llength $selection] != 0 } { - set text [tkIconList_Get $data(icons) [lindex $selection 0]] + set text [tk::IconList_Get $data(icons) [lindex $selection 0]] set file $data(selectPath) if {[file isdirectory $file]} { ::tk::dialog::file::ListInvoke $w $text @@ -250,13 +250,13 @@ proc ::tk::dialog::file::chooseDir::ListBrowse {w text} { # # Gets called when user has input a valid filename. Pops up a # dialog box to confirm selection when necessary. Sets the -# tkPriv(selectFilePath) variable, which will break the "tkwait" +# Priv(selectFilePath) variable, which will break the "vwait" # loop in tk_chooseDirectory and return the selected filename to the # script that calls tk_getOpenFile or tk_getSaveFile # proc ::tk::dialog::file::chooseDir::Done {w {selectFilePath ""}} { upvar ::tk::dialog::file::[winfo name $w] data - global tkPriv + variable ::tk::Priv if {[string equal $selectFilePath ""]} { set selectFilePath $data(selectPath) @@ -267,5 +267,5 @@ proc ::tk::dialog::file::chooseDir::Done {w {selectFilePath ""}} { return } } - set tkPriv(selectFilePath) $selectFilePath + set Priv(selectFilePath) $selectFilePath } |