Top | ![]() |
![]() |
![]() |
![]() |
void | activate | Action |
void | button-press-event | Action |
void | button-release-event | Action |
void | state-changed | Action |
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
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
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
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
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. |
“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.
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.
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, gint x, gint y, guint button, guint time, gint 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, gint x, gint y, guint button, guint time, gint 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
“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