Skip to content

Commit

Permalink
update README
Browse files Browse the repository at this point in the history
  • Loading branch information
maccman committed Jan 21, 2012
1 parent 15ddad6 commit ed1d446
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
Binary file not shown.
2 changes: 1 addition & 1 deletion MacGap/WindowController.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#import <Cocoa/Cocoa.h>
#import "ContentView.h"

@interface WindowController : NSWindowController{
@interface WindowController : NSWindowController {

}

Expand Down
20 changes: 19 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ Just clone the repository and build in Xcode. The file `public/index.html` is lo

MacGap exposes an object called `macgap` inside JavaScript. You can use it to alter the Dock icon and display Growl notifications, amongst other things. The API is documented below:

App:

// Quit application
macgap.app.terminate();

Expand All @@ -35,30 +37,46 @@ MacGap exposes an object called `macgap` inside JavaScript. You can use it to al

// System bell
macgap.app.beep();

// Open URL in default browser
macgap.app.open("http://google.com");

// Launch application
macgap.app.launch("TextEdit");

Window:

// Open a new window
macgap.window.open({url:'public/index2.html', width: 400, height: 300});
macgap.window.open({url:"public/index2.html", width: 400, height: 300});

// Resize window
macgap.window.resize({width: 400, height: 200});

// Move window (Bottom left is x:0 and y:0)
macgap.window.move({x:0, y: 200});

Path:

// Path to application
macgap.path.application;

// Path to application's resources
macgap.path.resource;

Dock:

// Set the Dock's badge
macgap.dock.badge = "10";

Sound:

// Play a sound
macgap.sound.play("./my/sound.mp3")

// Play a system sound
macgap.sound.playSystem("funk");

Growl:

// Send a Growl notification
macgap.growl.notify({
Expand Down

0 comments on commit ed1d446

Please sign in to comment.