Friday, July 20, 2018

PyGTK - Viewport Class

PyGTK - Viewport Class


 If a widget has an area larger than that of the toplevel window, it is associated with a ViewPort container. A gtk.Viewport widget provides adjustment capability to be used in a ScrolledWindow. A Label widget for instance, doesn't have any adjustments. Hence it needs a Viewport. Some widgets have a native scrolling support. But a Label or a gtk.Table widget doesn't have an in-built scrolling support. Hence they must use Viewport.
ViewPort class has the following constructor −
gtk.Viewport(hadj, vadj)
Here, hadj and vadj are the adjustment objects associated with the viewport.
gtk.ViewPort class uses the following methods −
  • Viewport.set_hadjustment() − This sets the "hadjustment" property
  • Viewport.set_vadjustment() − This sets the "vadjustment" property
  • Viewport.set_shadow_type() − This sets the "shadow-type" property to the value of type. The value of type must be one of −
    • gtk.SHADOW_NONE
    • gtk.SHADOW_IN
    • gtk.SHADOW_OUT
    • gtk.SHADOW_ETCHED_IN
    • gtk.SHADOW_ETCHED_OUT
The gtk.Viewport object emits the set-scroll-adjustments signal when one or both of the horizontal and vertical gtk.Adjustment objects is changed.

No comments:

Post a Comment