class vanilla.ComboBox(posSize, items, completes=True, continuous=False, callback=None, formatter=None, sizeStyle='regular')

A text entry control that allows direct text entry or selection for a list of options.:

from vanilla import *

class ComboBoxDemo(object):

    def __init__(self):
        self.w = Window((100, 41))
        self.w.comboBox = ComboBox((10, 10, -10, 21),
                            ["AA", "BB", "CC", "DD"],

    def comboBoxCallback(self, sender):
        print "combo box entry!", sender.get()


posSize Tuple of form (left, top, width, height) representing the position and size of the combo box control. The size of the combo box sould match the appropriate value for the given sizeStyle.

Standard Dimensions
Regular H 21
Small H 17
Mini H 14

items The items to be displayed in the combo box.

completes Boolean representing if the combo box auto completes entered text.

continuous If True, the callback (if any) will be called upon each keystroke, if False, only call the callback when editing finishes or after item selection. Default is False.

callback The method to be called when the user enters text.

formatter An NSFormatter for controlling the display and input of the combo box.

sizeStyle A string representing the desired size style of the combo box. The options are:


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


Get the text entered in the combo box.


Return the NSComboBox that this object wraps.


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


Get the control title.


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 text in the text field of the combo box.

value A string to set in the combo box.


Set the items in the combo box list.

items A list of strings to set in the combo box list.


Set the postion and size of the object.

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


Set the control title.

title A string representing the title.


Show or hide the object.

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