Revision: 9730 http://pure-data.svn.sourceforge.net/pure-data/?rev=9730&view=rev Author: eighthave Date: 2008-04-27 21:48:44 -0700 (Sun, 27 Apr 2008)
Log Message: ----------- - first attempt at fixing bug #1927425, and cleaned up filetypes a bit in the process. no luck, so I posted on tcl-mac
- set default directory for new patches to be the home folder instead of pwd
- fixed bug in previous pdtk_pd_ctrlkey addition for Cmd-M minimizing
Modified Paths: -------------- branches/pd-extended/v0-40/pd/src/u_main.tk
Modified: branches/pd-extended/v0-40/pd/src/u_main.tk =================================================================== --- branches/pd-extended/v0-40/pd/src/u_main.tk 2008-04-28 04:14:00 UTC (rev 9729) +++ branches/pd-extended/v0-40/pd/src/u_main.tk 2008-04-28 04:48:44 UTC (rev 9730) @@ -79,6 +79,13 @@ } # end hidden files/folder hack ------------------
+# set file types that open/save recognize +set filetypes { + {{Pd Files (.pd)} {.pd} } + {{Max Text Files (.pat)} {.pat} } + {{All Files} * } +} + # Tearoff is set to true by default: set pd_tearoff 1
@@ -319,8 +326,11 @@ ############### set up global variables ################################
set untitled_number 1 -set untitled_directory [pwd] -set saveas_client doggy +if {$pd_nt == 1} { + set untitled_directory [regsub -all \\ $::env(USERPROFILE) /] +} else { + set untitled_directory $::env(HOME) +} set pd_opendir $untitled_directory set pd_undoaction no set pd_redoaction no @@ -414,10 +424,9 @@ ################## the "Open" menu command #########################
proc menu_open {} { - global pd_opendir + global pd_opendir filetypes set filename [tk_getOpenFile -defaultextension .pd \ - -filetypes { {{pd files} {.pd}} {{max files} {.pat}}} \ - -initialdir $pd_opendir] + -filetypes $filetypes -initialdir $pd_opendir] if {$filename != ""} {open_file $filename} }
@@ -2005,10 +2014,9 @@ ############ pdtk_canvas_saveas -- run a saveas dialog ##############
proc pdtk_canvas_saveas {name initfile initdir} { - global pd_nt - set filename [tk_getSaveFile -initialfile $initfile \ - -initialdir $initdir -defaultextension .pd \ - -filetypes { {{pd files} {.pd}} {{max files} {.pat}} }] + global pd_nt filetypes + set filename [tk_getSaveFile -initialfile $initfile -initialdir $initdir \ + -defaultextension .pd -filetypes $filetypes]
if {$filename != ""} { # yes, we need the extent even if we're on a mac. @@ -3636,6 +3644,7 @@ ############### event binding procedures for Pd window ################
proc pdtk_pd_ctrlkey {name key shift} { + global pd_nt # puts stderr [concat key $key shift $shift] # .dummy itemconfig goo -text [concat ---> control-key event $key]; if {$key == "n" || $key == "N"} {menu_new}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.