class vanilla.Box(posSize, title=None)

A bordered container for other controls.

To add a control to a box, simply set it as an attribute of the box.:

from vanilla import *

class BoxDemo(object):

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


No special naming is required for the attributes. However, each attribute must have a unique name.

posSize Tuple of form (left, top, width, height) representing the position and size of the box.

title The title to be displayed dabove the box. Pass None if no title is desired.


Enable or disable the object. onOff should be a boolean.


Return the NSBox that this object wraps.


The position and size of the object as a tuple of form (left, top, width, height).


Get the title of the box.


Return a bool indicting if the object is visible or not.

move(x, y)

Move the object by x units and y units.

resize(width, height)

Change the size of the object to width and height.


Set the postion and size of the object.

posSize A tuple of form (left, top, width, height).


Set the title of the box.


Show or hide the object.

onOff A boolean value representing if the object should be shown or not.