starstuff

1.0.1 • Public • Published

Starstuff

A UI library for JXA

NOTE: This is a new project and under heavy development, just figuring things out right now.

Why?

The code required to build UIs using Cocoa can be quite verbose. Startstuff provides a familiar, chainable API for creating those UIs.

Installation

npm install --save starstuff

Usage

import starstuff from 'starstuff';
 
// Create a new NSWindow. `$mainWindow` is a Starstuff object.
// Startstuff does not prevent access to original Cocoa
// objects, they are stored in the `el` property.
// ex; $mainWindow.el
var $mainWindow = starstuff.window({
  title: 'Choose an Image Window',
  rect: [0, 0, 600, 85]
}).delegate(appDelegate);
 
$mainWindow.append(starstuff.fieldLabel({
  id: 'fileFieldLabel',
  value: 'Image: (jpg, png, or gif):',
  rect: [25, ($mainWindow.height() - 40), 200, 24]
}))
.append(starstuff.textField({
  id: 'fileField',
  editable: false,
  rect: [25, ($mainWindow.height() - 60), 350, 24]
}))
.append(starstuff.button({
  id: 'chooseButton',
  title: 'Choose an image...',
  rect: [375, ($mainWindow.height() - 62), 150, 25],
  target: appDelegate,
  action: 'click'
}));

API Reference

window({options})

fieldLabel({options})

textField({options})

button({options})

image({options})

openPanel({options})

Contributing

npm install

To compile the source–written using es6–with Babel run:

npm run build

To recompile as you make changes run:

npm run watch

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    0
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i starstuff

Weekly Downloads

0

Version

1.0.1

License

ISC

Last publish

Collaborators

  • thegaw