Main Page Widgets Namespaces Book

# Gtk::StatusIcon Class Reference

Inheritance diagram for Gtk::StatusIcon:

[legend]
List of all members.

## Detailed Description

The "system tray" or notification area is normally used for transient icons that indicate some special state.

For example, a system tray icon might appear to tell the user that they have new mail, or have an incoming instant message, or something along those lines. The basic idea is that creating an icon in the notification area is less annoying than popping up a dialog.

A StatusIcon object can be used to display an icon in a "system tray". The icon can have a tooltip, and the user can interact with it by activating it or popping up a context menu. Critical information should not solely be displayed in a StatusIcon, since it may not be visible (e.g. when the user doesn't have a notification area on his panel). This can be checked with is_embedded().

On X11, the implementation follows the freedesktop.org "System Tray" specification. Implementations of the "tray" side of this specification can be found e.g. in the GNOME and KDE panel applications.

Since gtkmm 2.10:

## Public Member Functions

bool | get_blinking () const
bool | get_geometry (Glib::RefPtr<Gdk::Screen>& screen, Gdk::Rectangle& area, Orientation& orientation)
| Obtains information about the location of the status icon on screen.
Glib::ustring | get_icon_name () const
Glib::RefPtr<const Gdk::Pixbuf> | get_pixbuf () const
Glib::RefPtr<Gdk::Pixbuf> | get_pixbuf ()
int | get_size () const
StockID | get_stock () const
ImageType | get_storage_type () const
bool | get_visible () const
const GtkStatusIcon* | gobj () const
| Provides access to the underlying C GObject.
GtkStatusIcon* | gobj ()
| Provides access to the underlying C GObject.
GtkStatusIcon* | gobj_copy ()
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
bool | is_embedded () const
Glib::PropertyProxy_ReadOnly< bool > | property_blinking () const
| Whether or not the status icon is blinking.
Glib::PropertyProxy<bool> | property_blinking ()
| Whether or not the status icon is blinking.
Glib::PropertyProxy_WriteOnly< std::string > | property_file ()
| Filename to load and display.
Glib::PropertyProxy_ReadOnly< Glib::ustring > | property_icon_name () const
| The name of the icon from the icon theme.
Glib::PropertyProxy<Glib::ustring> | property_icon_name ()
| The name of the icon from the icon theme.
Glib::PropertyProxy_ReadOnly< Glib::RefPtr<Gdk::Pixbuf >> | property_pixbuf () const
| A GdkPixbuf to display.
Glib::PropertyProxy< Glib::RefPtr< Gdk::Pixbuf > > | property_pixbuf ()
| A GdkPixbuf to display.
Glib::PropertyProxy_ReadOnly< int > | property_size () const
| The size of the icon.
Glib::PropertyProxy_ReadOnly< StockID > | property_stock () const
| Stock ID for a stock image to display.
Glib::PropertyProxy<StockID> | property_stock ()
| Stock ID for a stock image to display.
Glib::PropertyProxy_ReadOnly< ImageType > | property_storage_type () const
| The representation being used for image data.
void | set (const Glib::ustring& icon_name)
void | set (const StockID& stock_id)
void | set (const Glib::RefPtr<Gdk::Pixbuf>& pixbuf)
void | set_blinking (bool blinking=true)
void | set_from_file (const Glib::ustring& filename)
void | set_tooltip (const Glib::ustring& tooltip_text)
void | set_visible (bool visible=true)
virtual | ~StatusIcon ()

## Static Public Member Functions

static Glib::RefPtr<StatusIcon> | create (const Glib::ustring& icon_name)
static Glib::RefPtr<StatusIcon> | create (const StockID& stock_id)
static Glib::RefPtr<StatusIcon> | create (const Glib::RefPtr<Gdk::Pixbuf>& pixbuf)
| Creates a new Gtk::StatusIcon object.
static Glib::RefPtr<StatusIcon> | create_from_file (const std::string& filename)
| Creates a status icon displaying the file filename.

## Protected Member Functions

| StatusIcon (const Glib::ustring& icon_name)
| StatusIcon (const StockID& stock)
| StatusIcon (const Glib::RefPtr<Gdk::Pixbuf>& pixbuf)
| StatusIcon ()

## Related Functions

(Note that these are not member functions.)
Glib::RefPtr<Gtk::StatusIcon> | wrap (GtkStatusIcon* object, bool take_copy=false)

## Constructor & Destructor Documentation

virtual Gtk::StatusIcon::~StatusIcon | ( |  | ) | `[virtual]`

Gtk::StatusIcon::StatusIcon | ( |  | ) | `[protected]`

Gtk::StatusIcon::StatusIcon | ( | const Glib::RefPtr<Gdk::Pixbuf>& | pixbuf | ) | `[explicit, protected]`

Gtk::StatusIcon::StatusIcon | ( | const StockID& | stock | ) | `[explicit, protected]`

Gtk::StatusIcon::StatusIcon | ( | const Glib::ustring& | icon_name | ) | `[explicit, protected]`

## Member Function Documentation

static Glib::RefPtr<StatusIcon> Gtk::StatusIcon::create | ( | const Glib::ustring& | icon_name | ) | `[static]`

static Glib::RefPtr<StatusIcon> Gtk::StatusIcon::create | ( | const StockID& | stock_id | ) | `[static]`

static Glib::RefPtr<StatusIcon> Gtk::StatusIcon::create | ( | const Glib::RefPtr<Gdk::Pixbuf>& | pixbuf | ) | `[static]`

Creates a new Gtk::StatusIcon object.

Returns:
  A Glib::RefPtr<> to a newly created Gtk::StatusIcon object.

static Glib::RefPtr<StatusIcon> Gtk::StatusIcon::create_from_file | ( | const std::string& | filename | ) | `[static]`

Creates a status icon displaying the file filename.

The image will be scaled down to fit in the available space in the notification area, if necessary.

Parameters:

  | filename | A filename.

Returns:
  A new StatusIcon

Since gtkmm 2.10:

bool Gtk::StatusIcon::get_blinking | ( |  | ) | const

bool Gtk::StatusIcon::get_geometry | ( | Glib::RefPtr<Gdk::Screen>& | screen,
|  | Gdk::Rectangle& | area,
|  | Orientation& | orientation
| ) |

Obtains information about the location of the status icon on screen.

This information can be used to e.g. position popups like notification bubbles. See gtk_status_icon_position_menu() for a more convenient alternative for positioning menus.

Note that some platforms do not allow GTK+ to provide this information.

Parameters:

  | screen,: | The screen.
  | area | The area occupied by the status icon.
  | orientation | The orientation of the panel in which the status icon is embedded. A panel at the top or bottom of the screen is horizontal, a panel at the left or right is vertical.

Returns:
  true if the location information has been filled in.

Since gtkmm 2.10:

Glib::ustring Gtk::StatusIcon::get_icon_name | ( |  | ) | const

Glib::RefPtr<const Gdk::Pixbuf> Gtk::StatusIcon::get_pixbuf | ( |  | ) | const

Glib::RefPtr<Gdk::Pixbuf> Gtk::StatusIcon::get_pixbuf | ( |  | ) |

int Gtk::StatusIcon::get_size | ( |  | ) | const

StockID Gtk::StatusIcon::get_stock | ( |  | ) | const

ImageType Gtk::StatusIcon::get_storage_type | ( |  | ) | const

bool Gtk::StatusIcon::get_visible | ( |  | ) | const

const GtkStatusIcon* Gtk::StatusIcon::gobj | ( |  | ) | const`[inline]`

| Provides access to the underlying C GObject. Reimplemented from Glib::ObjectBase.

GtkStatusIcon* Gtk::StatusIcon::gobj | ( |  | ) | `[inline]`

| Provides access to the underlying C GObject. Reimplemented from Glib::ObjectBase.

GtkStatusIcon* Gtk::StatusIcon::gobj_copy | ( |  | ) |

| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

bool Gtk::StatusIcon::is_embedded | ( |  | ) | const

Glib::PropertyProxy_ReadOnly<bool> Gtk::StatusIcon::property_blinking | ( |  | ) | const

Whether or not the status icon is blinking.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<bool> Gtk::StatusIcon::property_blinking | ( |  | ) |

Whether or not the status icon is blinking.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_WriteOnly<std::string> Gtk::StatusIcon::property_file | ( |  | ) |

Filename to load and display.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<Glib::ustring> Gtk::StatusIcon::property_icon_name | ( |  | ) | const

The name of the icon from the icon theme.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<Glib::ustring> Gtk::StatusIcon::property_icon_name | ( |  | ) |

The name of the icon from the icon theme.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<Glib::RefPtr<Gdk::Pixbuf>> Gtk::StatusIcon::property_pixbuf | ( |  | ) | const

A GdkPixbuf to display.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<Glib::RefPtr<Gdk::Pixbuf>> Gtk::StatusIcon::property_pixbuf | ( |  | ) |

A GdkPixbuf to display.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<int> Gtk::StatusIcon::property_size | ( |  | ) | const

The size of the icon.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<StockID> Gtk::StatusIcon::property_stock | ( |  | ) | const

Stock ID for a stock image to display.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy<StockID> Gtk::StatusIcon::property_stock | ( |  | ) |

Stock ID for a stock image to display.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

Glib::PropertyProxy_ReadOnly<ImageType> Gtk::StatusIcon::property_storage_type | ( |  | ) | const

The representation being used for image data.

You rarely need to use properties because there are get_ and set_ methods for almost all of them.

Returns:
  A PropertyProxy that allows you to get or set the property of the value, or receive notification when the value of the property changes.

void Gtk::StatusIcon::set | ( | const Glib::ustring& | icon_name | ) |

void Gtk::StatusIcon::set | ( | const StockID& | stock_id | ) |

void Gtk::StatusIcon::set | ( | const Glib::RefPtr<Gdk::Pixbuf>& | pixbuf | ) |

void Gtk::StatusIcon::set_blinking | ( | bool | blinking = `true` | ) |

void Gtk::StatusIcon::set_from_file | ( | const Glib::ustring& | filename | ) |

void Gtk::StatusIcon::set_tooltip | ( | const Glib::ustring& | tooltip_text | ) |

void Gtk::StatusIcon::set_visible | ( | bool | visible = `true` | ) |

## Friends And Related Function Documentation

Glib::RefPtr<Gtk::StatusIcon> wrap | ( | GtkStatusIcon* | object,
|  | bool | take_copy = `false`
| ) | `[related]`

Parameters:

  | object | The C instance
  | take_copy | False if the result should take ownership of the C instance. True if it should take a new copy or ref.

Returns:
  A C++ instance that wraps this C instance.

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

- statusicon.h