Skip to content
Eon edited this page Jan 21, 2017 · 5 revisions

Hello world in Element

Swift code:

let style = Style("Button",[],[StyleProperty("fill",NSColor.blue)])
StyleManager.addStyle(style)
let btn = addSubView(Button(96,24))
func onClick(event:Event){
	if(event.type == ButtonEvent.upInside){Swift.print("Hello world")}
}
btn.event = onClick

Playground Demo:

img

Resources:

NSView in playground

Third party frameworks in playground

Clone this wiki locally