RGtk2 (version 2.20.31)

GtkStatusIcon: GtkStatusIcon

Description

Display an icon in the system tray

Arguments

Methods and Functions

gtkStatusIconNew() gtkStatusIconNewFromPixbuf(pixbuf) gtkStatusIconNewFromFile(filename) gtkStatusIconNewFromStock(stock.id) gtkStatusIconNewFromIconName(icon.name) gtkStatusIconNewFromGicon(icon) gtkStatusIconSetFromPixbuf(object, pixbuf) gtkStatusIconSetFromFile(object, filename) gtkStatusIconSetFromStock(object, stock.id) gtkStatusIconSetFromIconName(object, icon.name) gtkStatusIconSetFromGicon(object, icon) gtkStatusIconGetStorageType(object) gtkStatusIconGetPixbuf(object) gtkStatusIconGetStock(object) gtkStatusIconGetIconName(object) gtkStatusIconGetGicon(object) gtkStatusIconGetSize(object) gtkStatusIconSetScreen(object, screen) gtkStatusIconGetScreen(object) gtkStatusIconSetTooltip(object, tooltip.text) gtkStatusIconSetTooltip(object, tooltip.text) gtkStatusIconSetTooltipText(object, text) gtkStatusIconGetTooltipText(object) gtkStatusIconSetTooltipMarkup(object, markup = NULL) gtkStatusIconGetTooltipMarkup(object) gtkStatusIconSetHasTooltip(object, has.tooltip) gtkStatusIconGetHasTooltip(object) gtkStatusIconSetTitle(object, title) gtkStatusIconGetTitle(object) gtkStatusIconSetName(object, name) gtkStatusIconSetVisible(object, visible) gtkStatusIconGetVisible(object) gtkStatusIconSetBlinking(object, blinking) gtkStatusIconGetBlinking(object) gtkStatusIconIsEmbedded(object) gtkStatusIconPositionMenu(menu, user.data) gtkStatusIconGetGeometry(object) gtkStatusIconGetX11WindowId(object) gtkStatusIcon(icon)

Hierarchy

GObject
   +----GtkStatusIcon

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 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 gtkStatusIconIsEmbedded. On X11, the implementation follows the freedesktop.org "System Tray" specification (http://www.freedesktop.org/wiki/Standards/systemtray-spec). 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.

Structures

Convenient Construction

gtkStatusIcon is the result of collapsing the constructors of GtkStatusIcon (gtkStatusIconNew, gtkStatusIconNewFromGicon) and accepts a subset of its arguments matching the required arguments of one of its delegate constructors.

Signals

activate(status.icon, user.data)
Gets emitted when the user activates the status icon. If and how status icons can activated is platform-dependent. Unlike most G_SIGNAL_ACTION signals, this signal is meant to be used by applications and should be wrapped by language bindings. Since 2.10
status.icon
the object which received the signal
user.data
user data set when the signal handler was connected.
button-press-event(status.icon, event, user.data)
The ::button-press-event signal will be emitted when a button (typically from a mouse) is pressed. Whether this event is emitted is platform-dependent. Use the ::activate and ::popup-menu signals in preference. Since 2.14
status.icon
the object which received the signal
event
the GdkEventButton which triggered this signal
user.data
user data set when the signal handler was connected.
Returns: [logical] TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further.
button-release-event(status.icon, event, user.data)
The ::button-release-event signal will be emitted when a button (typically from a mouse) is released. Whether this event is emitted is platform-dependent. Use the ::activate and ::popup-menu signals in preference. Since 2.14
status.icon
the object which received the signal
event
the GdkEventButton which triggered this signal
user.data
user data set when the signal handler was connected.
Returns: [logical] TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further.
popup-menu(status.icon, button, activate.time, user.data)
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 gtkMenuPopup. Unlike most G_SIGNAL_ACTION signals, this signal is meant to be used by applications and should be wrapped by language bindings. Since 2.10
status.icon
the object which received the signal
button
the button that was pressed, or 0 if the signal is not emitted in response to a button press event
activate.time
the timestamp of the event that triggered the signal emission
user.data
user data set when the signal handler was connected.
query-tooltip(status.icon, x, y, keyboard.mode, tooltip, user.data)
Emitted when the "gtk-tooltip-timeout" has expired with the cursor hovering above status.icon; or emitted when status.icon got focus in keyboard mode. Using the given coordinates, the signal handler should determine whether a tooltip should be shown for status.icon. If this is the case TRUE should be returned, FALSE otherwise. Note that if keyboard.mode is TRUE, the values of x and y are undefined and should not be used. The signal handler is free to manipulate tooltip with the therefore destined function calls. Whether this signal is emitted is platform-dependent. For plain text tooltips, use "tooltip-text" in preference. Since 2.16
status.icon
the object which received the signal
x
the x coordinate of the cursor position where the request has been emitted, relative to status.icon
y
the y coordinate of the cursor position where the request has been emitted, relative to status.icon
keyboard.mode
TRUE if the tooltip was trigged using the keyboard
tooltip
a GtkTooltip
user.data
user data set when the signal handler was connected.
Returns: [logical] TRUE if tooltip should be shown right now, FALSE otherwise.
scroll-event(status.icon, event, user.data)
The ::scroll-event signal is emitted when a button in the 4 to 7 range is pressed. Wheel mice are usually configured to generate button press events for buttons 4 and 5 when the wheel is turned. Whether this event is emitted is platform-dependent.
status.icon
the object which received the signal.
event
the GdkEventScroll which triggered this signal
user.data
user data set when the signal handler was connected.
Returns: [logical] TRUE to stop other handlers from being invoked for the event. FALSE to propagate the event further.
size-changed(status.icon, size, user.data)
Gets emitted when the size available for the image changes, e.g. because the notification area got resized. Since 2.10
status.icon
the object which received the signal
size
the new size
user.data
user data set when the signal handler was connected.
Returns: [logical] TRUE if the icon was updated for the new size. Otherwise, GTK+ will scale the icon as necessary.

Properties

blinking [logical : Read / Write]
Whether or not the status icon is blinking. Default value: FALSE
embedded [logical : Read]
TRUE if the statusicon is embedded in a notification area. Default value: FALSE Since 2.12
file [character : * : Write]
Filename to load and display. Default value: NULL
gicon [GIcon : * : Read / Write]
The GIcon displayed in the GtkStatusIcon. For themed icons, the image will be updated automatically if the theme changes. Since 2.14
has-tooltip [logical : Read / Write]
Enables or disables the emission of "query-tooltip" on status.icon. A value of TRUE indicates that status.icon can have a tooltip, in this case the status icon will be queried using "query-tooltip" to determine whether it will provide a tooltip or not. Note that setting this property to TRUE for the first time will change the event masks of the windows of this status icon to include leave-notify and motion-notify events. This will not be undone when the property is set to FALSE again. Whether this property is respected is platform dependent. For plain text tooltips, use "tooltip-text" in preference. Default value: FALSE Since 2.16
icon-name [character : * : Read / Write]
The name of the icon from the icon theme. Default value: NULL
orientation [GtkOrientation : Read]
The orientation of the tray in which the statusicon is embedded. Default value: GTK_ORIENTATION_HORIZONTAL Since 2.12
pixbuf [GdkPixbuf : * : Read / Write]
A GdkPixbuf to display.
screen [GdkScreen : * : Read / Write]
The screen where this status icon will be displayed.
size [integer : Read]
The size of the icon. Allowed values: >= 0 Default value: 0
stock [character : * : Read / Write]
Stock ID for a stock image to display. Default value: NULL
storage-type [GtkImageType : Read]
The representation being used for image data. Default value: GTK_IMAGE_EMPTY
title [character : * : Read / Write]
The title of this tray icon. This should be a short, human-readable, localized string describing the tray icon. It may be used by tools like screen readers to render the tray icon. Default value: NULL Since 2.18
tooltip-markup [character : * : Read / Write]
Sets the text of tooltip to be the given string, which is marked up with the Pango text markup language. Also see gtkTooltipSetMarkup. This is a convenience property which will take care of getting the tooltip shown if the given string is not NULL. "has-tooltip" will automatically be set to TRUE and the default handler for the "query-tooltip" signal will take care of displaying the tooltip. On some platforms, embedded markup will be ignored. Default value: NULL Since 2.16
tooltip-text [character : * : Read / Write]
Sets the text of tooltip to be the given string. Also see gtkTooltipSetText. This is a convenience property which will take care of getting the tooltip shown if the given string is not NULL. "has-tooltip" will automatically be set to TRUE and the default handler for the "query-tooltip" signal will take care of displaying the tooltip. Note that some platforms have limitations on the length of tooltips that they allow on status icons, e.g. Windows only shows the first 64 characters. Default value: NULL Since 2.16
visible [logical : Read / Write]
Whether or not the status icon is visible. Default value: TRUE

References

http://library.gnome.org/devel//gtk/GtkStatusIcon.html