Skip to content

Instantly share code, notes, and snippets.

@okay-type
Created August 7, 2014 18:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save okay-type/9127e72b8b77ef8a4e36 to your computer and use it in GitHub Desktop.
Save okay-type/9127e72b8b77ef8a4e36 to your computer and use it in GitHub Desktop.
Making a window with a color box in RoboFont with vanilla
from vanilla import Window, Box
from defconAppKit.windows.baseWindow import BaseWindowController
from AppKit import NSColor, NSView, NSRectFill
class BigBox(BaseWindowController):
def __init__(self):
## create window
self.w = Window((720, 600), "color box", minSize=(72, 86))
## add a vanilla.Box
self.w.bg = Box((10, 10, -10, -10))
## make the box red
###
## this part isn't working
## how should I be doing it?
##
self.w.bg._nsObject.setBackgroundColor_(NSColor.redColor())
self.w.open()
BigBox()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment