diff options
Diffstat (limited to 'pd/tcl/apple_events.tcl')
-rw-r--r-- | pd/tcl/apple_events.tcl | 50 |
1 files changed, 31 insertions, 19 deletions
diff --git a/pd/tcl/apple_events.tcl b/pd/tcl/apple_events.tcl index cfc92982..0311add7 100644 --- a/pd/tcl/apple_events.tcl +++ b/pd/tcl/apple_events.tcl @@ -1,53 +1,65 @@ package provide apple_events 0.1 +package require pdwindow package require wheredoesthisgo # from http://wiki.tcl.tk/12987 set ::tk::mac::CGAntialiasLimit 0 ;# min line thickness to anti-alias (default: 3) -set ::tk::mac::antialiasedtext 1 ;# enable/disable anti-aliased text +set ::tk::mac::antialiasedtext 1 ;# enable anti-aliased text # kAEOpenDocuments proc ::tk::mac::OpenDocument {args} { - foreach filename $args { - puts "open_file $filename" - open_file $filename + foreach filename $args { + if {$::done_init} { + open_file $filename + } else { + lappend ::filestoopen_list $filename + } } set ::pd_menucommands::menu_open_dir [file dirname $filename] } # kEventAppHidden -proc ::tk::mac::OnHide {} { - # TODO +proc ::tk::mac::OnHide {args} { + ::pdwindow::verbose 1 "::tk::mac::OnHide $args +++++++++++++++++++++" } # kEventAppShown -proc ::tk::mac::OnShow {} { - # TODO +proc ::tk::mac::OnShow {args} { + ::pdwindow::verbose 1 "::tk::mac::OnShow $args +++++++++++++++++++++" +} + +# open About Pd... in Tk/Cocoa +proc tkAboutDialog {} { + menu_aboutpd } # kAEShowPreferences -proc ::tk::mac::ShowPreferences {} { - menu_preferences_dialog +proc ::tk::mac::ShowPreferences {args} { + ::pdwindow::verbose 1 "::tk::mac::ShowPreferences $args ++++++++++++" + pdsend "pd start-path-dialog" } # kAEQuitApplication -#proc ::tk::mac::Quit {} { -# # TODO sort this out... how to quit pd-gui after sending the message -# puts stderr "Custom exit proc" -# pdsend "pd verifyquit" +proc ::tk::mac::Quit {args} { + pdsend "pd verifyquit" +} + +# on Tk/Cocoa, override the Apple Help menu +#proc tk::mac::ShowHelp {args} { #} # these I gleaned by reading the source (tkMacOSXHLEvents.c) proc ::tk::mac::PrintDocument {args} { - # TODO what's $mytoplevel here?. I am guessing args would be the same as - # ::tk::mac::OpenDocument - #menu_print $mytoplevel + menu_print $::focused_window } -proc ::tk::mac::OpenApplication {} { +proc ::tk::mac::OpenApplication {args} { + ::pdwindow::verbose 1 "::tk::mac::OpenApplication $args ++++++++++++" } -proc ::tk::mac::ReopenApplication {} { +proc ::tk::mac::ReopenApplication {args} { + ::pdwindow::verbose 1 "::tk::mac::ReopenApplication $args ++++++++++" } |