ProgressBar

class vanilla.ProgressBar(posSize, minValue=0, maxValue=100, isIndeterminate=False, sizeStyle='regular')

A standard progress bar.:

from vanilla import *

class ProgressBarDemo(object):

    def __init__(self):
        self.w = Window((200, 65))
        self.w.bar = ProgressBar((10, 10, -10, 16))
        self.w.button = Button((10, 35, -10, 20), "Go!",
                            callback=self.showProgress)
        self.w.open()

    def showProgress(self, sender):
        import time
        self.w.bar.set(0)
        for i in range(10):
            self.w.bar.increment(10)
            time.sleep(.2)

ProgressBarDemo()

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

Standard Dimensions
Regular H 16
Small H 10

minValue The minimum value of the progress bar.

maxValue The maximum value of the progress bar.

isIndeterminate Boolean representing if the progress bar is indeterminate. Determinate progress bars show how much of the task has been completed. Indeterminate progress bars simply show that the application is busy.

sizeStyle A string representing the desired size style of the pregress bar. The options are:

“regular”
“small”
enable(onOff)

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

get()

Get the current value of the progress bar.

Only available in determinate progress bars.

getNSProgressIndicator()

Return the NSProgressIndicator that this object wraps.

getPosSize()

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

increment(value=1)

Increment the progress bar by value.

Only available in determinate progress bars.

isVisible()

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(value)

Set the value of the progress bar to value.

Only available in determinate progress bars.

setPosSize(posSize)

Set the postion and size of the object.

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

show(onOff)

Show or hide the object.

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

start()

Start the animation.

Only available in indeterminate progress bars.

stop()

Stop the animation.

Only available in indeterminate progress bars.