Reference Manual

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Compound List | File List | Namespace Members | Compound Members | File Members

# Inti::Gtk::Tooltips Class Reference

A GtkTooltips C++ wrapper class. More...

`#include <inti/gtk/tooltips.h>`

Inheritance diagram for Inti::Gtk::Tooltips:

List of all members.

## Accessors

- GtkTooltips * gtk_tooltips () const
    Get a pointer to the GtkTooltips structure.
- GtkTooltipsClass * gtk_tooltips_class () const
    Get a pointer to the GtkTooltipsClass structure.
- operator GtkTooltips * () const
    Conversion operator; safely converts a Tooltips to a GtkTooltips pointer.
- bool is_enabled () const
    Returns true if tooltips are enabled.
- TooltipsData * data_get (Widget &widget)
    Retrieves any TooltipsData previously associated with the given widget.

## Public Member Functions

Constructors

- Tooltips ()
    Constructs an empty group of tooltips.
- virtual ~Tooltips ()
    Destructor.

Methods

- void enable ()
    Allows the user to see your tooltips as they navigate your application.
- void disable ()
    Causes all tooltips in tooltips to become inactive.
- void set_tip (Widget &widget, const String &tip_text, const String &tip_private=0)
    Adds a tooltip containing the message tip_text to the specified Widget.
- void unset_tip (Widget &widget)
    Unsets any previously set tooltip associated with widget.
- void force_window ()
    Ensures that the window used for displaying the given tooltips is created.

## Protected Member Functions

Constructors

- Tooltips (GtkTooltips *tooltips, bool reference=false)
    Construct a new Tooltips from an existing GtkTooltips.

## Detailed Description

A GtkTooltips C++ wrapper class.

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 the default constructor Tooltips(). Every tooltip in the group can then be turned off with a call to disable() and enabled with enable(). To assign a tip to a particular Widget, set_tip() is used.

Note, Tooltips can only be set on widgets which have their own X window. To check if a widget has its own window use Gtk::Widget::has_no_window(). To add a tooltip to a widget that doesn't have its own window, place the widget inside an EventBox and add a tooltip to that instead.

The default appearance of all tooltips in a program is determined by the current GTK+ theme that the user has selected. Information about the tooltip (if any) associated with an arbitrary widget can be retrieved using data_get().

## Constructor & Destructor Documentation

Inti::Gtk::Tooltips::Tooltips | ( | GtkTooltips * | tooltips,
|  | bool | reference = false
| ) | `[explicit, protected]`

  | Construct a new Tooltips from an existing GtkTooltips. Parameters:
  tooltips | A pointer to a GtkTooltips.
  reference | Set false if the initial reference count is floating, set true if it's not.
The tooltips can be a newly created GtkTooltips or an existing GtkTooltips (see G::Object::Object).

## Member Function Documentation

TooltipsData* Inti::Gtk::Tooltips::data_get | ( | Widget & | widget | ) | `[static]`

  | Retrieves any TooltipsData previously associated with the given widget. Parameters:
  widget | A Widget.
Returns: A TooltipsData object, or null if the widget has no tooltip.

void Inti::Gtk::Tooltips::disable | ( |  | ) |

| Causes all tooltips in tooltips to become inactive. Any widgets that have tips associated with that group will no longer display their tips until they are enabled again with enable().

void Inti::Gtk::Tooltips::force_window | ( |  | ) |

| Ensures that the window used for displaying the given tooltips is created. Applications should never have to call this method, since GTK+ takes care of this.

void Inti::Gtk::Tooltips::set_tip | ( | Widget & | widget,
|  | const String & | tip_text,
|  | const String & | tip_private = 0
| ) |

  | Adds a tooltip containing the message tip_text to the specified Widget. Parameters:
  widget | The Widget you wish to associate the tip with.
  tip_text | A string containing the tip itself.
  tip_private | A string of any further information that may be useful if the user gets stuck.

void Inti::Gtk::Tooltips::unset_tip | ( | Widget & | widget | ) |

  | Unsets any previously set tooltip associated with widget. Parameters:
  widget | A Widget.

The documentation for this class was generated from the following file:

- tooltips.h

Main Page - Footer