]> gitweb.factorcode.org Git - factor.git/blobdiff - library/ui/cocoa/ui.factor
Got 'Save Image' and 'Save Image As' menu items working again
[factor.git] / library / ui / cocoa / ui.factor
index 626006a41936e519434931a7460080dc600f1354..43d0d3d3f8295c7879263757d49b62295618516c 100644 (file)
@@ -18,18 +18,29 @@ sequences errors freetype help ;
 : menu-run-files ( -- )
     open-panel [ listener-run-files ] when* ;
 
+: menu-save-image ( -- )
+    image save-panel [ save-image ] when* ;
+
 ! Handle Open events from the Finder
 "NSObject" "FactorApplicationDelegate" {
     { "application:openFiles:" "void" { "id" "SEL" "id" "id" }
         [ >r 3drop r> finder-run-files ]
     }
 
+    { "newFactorWorkspace:" "id" { "id" "SEL" "id" }
+        [ 3drop workspace-window f ]
+    }
+
     { "runFactorFile:" "id" { "id" "SEL" "id" }
         [ 3drop menu-run-files f ]
     }
 
-    { "newFactorWorkspace:" "id" { "id" "SEL" "id" }
-        [ 3drop workspace-window f ]
+    { "saveFactorImage:" "id" { "id" "SEL" "id" }
+        [ 3drop save f ]
+    }
+
+    { "saveFactorImageAs:" "id" { "id" "SEL" "id" }
+        [ 3drop menu-save-image f ]
     }
 
     { "showFactorHelp:" "id" { "id" "SEL" "id" }