gtk.Widget — the base class for all PyGTK
widgets
Functionsdef gtk.widget_push_colormap(cmap)def gtk.widget_push_composite_child()def gtk.widget_pop_composite_child()def gtk.widget_pop_colormap()def gtk.widget_get_default_style()def gtk.widget_set_default_colormap(colormap)def gtk.widget_get_default_colormap()def gtk.widget_get_default_visual()def gtk.widget_set_default_direction(dir)def gtk.widget_get_default_direction()def gtk.widget_class_find_style_property(widget,property_name)def gtk.widget_class_list_style_properties(widget)def gtk.widget_class_install_style_property(widget,pspec)
|
|
|
def callback( | |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
"drag-end" | def callback( |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
"event" | def callback( |
def callback( | |
def callback( | |
"focus" | def callback( |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
"hide" | def callback( |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
"map" | def callback( |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
"realize" | def callback( |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
"show" | def callback( |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
def callback( | |
"unmap" | def callback( |
def callback( | |
def callback( | |
def callback( | |
def callback( |
The gtk.Widget class is
the base class for all PyGTK widgets. It provides the common set of method and signals for the widgets including:
gtk.Widget
introduces style properties - these are basically object properties that are
stored not on the object, but in the style object associated to the
widget. Style properties are set in resource files. This mechanism is used
for configuring such things as the location of the scrollbar arrows through
the theme, giving theme authors more control over the look of applications
without the need to write a theme engine in C.
Use the gtk.widget_class_install_style_property()
function to install style properties for a widget class, the gtk.widget_class_find_style_property()
function or the gtk.widget_class_list_style_properties()
function to get information about existing style properties and the
style_get_property()
method to obtain the value of a style property.
def get_allocation()Returns : | a gtk.gdk.Rectangle |
The get_allocation() method returns a
gtk.gdk.Rectangle containing the bounds of the widget's allocation.
def drag_check_threshold(start_x, start_y, current_x, current_y)
| the X coordinate of start of drag |
| the Y coordinate of start of drag |
| the current X coordinate |
| the current Y coordinate |
Returns : | True if the drag threshold
has been passed. |
The check_drag_threshold() method checks to see if a mouse drag
starting at (start_x, start_y)
and ending at (current_x,
current_y) has passed the+ drag threshhold distance,
and thus should trigger the beginning of a drag-and-drop operation.
def drag_get_data(context, target, time=0L)
| a gtk.gdk.DragContext |
| an atom |
| a timestamp or 0L to specify the current time |
The drag_get_data() method gets the
data associated with a drag specified by drag_context
and target. When the data is received or the
retrieval fails, a "drag_data_received" signal will be emitted. Failure of
the retrieval is indicated by the length field of the gtk.SelectionData
being negative. However, when the drag_get_data()
method is called implicitly because gtk.DRAG_DEFAULT_DROP
was set, the widget will not receive notification of failed drops.
def drag_highlight()The drag_highlight() method draws a
highlight around a widget. This will attach handlers to "expose_event" and
"draw", so the highlight will continue to be displayed until the drag_unhighlight()
method is called.
def drag_unhighlight()The drag_unhighlight() method removes
the highlight that was set by the drag_highlight()
method.