gtk.Tooltips
gtk.Tooltips — add tips to your widgets.
Synopsis
class gtk.Tooltips(gtk.Object): |
Functions
def gtk.tooltips_data_get(widget
)
Attributes
|
Description
Warning
This method is deprecated in PyGTK 2.12 and above
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.
Constructor
gtk.Tooltips()
Returns : | a new gtk.Tooltips
object |
Warning
This method is deprecated in PyGTK 2.12 and above
Creates an empty gtk.Tooltips
group.
Methods
gtk.Tooltips.enable
def enable()
Warning
This method is deprecated in PyGTK 2.12 and above
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
def disable()
Warning
This method is deprecated in PyGTK 2.12 and above
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)
| a gtk.Widget |
| the tooltip text |
| the tooltip private text for context sensitive display |
Warning
This method is deprecated in PyGTK 2.12 and above
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..
Functions
gtk.tooltips_data_get
def gtk.tooltips_data_get(widget
)
| a widget |
Returns : | a tuple containing the tooltip data associated
with widget or
None |
Warning
This method is deprecated in PyGTK 2.12 and above
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
.