GithubHelp home page GithubHelp logo

cocui's Introduction

Cocui

COCoa User Interface mockup.

For rapidly building functional Cocoa applications using WebKit (HTML, CSS and JavaScript).

Download

Latest releases from http://hunch.se/cocui/

Cocui will keep itself up to date using Sparkle and requires Mac OS X 10.5 or later.

What awesome stuff can I do with this?

Everyone love bullet-points:

  • Write your app like a regular HTML page with javascript
  • Opening of files by associating your app with one or more file types
  • Retains the WebKit debugger, profiler, console and inspector developer tools
  • Unrestricted XHR (can load and interact with any resource on the web or local)
  • NSApplication events propagated as native Javascript events in your document (i.e. "applicationWillBecomeActive", etc)
  • Full control over window (resizing, minimizing, hiding, closing, etc through "App.window")
  • Full control over NSApp (terminating, etc through "App.app")
  • Access to NSUserDefaults (system-native application settings) through "App.defaults"
  • Single namespace exposes the "bridge" between Cocoa and Javascript -- "App"
  • Most of these things demonstrated in the demo app resources/index.html

The Javascript-to-Cocoa bridge enables access to most things, like your NSApplication and your NSWindow.

You can do stuff like this:

<a href="javascript:Win.miniaturize()">Minimize application</a>

and

var window = App.loadWindow({
  uri: 'index.html',
  rect: { size: { width: 500, height: 400 } }
})
window.makeKeyAndOrderFront();

Native drag and drop is already supported by WebKit.

Development mode

Development mode enables a series of tools, aiding development:

  • Interactive javascript console
  • DOM and CSS inspector
  • Javascript profiler
  • Javascript debugger
  • Resource tracker (aka "the timeline")
  • HTML5 database manager
  • Access to a streaming text log of messages both from your application (using console.log() etc) and from the runner core.
  • Quick restarting (reloading) of your app w/o restarting the actual process

To enable development mode for a Cocui application, set the boolean defaults key "DevelopmentMode" to true for.

Example:

$ defaults write my.cocui.app DevelopmentMode -bool yes

You need to restart the native app after changing this key. Afterwards, a new menu item will appear: "Develop".

When creating new application projects using the Cocui app, DevelopmentMode is already set for you.

Creating a new project

You create a new app project by running the Cocui application. Choose a name and a UTI (and optionally a few other things, like icon and document types). Cocui will then create a new project for you and get you going. If you have TextMate or SubEthaEdit, your editor will launch together with your new application.

cocui's People

Contributors

rsms avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.