class vanilla.GradientButton(posSize, imagePath=None, imageNamed=None, imageObject=None, title=None, bordered=True, imagePosition='top', callback=None, sizeStyle='regular')
bind(key, modifiers)

Bind a key to the button.

key A single character or one of the following:


modifiers A list containing nothing or as many of the following as desired:


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


Return the NSButton 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.

setImage(imagePath=None, imageNamed=None, imageObject=None)

Set the image in the button.

imagePath A file path to an image.

imageNamed The name of an image already load as a NSImage by the application.

imageObject A NSImage object.

Only one of imagePath, imageNamed, imageObject should be set.


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.