Package stripchart :: Module vgradescale :: Class VGradeScale
[show private | hide private]
[frames | no frames]

Class VGradeScale

Known Subclasses:
VGradeZoom

Widget that displays a vertical graduated scale.

This widget provides a vertical scale that uses a gtk.Adjustment as its data model. The value of the adjustment is interpreted as the lower value displayed, while the page_size of the adjustment is the range that is displayed. ie:
       lower bound shown on scale = value
       upper bound shown on scale = value + page_size
For example, the following code sets the vertical range so that its minimum displayed value is -200.0 and its maximum displayed value is 200.0:
>>> import gtk, vgradescale
>>> v = vgradescale.VGradeScale()
>>> v.adjustment = gtk.Adjustment(-200, -1000, 1000, 1, 10, 400)
The widget is based upon gtk.DrawingArea. Because PyGTK widgets cannot be subclassed and used directly, the gtk.DrawingArea is stored in a class variable called widget.
Method Summary
  __init__(self, adjustment)
Initializes the widget.
  __delattr__(self, name)
Delete attributes method.
  __setattr__(self, name, value)
Set attributes method.
  set_adjustment(self, adjustment)
Set the gtk.Adjustment used as the data model.
  set_bgcolor(self, color)
Set the background color of the component.

Instance Variable Summary
gtk.Adjustment adjustment: Data model for the component.
Tuple of (r, g, b) values in the range from 0 to
bgcolor: Background color of the component.
gtk.DrawingArea widget: Read only pseudo-parent widget of the class.

Method Details

__init__(self, adjustment=None)
(Constructor)

Initializes the widget.
Parameters:
adjustment - gtk.Adjustment used as the data model for the scale. If no adjustment is given then a default is created.
           (type=gtk.Adjustment)

__delattr__(self, name)

Delete attributes method.

__setattr__(self, name, value)

Set attributes method.

set_adjustment(self, adjustment)

Set the gtk.Adjustment used as the data model.

If adjustment is None then a new, default adjustment is created.

This method is equivalent to setting:
       object.adjustment = adjustment
EG:
>>> import gtk, vgradescale
>>> v = vgradescale.VGradeScale()
>>> a1 = gtk.Adjustment()
>>> a2 = gtk.Adjustment()
>>> v.set_adjustment(a1)
>>> v.adjustment is a1
1

>>> v.adjustment = a2
>>> v.adjustment is a2
1

>>> v.adjustment is a1
0
Parameters:
adjustment - gtk.Adjustment to use as the data model.
           (type=gtk.Adjustment)

set_bgcolor(self, color)

Set the background color of the component.

Color should be of the tuple form: (r, g, b) where r, g, b are in the range 0 to 65535.

This method is equivalent to setting:
       object.bgcolor = (r, g, b)
EG:
>>> import vgradescale
>>> v = vgradescale.VGradeScale()
>>> v.bgcolor
(65535, 65535, 65535)

>>> v.set_bgcolor((1, 2, 3))
>>> v.bgcolor
(1, 2, 3)

>>> v.bgcolor = (1000, 2000, 3000)
>>> v.bgcolor
(1000, 2000, 3000)
Parameters:
color - Background color of the component.
           (type=(r, g, b) tuple. Elements in range 0 to 65535.)

Instance Variable Details

adjustment

Data model for the component.
Type:
gtk.Adjustment

bgcolor

Background color of the component.
Type:
Tuple of (r, g, b) values in the range from 0 to

widget

Read only pseudo-parent widget of the class.
Type:
gtk.DrawingArea

Generated by Epydoc 2.0 on Sat Oct 25 11:04:43 2003 http://epydoc.sf.net