robotools / vanilla

A Pythonic wrapper around Cocoa.
MIT License
78 stars 28 forks source link

Code crash when using Box fillColor or borderColor #164

Closed HugoJourdan closed 10 months ago

HugoJourdan commented 2 years ago

Using fillColor or borderColor in Box Object make app crash. (Tested in drawBot and Glyphs3 Macro Panel)

from vanilla import Window, Box, TextBox

class BoxDemo:

    def __init__(self):
        self.w = Window((150, 70))
        self.w.box = Box((10, 10, -10, -10), fillColor=(0,0,1))
        self.w.box.text = TextBox((10, 10, -10, -10), "This is a box")
        self.w.open()

BoxDemo()
typemytype commented 2 years ago

the color has to be an NSColor object. AppKit.NSColor.colorWithRed_green_blue_alpha_(0, 0, 1, 1)

that is indeed not clear in the documentation. Could you make a PR for this?

thanks!