Top | ![]() |
![]() |
![]() |
![]() |
int | icon-size | Read / Write |
char * | name | Read / Write / Construct |
GtkWidget * | primary-menu | Read / Write |
GtkWidget * | secondary-menu | Read / Write |
void | activate | Action |
void | button-press-event | Action |
void | button-release-event | Action |
void | scroll-event | Action |
void | state-changed | Action |
#define | XAPP_TYPE_STATUS_ICON |
enum | XAppStatusIconState |
enum | XAppScrollDirection |
XAppStatusIcon |
The XAppStatusIcon allows applications to share status info about themselves. It replaces the obsolete and very similar Gtk.StatusIcon widget.
If used in an environment where no applet is handling XAppStatusIcons, the XAppStatusIcon delegates its calls to a Gtk.StatusIcon.
XAppStatusIcon *
xapp_status_icon_new (void
);
Creates a new XAppStatusIcon instance
Since: 1.6
XAppStatusIcon *
xapp_status_icon_new_with_name (const gchar *name
);
Creates a new XAppStatusIcon instance and sets its name to name
.
Since: 1.6
void xapp_status_icon_set_name (XAppStatusIcon *icon
,const gchar *name
);
Sets the status icon name. This is not shown to users.
Since: 1.6
void xapp_status_icon_set_icon_name (XAppStatusIcon *icon
,const gchar *icon_name
);
Sets the icon name or local path to use.
Since: 1.6
gint
xapp_status_icon_get_icon_size (XAppStatusIcon *icon
);
The desired icon size - usually set by the host based on panel size. This is not what it's guaranteed to get, and this is really only useful when receiving absolute icon paths from the client app.
Since: 1.8
void xapp_status_icon_set_tooltip_text (XAppStatusIcon *icon
,const gchar *tooltip_text
);
Sets the tooltip text
Since: 1.6
void xapp_status_icon_set_label (XAppStatusIcon *icon
,const gchar *label
);
Sets a label, shown beside the icon
Since: 1.6
void xapp_status_icon_set_visible (XAppStatusIcon *icon
,const gboolean visible
);
Sets the visibility of the status icon
Since: 1.6
gboolean
xapp_status_icon_get_visible (XAppStatusIcon *icon
);
Returns whether or not the icon should currently be visible.
Since: 1.8.5
void xapp_status_icon_popup_menu (XAppStatusIcon *icon
,GtkMenu *menu
,gint x
,gint y
,guint button
,guint _time
,gint panel_position
);
Pop up menu
using the positioning arguments. These arguments should be
those provided by a “button-release-event”.
icon |
||
menu |
A GtkMenu to display when the primary mouse button is released. |
[nullable] |
x |
The x anchor position for the menu. |
|
y |
The y anchor position for the menu. |
|
button |
The button used to initiate this action (or 0) |
|
_time |
The event time (or 0) |
|
panel_position |
The GtkPositionType for the position of the icon. |
Since: 1.8.6
void xapp_status_icon_set_primary_menu (XAppStatusIcon *icon
,GtkMenu *menu
);
See the “primary-menu” property for details
Since: 1.6
GtkWidget *
xapp_status_icon_get_primary_menu (XAppStatusIcon *icon
);
Returns a pointer to a GtkMenu that was set previously for the
primary mouse button. If no menu was set, this returns NULL
.
Since: 1.6
void xapp_status_icon_set_secondary_menu (XAppStatusIcon *icon
,GtkMenu *menu
);
See the “secondary-menu” property for details
Since: 1.6
GtkWidget *
xapp_status_icon_get_secondary_menu (XAppStatusIcon *icon
);
Returns a pointer to a GtkMenu that was set previously for the
secondary mouse button. If no menu was set, this returns NULL
.
Since: 1.6
XAppStatusIconState
xapp_status_icon_get_state (XAppStatusIcon *icon
);
Gets the current XAppStatusIconState of icon. The state is determined by whether the icon is being displayed by an XAppStatusMonitor client, a fallback tray icon, or not being displayed at all.
See XAppStatusIconState for more details.
Since: 1.6
void xapp_status_icon_set_metadata (XAppStatusIcon *icon
,const gchar *metadata
);
Sets metadata to pass to the icon proxy for an applet's use. Right now this is only so xapp-sn-watcher can tell the applets when the icon is originating from appindicator so panel button 'highlighting' can behave correctly.
Since: 1.8.7
gboolean
xapp_status_icon_any_monitors (void
);
Looks for the existence of any active XAppStatusIconMonitors on the bus.
Since: 1.6
The XAppStatusIcon is currently being handled by an XAppStatusIconMonitor (usually in an applet). |
||
The XAppStatusIcon is currently being handled by a legacy system tray implementation (using GtkStatusIcon). |
||
The XAppStatusIcon is not currently being handled by any kind of status icon implementation. |
“icon-size”
property “icon-size” int
The icon size that is preferred by icon monitor/host - this is usually a product of some calculation based on the panel size. It can be used by the client to size an icon to be saved as a file and its path sent to the host.
If this value is 0 it has not been set, and its value can be unreliable if the host has multiple XAppStatusIconMonitors active.
Owner: XAppStatusIcon
Flags: Read / Write
Allowed values: [0,96]
Default value: 0
“name”
property “name” char *
The name of the icon for sorting purposes. If this is in the form of 'org.x.StatusIcon.foo`
and set immediately upon creation of the icon, it will also attempt to own this dbus name;
this can be useful in sandboxed environments where a well-defined name is required. If
additional icons are created, only the name given to the initial one will be used for dbus,
though different names can still affect the sort order. This is set to the value of
g_get_prgname()
if no other name is provided.
Owner: XAppStatusIcon
Flags: Read / Write / Construct
Default value: NULL
“primary-menu”
property“primary-menu” GtkWidget *
A GtkMenu to use when requested by the remote monitor via a left (or primary) click.
When this property is not NULL
, the menu will be automatically positioned and
displayed during a primary button release.
When this property IS NULL
, the “activate” will be sent for primary
button presses.
In both cases, the “button-press-event” and “button-release-events” will be fired like normal.
Setting this will remove any floating reference to the menu and assume ownership. As a result, it is not necessary to maintain a reference to it in the parent application (or unref it when finished with it - if you wish to replace the menu, simply call this method again with a new menu.
The same GtkMenu widget can be set as both the primary and secondary.
Owner: XAppStatusIcon
Flags: Read / Write
“secondary-menu”
property“secondary-menu” GtkWidget *
A GtkMenu to use when requested by the remote monitor via a right (or secondary) click.
When this property is not NULL
, the menu will be automatically positioned and
displayed during a secondary button release.
When this property IS NULL
, the “activate” will be sent for secondary
button presses.
In both cases, the “button-press-event” and “button-release-events” will be fired like normal.
Setting this will remove any floating reference to the menu and assume ownership. As a result, it is not necessary to maintain a reference to it in the parent application (or unref it when finished with it - if you wish to replace the menu, simply call this method again with a new menu.
The same GtkMenu widget can be set as both the primary and secondary.
Owner: XAppStatusIcon
Flags: Read / Write
“activate”
signalvoid user_function (XAppStatusIcon *icon, guint button, guint time, gpointer user_data)
Gets emitted when the user activates the status icon. If the XAppStatusIcon:primary-menu or
XAppStatusIcon:secondary-menu is not NULL
, this signal is skipped for the respective button
presses. A middle button click will always send this signal when pressed.
icon |
The XAppStatusIcon |
|
button |
The button that was pressed |
|
time |
The time supplied by the event, or 0 |
|
user_data |
user data set when the signal handler was connected. |
Flags: Action
“button-press-event”
signalvoid user_function (XAppStatusIcon *icon, int x, int y, guint button, guint time, int panel_position, gpointer user_data)
Gets emitted when there is a button press received from an applet
icon |
The XAppStatusIcon |
|
x |
The absolute x position to use for menu positioning |
|
y |
The absolute y position to use for menu positioning |
|
button |
The button that was pressed |
|
time |
The time supplied by the event, or 0 |
|
panel_position |
The GtkPositionType to use for menu positioning |
|
user_data |
user data set when the signal handler was connected. |
Flags: Action
“button-release-event”
signalvoid user_function (XAppStatusIcon *icon, int x, int y, guint button, guint time, int panel_position, gpointer user_data)
Gets emitted when there is a button release received from an applet
icon |
The XAppStatusIcon |
|
x |
The absolute x position to use for menu positioning |
|
y |
The absolute y position to use for menu positioning |
|
button |
The button that was released |
|
time |
The time supplied by the event, or 0 |
|
panel_position |
The GtkPositionType to use for menu positioning |
|
user_data |
user data set when the signal handler was connected. |
Flags: Action
“scroll-event”
signalvoid user_function (XAppStatusIcon *icon, int amount, XAppScrollDirection direction, guint time, gpointer user_data)
Gets emitted when the user uses the mouse scroll wheel over the status icon. For the most part, amounts will always be 1, unless an applet supports smooth scrolling. Generally the direction value is most important.
icon |
The XAppStatusIcon |
|
amount |
The amount of movement for the scroll event |
|
direction |
the XAppScrollDirection of the scroll event |
|
time |
The time supplied by the event, or 0 |
|
user_data |
user data set when the signal handler was connected. |
Flags: Action
“state-changed”
signalvoid user_function (XAppStatusIcon *icon, XAppStatusIconState new_state, gpointer user_data)
Gets emitted when the state of the icon changes. If you wish to react to changes in how the status icon is being handled (perhaps to alter the menu or other click behavior), you should connect to this - see XAppStatusIconState for more details.
icon |
The XAppStatusIcon |
|
new_state |
The new XAppStatusIconState of the icon |
|
user_data |
user data set when the signal handler was connected. |
Flags: Action