From 282671282b20fa17ab9dbbaba9d1cf2246b5029d Mon Sep 17 00:00:00 2001 From: Miller Puckette Date: Mon, 17 Aug 2009 23:31:36 +0000 Subject: merge in new tcl implementation by Steiner & Chun svn path=/trunk/; revision=11934 --- pd/tcl/apple_events.tcl | 53 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 pd/tcl/apple_events.tcl (limited to 'pd/tcl/apple_events.tcl') diff --git a/pd/tcl/apple_events.tcl b/pd/tcl/apple_events.tcl new file mode 100644 index 00000000..b52dcdba --- /dev/null +++ b/pd/tcl/apple_events.tcl @@ -0,0 +1,53 @@ + +package provide apple_events 0.1 + +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 + +# kAEOpenDocuments +proc ::tk::mac::OpenDocument {args} { + foreach filename $args { + puts "open_file $filename" + open_file $filename + } + set ::pd_menucommands::menu_open_dir [file dirname $filename] +} + +# kEventAppHidden +proc ::tk::mac::OnHide {} { + # TODO +} + +# kEventAppShown +proc ::tk::mac::OnShow {} { + # TODO +} + +# kAEShowPreferences +proc ::tk::mac::ShowPreferences {} { + menu_preferences_panel +} + +# 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" +#} + +# 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 +} + +proc ::tk::mac::OpenApplication {} { +} + +proc ::tk::mac::ReopenApplication {} { +} -- cgit v1.2.1