npm

npm’s 2019 JavaScript ecosystem survey analysis is now available! Get your copy here »

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

Keywords

install

npm i starstuff

Downloadsweekly downloads

2

version

1.0.1

license

ISC

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability