gtk.Tooltips
gtk.Tooltips — add tips to your widgets.
Description
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.
Note
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.
Methods
gtk.Tooltips.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.
gtk.Tooltips.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.
gtk.Tooltips.set_tip
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..
gtk.Tooltips.force_window
The force_window() method ensures that
the window used for displaying the given tooltips is created. Applications
should never have to call this function, since PyGTK takes care of
this.
Functions
gtk.tooltips_data_get
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:
- the gtk.Tooltips group
containing the tooltip
- the widget
- the tooltip text string
- the tooltip private text string or
None
If widget does not have an associated
tooltip this function returns None.