gtk.Tooltips — add tips to your widgets.
class gtk.Tooltips(gtk.Object): |
Functions
def gtk.tooltips_data_get(widget
)
|
Tooltips are the messages that appear next to a widget when the
mouse pointer is held over it for a short amount of time. They are
especially helpful for adding more verbose descriptions of things such as
buttons in a toolbar. An individual tooltip belongs to a group of tooltips.
A group is created with a call to the gtk.Tooltips() constructor. Every
tooltip in the group can then be turned off with a call to the disable
()
method and enabled with the enable
()
method. To assign a tip to a particular gtk.Widget
, use the
set_tip
()
method.
Tooltips can only be set on widgets which have their own X
window. To check if a widget has its own window use
widget.flags()>k.NO_WINDOW
. To add a tooltip to a
widget that doesn't have its own window, place the widget inside a gtk.EventBox
and
add a tooltip to the eventbox instead.
The default appearance of all tooltips in a program is determined
by the current theme that the user has selected. Information about the
tooltip (if any) associated with an arbitrary widget can be retrieved using
the gtk.tooltips_data_get
()
function.
def enable()
The enable
() method enables a group of
tooltips. A tooltip will be displayed over its associated widget when
the mouse pointer pauses over the widget.
def disable()
The disable
() method disables a group
of tooltips. A tooltip will not be displayed over its associated widget when
the mouse pointer pauses over the widget.
def set_tip(widget
, tip_text
, tip_private
=None)
widget : | a gtk.Widget |
tip_text : | the tooltip text |
tip_private : | the tooltip private text for context sensitive display |
The set_tips
() method creates a tooltip
for the specified widget
. The text specified by
tooltip_text
will be displayed when the mouse pointer
pauses over widget
if the tooltips are
enabled..
def gtk.tooltips_data_get(widget
)
widget : | a widget |
Returns : | a tuple containing the tooltip data associated
with widget or
None |
The gtk.tooltips_data_get
() function
returns a tuple containing the tooltip data associated with
widget
. The tuple contains:
gtk.Tooltips
group
containing the tooltipNone
If widget
does not have an associated
tooltip this function returns None
.