English 中文(简体)
PyGTK - Viewport Class
  • 时间:2024-09-17

PyGTK - Viewport Class


Previous Page Next Page  

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 capabipty 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 scrolpng support. But a Label or a gtk.Table widget doesn t have an in-built scrolpng 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.

Advertisements