hildon.Controlbar

hildon.Controlbar

A widget that allows increasing or decreasing a value within a pre-defined range.

Description

hildon.Controlbar is a horizontally positioned widget that allows increasing or decreasing a value within a pre-defined range. The amount of steps in a hildon.Controlbar can be changed.

Ancestry

Up to the first non-hildon ancestor:

...
 +-- gtk.Scale
      +-- hildon.Controlbar

Usage Example

import gtk
import hildon

def control_changed(widget, label):
    label.set_text("Min:%s | Current: %s | Max:%s" %
                   (widget.get_min(), widget.get_value(), widget.get_max()))

window = hildon.Window()
window.set_title("Test App")

label = gtk.Label()

controlbar = hildon.Controlbar(0, 50, 15)
controlbar.connect("value-changed", control_changed, label)

control_changed(controlbar, label) #Init label text

vbox = gtk.VBox(False, 10)
vbox.pack_start (controlbar)
vbox.pack_start (label)
window.add(vbox)

window.show_all()

gtk.main()
      

Properties

Name Access Description
"min" Read/Write Smallest possible value.
"max" Read/Write Greatest possible value.
"value" Read/Write Current value.

Style Properties

Name Access Description
"inner_border_width" Read The border spacing between the controlbar border and controlbar blocks.

Constructor

Creates a new hildon.Controlbar widget.

hildon.Controlbar(min, max, value)
min (optional) Minimum value.
max (optional) Maximum value.
value (optional) Initial value.
Returns A new hildon.Controlbar widget.

Methods

get_value

Accessor method for getting its current value.

hildon.Controlbar.get_value()
Returns Its current value.

set_value

Accessor method for changing its current value.

hildon.Controlbar.set_value(value)
value Its current value.

get_min

Accessor method for getting its minimum value.

hildon.Controlbar.get_min()
Returns Its minimum value.

set_min

Accessor method for changing its minimum value.

hildon.Controlbar.set_min(min)
min Its minimum value.

get_max

Accessor method for getting its maximum value.

hildon.Controlbar.get_max()
Returns Its maximum value.

set_max

Accessor method for changing its maximum value.

hildon.Controlbar.set_max(max)
max Its maximum value.

set_range

Set its range, that is, both its maximum and minimum values.

hildon.Controlbar.set_range(min, max)
min Its minimum value.
max Its maximum value.


Improve this page