Package stripchart :: Module vgrade :: Class VGrade
[show private | hide private]
[frames | no frames]

Class VGrade


Widget that shows a zoomable, scrollable vertical scale.

This class is a composite megawidget in the form of a graduated, interactive vertical numerical scale that is both zoomable and scrollable. The zoom is adjusted by dragging in the scale region of the widget to the left, whereas the widget can be scrolled by dragging in the trackbar on the right. Both regions of the widget hilight when the mouse is moved over them, to hint to the user that interaction is possible.

The widget is composed of a VGradeZoom widget and a gtk.DrawingArea widget. These widgets are packaged within a gtk.HBox widget.

The data model of the VGrade widget is a gtk.Adjustment object. The interpretation of the adjustment is as follows: The value of the adjustment is the minimum value displayed on the widget. The maximum value displayed on the widget is the value plus the page_size of the adjustment. The widget will not allow the user to change the adjustment so that any part of the display lies outside the range from the lower to upper values of the adjustment.

The underlying gtk.HBox widget container can be accessed via the special widget attribute. This attribute cannot be changed nor deleted.

See Also: VGradeZoom

Method Summary
  __init__(self, adjustment)
Initializes the widget.
  __delattr__(self, name)
Delete attributes method.
  __getattr__(self, name)
Get attributes method.
  __setattr__(self, name, value)
Set attributes method.
  set_adjustment(self, adjustment)
Set the adjustment used as the data model.
  __bar_expose_handler(self, widget, event)
Handles the expose event for the dragbar.
  __bar_motion_notify_handler(self, widget, event)
Handles notification of mouse motion within the dragbar.
  __button_press_handler(self, widget, event)
Handler for dragbar mouse button press events.
  __button_release_handler(self, widget, event)
Handler for dragbar mouse button release events.
  __enter_notify_handler(self, widget, event)
Handler for enter events on the dragbar.
  __init_barGC(self)
Initializes the GC for drawing the dragbar.
  __leave_notify_handler(self, widget, event)
Handler for leave events on the dragbar.
  __set_bar_color(self, color)
Sets the color of the drag bar.

Instance Variable Summary
gtk.Adjustment adjustment: Adjustment data model for controlling the range of the widget.
gtk.HBox widget: Read-only pseudo-parent widget.

Method Details

__init__(self, adjustment=None)
(Constructor)

Initializes the widget.
Parameters:
adjustment - Data model for controlling the vertical range shown by the widget. If adjustment is None then a default gtk.Adjustment is created.
           (type=gtk.Adjustment)

__delattr__(self, name)

Delete attributes method.

__getattr__(self, name)
(Qualification operator)

Get attributes method.

__setattr__(self, name, value)

Set attributes method.

set_adjustment(self, adjustment)

Set the 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, vgrade
>>> v = vgrade.VGrade()
>>> 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 - Data model to control the range of the widget.
           (type=gtk.Adjustment)

__bar_expose_handler(self, widget, event)

Handles the expose event for the dragbar.

__bar_motion_notify_handler(self, widget, event)

Handles notification of mouse motion within the dragbar.

__button_press_handler(self, widget, event)

Handler for dragbar mouse button press events.

__button_release_handler(self, widget, event)

Handler for dragbar mouse button release events.

__enter_notify_handler(self, widget, event)

Handler for enter events on the dragbar.

__init_barGC(self)

Initializes the GC for drawing the dragbar.

__leave_notify_handler(self, widget, event)

Handler for leave events on the dragbar.

__set_bar_color(self, color)

Sets the color of the drag bar.

This method is used internally within the class to cause hilighting of the drag bar and is not intended for general use.
Parameters:
color - Color of the component.
           (type=Tuple of the form (r, g, b) where r, g and b are the red, green and blue components of the color respectively and lie within the range from 0 to 65535.)

Instance Variable Details

adjustment

Adjustment data model for controlling the range of the widget.
Type:
gtk.Adjustment

widget

Read-only pseudo-parent widget.
Type:
gtk.HBox

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