Synopsis
#include <gtk/gtk.h>
GtkStatusIcon;
GtkStatusIcon* gtk_status_icon_new (void);
GtkStatusIcon* gtk_status_icon_new_from_pixbuf (GdkPixbuf *pixbuf);
GtkStatusIcon* gtk_status_icon_new_from_file (const gchar *filename);
GtkStatusIcon* gtk_status_icon_new_from_stock (const gchar *stock_id);
GtkStatusIcon* gtk_status_icon_new_from_icon_name (const gchar *icon_name);
GtkStatusIcon* gtk_status_icon_new_from_gicon (GIcon *icon);
void gtk_status_icon_set_from_pixbuf (GtkStatusIcon *status_icon,
GdkPixbuf *pixbuf);
void gtk_status_icon_set_from_file (GtkStatusIcon *status_icon,
const gchar *filename);
void gtk_status_icon_set_from_stock (GtkStatusIcon *status_icon,
const gchar *stock_id);
void gtk_status_icon_set_from_icon_name (GtkStatusIcon *status_icon,
const gchar *icon_name);
void gtk_status_icon_set_from_gicon (GtkStatusIcon *status_icon,
GIcon *icon);
GtkImageType gtk_status_icon_get_storage_type (GtkStatusIcon *status_icon);
GdkPixbuf* gtk_status_icon_get_pixbuf (GtkStatusIcon *status_icon);
const gchar* gtk_status_icon_get_stock (GtkStatusIcon *status_icon);
const gchar* gtk_status_icon_get_icon_name (GtkStatusIcon *status_icon);
GIcon* gtk_status_icon_get_gicon (GtkStatusIcon *status_icon);
gint gtk_status_icon_get_size (GtkStatusIcon *status_icon);
void gtk_status_icon_set_screen (GtkStatusIcon *status_icon,
GdkScreen *screen);
GdkScreen* gtk_status_icon_get_screen (GtkStatusIcon *status_icon);
void gtk_status_icon_set_tooltip (GtkStatusIcon *status_icon,
const gchar *tooltip_text);
void gtk_status_icon_set_visible (GtkStatusIcon *status_icon,
gboolean visible);
gboolean gtk_status_icon_get_visible (GtkStatusIcon *status_icon);
void gtk_status_icon_set_blinking (GtkStatusIcon *status_icon,
gboolean blinking);
gboolean gtk_status_icon_get_blinking (GtkStatusIcon *status_icon);
gboolean gtk_status_icon_is_embedded (GtkStatusIcon *status_icon);
void gtk_status_icon_position_menu (GtkMenu *menu,
gint *x,
gint *y,
gboolean *push_in,
gpointer user_data);
gboolean gtk_status_icon_get_geometry (GtkStatusIcon *status_icon,
GdkScreen **screen,
GdkRectangle *area,
GtkOrientation *orientation);
guint32 gtk_status_icon_get_x11_window_id (GtkStatusIcon *status_icon);
Properties"blinking" gboolean : Read / Write "embedded" gboolean : Read "file" gchar* : Write "gicon" GIcon* : Read / Write "icon-name" gchar* : Read / Write "orientation" GtkOrientation : Read "pixbuf" GdkPixbuf* : Read / Write "screen" GdkScreen* : Read / Write "size" gint : Read "stock" gchar* : Read / Write "storage-type" GtkImageType : Read "visible" gboolean : Read / Write DescriptionThe "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 GtkStatusIcon 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 GtkStatusIcon, 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 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. Note that a GtkStatusIcon is not a widget, but just a GObject. Making it a widget would be impractical, since the system tray on Win32 doesn't allow to embed arbitrary widgets. Detailsgtk_status_icon_new ()GtkStatusIcon* gtk_status_icon_new (void); Creates an empty status icon object.
Since 2.10 gtk_status_icon_new_from_pixbuf ()GtkStatusIcon* gtk_status_icon_new_from_pixbuf (GdkPixbuf *pixbuf);
Creates a status icon displaying The image will be scaled down to fit in the available space in the notification area, if necessary.
Since 2.10 gtk_status_icon_new_from_file ()GtkStatusIcon* gtk_status_icon_new_from_file (const gchar *filename);
Creates a status icon displaying the file The image will be scaled down to fit in the available space in the notification area, if necessary.
Since 2.10 gtk_status_icon_new_from_stock ()GtkStatusIcon* gtk_status_icon_new_from_stock (const gchar *stock_id);
Creates a status icon displaying a stock icon. Sample stock icon
names are GTK_STOCK_OPEN, GTK_STOCK_QUIT. You can register your
own stock icon names, see
Since 2.10 gtk_status_icon_new_from_icon_name ()GtkStatusIcon* gtk_status_icon_new_from_icon_name (const gchar *icon_name); Creates a status icon displaying an icon from the current icon theme. If the current icon theme is changed, the icon will be updated appropriately.
Since 2.10 gtk_status_icon_new_from_gicon ()GtkStatusIcon* gtk_status_icon_new_from_gicon (GIcon *icon); Creates a status icon displaying a GIcon. If the icon is a themed icon, it will be updated when the theme changes.
Since 2.14 gtk_status_icon_set_from_pixbuf ()void gtk_status_icon_set_from_pixbuf (GtkStatusIcon *status_icon, GdkPixbuf *pixbuf);
Makes
Since 2.10 gtk_status_icon_set_from_file ()void gtk_status_icon_set_from_file (GtkStatusIcon *status_icon, const gchar *filename);
Makes
Since 2.10 gtk_status_icon_set_from_stock ()void gtk_status_icon_set_from_stock (GtkStatusIcon *status_icon, const gchar *stock_id);
Makes
Since 2.10 gtk_status_icon_set_from_icon_name ()void gtk_status_icon_set_from_icon_name (GtkStatusIcon *status_icon, const gchar *icon_name);
Makes
Since 2.10 gtk_status_icon_set_from_gicon ()void gtk_status_icon_set_from_gicon (GtkStatusIcon *status_icon, GIcon *icon);
Makes
Since 2.14 gtk_status_icon_get_storage_type ()GtkImageType gtk_status_icon_get_storage_type (GtkStatusIcon *status_icon);
Gets the type of representation being used by the GtkStatusIcon
to store image data. If the GtkStatusIcon has no image data,
the return value will be
Since 2.10 gtk_status_icon_get_pixbuf ()GdkPixbuf* gtk_status_icon_get_pixbuf (GtkStatusIcon *status_icon);
Gets the GdkPixbuf being displayed by the GtkStatusIcon.
The storage type of the status icon must be
Since 2.10 gtk_status_icon_get_stock ()const gchar* gtk_status_icon_get_stock (GtkStatusIcon *status_icon);
Gets the id of the stock icon being displayed by the GtkStatusIcon.
The storage type of the status icon must be
Since 2.10 gtk_status_icon_get_icon_name ()const gchar* gtk_status_icon_get_icon_name (GtkStatusIcon *status_icon);
Gets the name of the icon being displayed by the GtkStatusIcon.
The storage type of the status icon must be
Since 2.10 gtk_status_icon_get_gicon ()GIcon* gtk_status_icon_get_gicon (GtkStatusIcon *status_icon);
Retrieves the GIcon being displayed by the GtkStatusIcon.
The storage type of the status icon must be
If this function fails,
Since 2.14 gtk_status_icon_get_size ()gint gtk_status_icon_get_size (GtkStatusIcon *status_icon); Gets the size in pixels that is available for the image. Stock icons and named icons adapt their size automatically if the size of the notification area changes. For other storage types, the size-changed signal can be used to react to size changes.
Note that the returned size is only meaningful while the
status icon is embedded (see
Since 2.10 gtk_status_icon_set_screen ()void gtk_status_icon_set_screen (GtkStatusIcon *status_icon, GdkScreen *screen);
Sets the GdkScreen where
Since 2.12 gtk_status_icon_get_screen ()GdkScreen* gtk_status_icon_get_screen (GtkStatusIcon *status_icon);
Returns the GdkScreen associated with
Since 2.12 gtk_status_icon_set_tooltip ()void gtk_status_icon_set_tooltip (GtkStatusIcon *status_icon, const gchar *tooltip_text); Sets the tooltip of the status icon.
Since 2.10 gtk_status_icon_set_visible ()void gtk_status_icon_set_visible (GtkStatusIcon *status_icon, gboolean visible); Shows or hides a status icon.
Since 2.10 gtk_status_icon_get_visible ()gboolean gtk_status_icon_get_visible (GtkStatusIcon *status_icon);
Returns whether the status icon is visible or not.
Note that being visible does not guarantee that
the user can actually see the icon, see also
Since 2.10 gtk_status_icon_set_blinking ()void gtk_status_icon_set_blinking (GtkStatusIcon *status_icon, gboolean blinking); Makes the status icon start or stop blinking. Note that blinking user interface elements may be problematic for some users, and thus may be turned off, in which case this setting has no effect.
Since 2.10 gtk_status_icon_get_blinking ()gboolean gtk_status_icon_get_blinking (GtkStatusIcon *status_icon);
Returns whether the icon is blinking, see
Since 2.10 gtk_status_icon_is_embedded ()gboolean gtk_status_icon_is_embedded (GtkStatusIcon *status_icon); Returns whether the status icon is embedded in a notification area.
Since 2.10 gtk_status_icon_position_menu ()void gtk_status_icon_position_menu (GtkMenu *menu, gint *x, gint *y, gboolean *push_in, gpointer user_data);
Menu positioning function to use with
Since 2.10 gtk_status_icon_get_geometry ()gboolean gtk_status_icon_get_geometry (GtkStatusIcon *status_icon, GdkScreen **screen, GdkRectangle *area, GtkOrientation *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
Note that some platforms do not allow GTK+ to provide
this information, and even on platforms that do allow it,
the information is not reliable unless the status icon
is embedded in a notification area, see
Since 2.10 gtk_status_icon_get_x11_window_id ()guint32 gtk_status_icon_get_x11_window_id (GtkStatusIcon *status_icon); This function is only useful on the X11/freedesktop.org platform. It returns a window ID for the widget in the underlying status icon implementation. This is useful for the Galago notification service, which can send a window ID in the protocol in order for the server to position notification windows pointing to a status icon reliably.
This function is not intended for other use cases which are
more likely to be met by one of the non-X11 specific methods, such
as
Since 2.14 Property DetailsThe
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
the object which received the signal |
|
user data set when the signal handler was connected. |
Since 2.10
"popup-menu" signalvoid user_function (GtkStatusIcon *status_icon, guint button, guint activate_time, gpointer user_data) : Run First / Action
Gets emitted when the user brings up the context menu of the status icon. Whether status icons can have context menus and how these are activated is platform-dependent.
The button and activate_time parameters should be
passed as the last to arguments to gtk_menu_popup().
Unlike most G_SIGNAL_ACTION signals, this signal is meant to be used by applications and should be wrapped by language bindings.
|
the object which received the signal |
|
the button that was pressed, or 0 if the signal is not emitted in response to a button press event |
|
the timestamp of the event that triggered the signal emission |
|
user data set when the signal handler was connected. |
Since 2.10
"size-changed" signalgboolean user_function (GtkStatusIcon *status_icon, gint size, gpointer user_data) : Run Last
Gets emitted when the size available for the image changes, e.g. because the notification area got resized.
|
the object which received the signal |
|
the new size |
|
user data set when the signal handler was connected. |
Returns : |
TRUE if the icon was updated for the new
size. Otherwise, GTK+ will scale the icon as necessary.
|
Since 2.10