sub view
  dim o as NSWindow
  dim v as NSView
  o=new NSWindow(WithContentRect:[[50, 50], [200.0, 200.0]], styleMask:7, backing:2, defer:false)
  o.setTitle("Window Title")
  o.orderFront(nil)	// make visible
  v=new NSButton(WithFrame:[[50, 50], [100.0, 100.0]])
  v.setTitle("Close this window")
  v.setAction("performClose:")
  v.setTarget(o)
  o. setContentView(v)
  msgbox "quit"	// pause until user action
end sub