gtk.Viewport — a widget displaying a portion of a larger widget.
class gtk.Viewport(gtk.Bin): |
+--gobject.GObject +-- gtk.Object +-- gtk.Widget +-- gtk.Container +-- gtk.Bin +-- gtk.Viewport
|
gtk.Container Signal Prototypes
def callback( |
A gtk.Viewport
widget provides a view into a portion of a larger widget. A gtk.Viewport
is
usually used to provide adjustment capability for a widget to be used in a
gtk.ScrolledWindow
.
For example, a label widget doesn't have any adjustments (does not support
the "set-scroll-adjustments" signal) and would need a viewport when added to
a gtk.ScrolledWindow
to make the scrollbars functional. See the gtk.ScrolledWindow.add_with_viewport
()
method for more information.
gtk.Viewport(hadjustment
=None, vadjustment
=None)
| a horizontal adjustment. |
| a vertical adjustment. |
Returns : | a new gtk.Viewport
widget |
Creates a new gtk.Viewport
with
the horizontal and vertical adjustments specified by
hadjustment
and vadjustment
respectively. If hadjustment
or
vadjustment
is None
a new
adjustment will be created.
def get_hadjustment()
Returns : | the horizontal adjustment |
The get_hadjustment
() method returns
the value of the "hadjustment" property that contains the horizontal gtk.Adjustment
of the viewport.
def get_vadjustment()
Returns : | the vertical adjustment |
The get_vadjustment
() method returns
the value of the "vadjustment" property that contains the vertical gtk.Adjustment
of the viewport.
def set_hadjustment(adjustment
)
| a gtk.Adjustment . |
The set_hadjustment
() method sets the
"hadjustment" property to the value of adjustment
that becomes the horizontal adjustment of the viewport.
def set_vadjustment(adjustment
)
| a gtk.Adjustment . |
The set_vadjustment
() method sets the
"vadjustment" property to the value of adjustment
that becomes the vertical adjustment of the viewport.
def set_shadow_type(type
)
| the new shadow type. |
The set_shadow_type
() method 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
def get_shadow_type()
Returns : | the shadow type |
The get_shadow_type
() method returns
the value of the "shadow-type" property that contains the shadow type of the
gtk.Viewport
. See
the set_shadow_type
()
method for more information.
def get_bin_window()
Returns : | a gtk.gdk.Window . |
This method is available in PyGTK 2.22 and above.
The get_bin_window
() method gets the bin window of the viewport.
def get_view_window()
Returns : | a a gtk.gdk.Window . |
This method is available in PyGTK 2.22 and above.
The get_view_window
() method gets the view window of the viewport.
def callback(viewport
, hadjustment
, vadjustment
, user_param1
, ...
)
| the viewport that received the signal |
| the horizontal gtk.Adjustment |
| the vertical gtk.Adjustment |
| the first user parameter (if any) specified
with the connect () |
| additional user parameters (if any) |
The "set-scroll-adjustments" signal is emitted when one or both
of the horizontal and vertical gtk.Adjustment
objects is changed.