PyGTK - Scale Class



This class acts as an abstract base class for HScale and VScale widgets. These widgets work as a slider control and select a numeric value.

The following methods of this abstract class are implemented by the HScale class and the VScale class −

  • set_digits() − This sets number of decimal places to be used to display instantaneous value of widget.

  • set_draw_value() − set to True, current value will be displayed next to the slider.

  • set_value_pos() − This is the position at which the values are drawn. This can be either gtk.POS_LEFT, gtk.POS_RIGHT, gtk.POS_TOP or gtk.POS_BOTTOM.

An object of gtk.HScale class provides a horizontal slider, whereas an object of gtk.VScale class provides vertical slider. Both classes have identical constructors −

gtk.HScale(Adjustment = None)
gtk.VScale(Adjustment = None)

The adjustment object contains many attributes that provide access to value and bounds.

Advertisements