diff options
author | Miller Puckette <millerpuckette@users.sourceforge.net> | 2005-07-29 19:01:22 +0000 |
---|---|---|
committer | Miller Puckette <millerpuckette@users.sourceforge.net> | 2005-07-29 19:01:22 +0000 |
commit | 18c47474a668d7bbbabd525686355c16a45f6ec4 (patch) | |
tree | 034625615da54aafc44661aabfcaf8f82578f007 /pd/src/u_main.tk | |
parent | 819bc4309313e32809dff7cfd99df930c5055082 (diff) |
Mac to work with tcl/tk 8.4.5; pd extension added automatically in saveas
bug fix writing aiff gfiles
bug fix (tcl error messages when starting open dialogs)
svn path=/trunk/; revision=3385
Diffstat (limited to 'pd/src/u_main.tk')
-rw-r--r-- | pd/src/u_main.tk | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/pd/src/u_main.tk b/pd/src/u_main.tk index 401b37d6..26545f98 100644 --- a/pd/src/u_main.tk +++ b/pd/src/u_main.tk @@ -1426,7 +1426,8 @@ proc pdtk_canvas_checkgeometry {topname} { } proc pdtk_canvas_click {name x y b f} { -# puts stderr [concat got $f] + global pd_nt + if {$pd_nt == 0} {focus $name} pd [canvastosym $name] mouse [$name canvasx $x] [$name canvasy $y] $b $f \; } @@ -1621,11 +1622,28 @@ set saveas_dir nowhere ############ 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}} }] if {$filename != ""} { +# yes, we need the extent even if we're on a mac. + if {$pd_nt == 2} { + if {[string last .pd $filename] < 0 && \ + [string last .PD $filename] < 0 && \ + [string last .pat $filename] < 0 && \ + [string last .PAT $filename] < 0} { + set filename $filename.pd + if {[file exists $filename]} { + set answer [tk_messageBox \ + \-message [concat overwrite $filename "?"] \ + \-type yesno \-icon question] + if {$answer == no} {return} + } + } + } + set directory [string range $filename 0 \ [expr [string last / $filename ] - 1]] set basename [string range $filename \ |