From 18c47474a668d7bbbabd525686355c16a45f6ec4 Mon Sep 17 00:00:00 2001 From: Miller Puckette Date: Fri, 29 Jul 2005 19:01:22 +0000 Subject: 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 --- pd/src/u_main.tk | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'pd/src/u_main.tk') 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 \ -- cgit v1.2.1