AppIndicator3.Indicator

g AppIndicator3.Indicator AppIndicator3.Indicator GObject.Object GObject.Object GObject.Object->AppIndicator3.Indicator

Subclasses:None

Methods

Inherited:GObject.Object (37)
Structs:GObject.ObjectClass (5)
class new (id, icon_name, category)
class new_with_path (id, icon_name, category, icon_theme_path)
  build_menu_from_desktop (desktop_file, desktop_profile)
  get_attention_icon ()
  get_attention_icon_desc ()
  get_category ()
  get_icon ()
  get_icon_desc ()
  get_icon_theme_path ()
  get_id ()
  get_label ()
  get_label_guide ()
  get_menu ()
  get_ordering_index ()
  get_secondary_activate_target ()
  get_status ()
  get_title ()
  set_attention_icon (icon_name)
  set_attention_icon_full (icon_name, icon_desc)
  set_icon (icon_name)
  set_icon_full (icon_name, icon_desc)
  set_icon_theme_path (icon_theme_path)
  set_label (label, guide)
  set_menu (menu)
  set_ordering_index (ordering_index)
  set_secondary_activate_target (menuitem)
  set_status (status)
  set_title (title)

Virtual Methods

Inherited:GObject.Object (7)
  do_connection_changed (connected, *user_data)
  do_new_attention_icon (*user_data)
  do_new_icon (*user_data)
  do_new_icon_theme_path (icon_theme_path, *user_data)
  do_new_label (label, guide, *user_data)
  do_new_status (status, *user_data)
  do_scroll_event (delta, direction, *user_data)
  do_unfallback (status_icon)

Properties

Name Type Flags Short Description
attention-icon-desc str r/w When the indicator is an attention mode this should describe the icon shown
attention-icon-name str r/w If the indicator sets it’s status to ‘attention’ then this icon is shown.
category str r/w/co The type of indicator that this represents. Please don’t use ‘other’. Defaults to ‘ApplicationStatus’.
connected bool r Pretty simple, true if we have a reasonable expectation of being displayed through this object. You should hide your TrayIcon if so.
icon-desc str r/w A description of the default icon that is shown for the indicator.
icon-name str r/w The default icon that is shown for the indicator.
icon-theme-path str r/w/c An additional place to look for icon names that may be installed by the application.
id str r/w/co An ID that should be unique, but used consistently by this program and its indicator.
label str r/w A label to provide dynamic information.
label-guide str r/w To ensure that the label does not cause the panel to ‘jiggle’ this string should provide information on how much space it could take.
ordering-index int r/w A way to override the default ordering of the applications by providing a very specific idea of where this entry should be placed.
status str r/w Whether the indicator is shown or requests attention. Defaults to ‘Passive’.
title str r/w A human readable way to refer to this application indicator in the UI.

Signals

Inherited:GObject.Object (1)
Name Short Description
connection-changed Signaled when we connect to a watcher, or when it drops away.
new-attention-icon Emitted when AppIndicator3.Indicator :attention-icon-name is changed
new-icon when AppIndicator3.Indicator :icon-name is changed
new-icon-theme-path Signaled when there is a new icon set for the object.
new-label Emitted when either AppIndicator3.Indicator :label or AppIndicator3.Indicator :label-guide are changed.
new-status Emitted when AppIndicator3.Indicator :status is changed
scroll-event Signaled when the AppIndicator3.Indicator receives a scroll event.

Fields

Inherited:GObject.Object (1)
Name Type Access Description
parent GObject.Object r Parent object.
priv AppIndicator3.IndicatorPrivate r Internal data.

Class Details

class AppIndicator3.Indicator(**kwargs)
Bases:GObject.Object
Abstract:No
Structure:AppIndicator3.IndicatorClass

A application indicator represents the values that are needed to show a unique status in the panel for an application. In general, applications should try to fit in the other indicators that are available on the panel before using this. But, sometimes it is necissary.

Private fields

classmethod new(id, icon_name, category)
Parameters:
Returns:

A pointer to a new AppIndicator3.Indicator object.

Return type:

AppIndicator3.Indicator

Creates a new AppIndicator3.Indicator setting the properties: AppIndicator3.Indicator :id with id, AppIndicator3.Indicator :category with category and AppIndicator3.Indicator :icon-name with icon_name.

classmethod new_with_path(id, icon_name, category, icon_theme_path)
Parameters:
  • id (str) – The unique id of the indicator to create.
  • icon_name (str) – The icon name for this indicator
  • category (AppIndicator3.IndicatorCategory) – The category of indicator.
  • icon_theme_path (str) – A custom path for finding icons.
Returns:

A pointer to a new AppIndicator3.Indicator object.

Return type:

AppIndicator3.Indicator

Creates a new AppIndicator3.Indicator setting the properties: AppIndicator3.Indicator :id with id, AppIndicator3.Indicator :category with category, AppIndicator3.Indicator :icon-name with icon_name and AppIndicator3.Indicator :icon-theme-path with icon_theme_path.

build_menu_from_desktop(desktop_file, desktop_profile)
Parameters:
  • desktop_file (str) – A path to the desktop file to build the menu from
  • desktop_profile (str) – Which entries should be used from the desktop file

This function allows for building the Application Indicator menu from a static desktop file.

get_attention_icon()
Returns:The current attention icon name.
Return type:str

Wrapper function for property AppIndicator3.Indicator :attention-icon-name.

get_attention_icon_desc()
Returns:The current attention icon description.
Return type:str

Wrapper function for property AppIndicator3.Indicator :attention-icon-desc.

get_category()
Returns:The current category.
Return type:AppIndicator3.IndicatorCategory

Wrapper function for property AppIndicator3.Indicator :category.

get_icon()
Returns:The current icon name.
Return type:str

Wrapper function for property AppIndicator3.Indicator :icon-name.

get_icon_desc()
Returns:The current icon description.
Return type:str

Wrapper function for property AppIndicator3.Indicator :icon-desc.

get_icon_theme_path()
Returns:The current icon theme path.
Return type:str

Wrapper function for property AppIndicator3.Indicator :icon-theme-path.

get_id()
Returns:The current ID
Return type:str

Wrapper function for property AppIndicator3.Indicator :id.

get_label()
Returns:The current label.
Return type:str

Wrapper function for property AppIndicator3.Indicator :label.

get_label_guide()
Returns:The current label guide.
Return type:str

Wrapper function for property AppIndicator3.Indicator :label-guide.

get_menu()
Returns:A Gtk.Menu object or None if one hasn’t been set.
Return type:Gtk.Menu

Gets the menu being used for this application indicator. Wrapper function for property AppIndicator3.Indicator :menu.

get_ordering_index()
Returns:The current ordering index.
Return type:int

Wrapper function for property AppIndicator3.Indicator :ordering-index.

get_secondary_activate_target()
Returns:A Gtk.Widget object or None if none has been set.
Return type:Gtk.Widget

Gets the menuitem being called on secondary-activate event.

get_status()
Returns:The current status.
Return type:AppIndicator3.IndicatorStatus

Wrapper function for property AppIndicator3.Indicator :status.

get_title()
Returns:The current title.
Return type:str

Gets the title of the application indicator. See the function AppIndicator3.Indicator.set_title() for information on the title.

New in version 0.5.

set_attention_icon(icon_name)
Parameters:icon_name (str) – The name of the attention icon to set for this indicator

Wrapper for AppIndicator3.Indicator.set_attention_icon_full() with a None description.

Deprecated since version ???: Use AppIndicator3.Indicator.set_attention_icon_full() instead.

set_attention_icon_full(icon_name, icon_desc)
Parameters:
  • icon_name (str) – The name of the attention icon to set for this indicator
  • icon_desc (str) – A textual description of the icon

Wrapper function for property AppIndicator3.Indicator :attention-icon-name.

set_icon(icon_name)
Parameters:icon_name (str) – The icon name to set.

Wrapper function for AppIndicator3.Indicator.set_icon_full() with a None description.

Deprecated since version ???: Use AppIndicator3.Indicator.set_icon_full()

set_icon_full(icon_name, icon_desc)
Parameters:
  • icon_name (str) – The icon name to set.
  • icon_desc (str) – A textual description of the icon for accessibility

Sets the default icon to use when the status is active but not set to attention. In most cases, this should be the application icon for the program.

Wrapper function for property AppIndicator3.Indicator :icon-name and AppIndicator3.Indicator ::icon-desc.

set_icon_theme_path(icon_theme_path)
Parameters:icon_theme_path (str) – The icon theme path to set.

Sets the path to use when searching for icons.

set_label(label, guide)
Parameters:
  • label (str) – The label to show next to the icon.
  • guide (str) – A guide to size the label correctly.

This is a wrapper function for the AppIndicator3.Indicator :label and AppIndicator3.Indicator :guide properties. This function can take None as either label or guide and will clear the entries.

set_menu(menu)
Parameters:menu (Gtk.Menu or None) – A Gtk.Menu to set

Sets the menu that should be shown when the Application Indicator is clicked on in the panel. An application indicator will not be rendered unless it has a menu.

Wrapper function for property AppIndicator3.Indicator :menu.

set_ordering_index(ordering_index)
Parameters:ordering_index (int) – A value for the ordering of this app indicator

Sets the ordering index for the app indicator which effects the placement of it on the panel. For almost all app indicator this is not the function you’re looking for.

Wrapper function for property AppIndicator3.Indicator :ordering-index.

set_secondary_activate_target(menuitem)
Parameters:menuitem (Gtk.Widget or None) – A Gtk.Widget to be activated on secondary activation

Set the menuitem to be activated when a secondary activation event (i.e. a middle-click) is emitted over the AppIndicator3.Indicator icon/label.

The menuitem can be also a complex Gtk.Widget, but to get activated when a secondary activation occurs in the #Appindicator, it must be a visible and active child (or inner-child) of the AppIndicator3.Indicator :menu.

Setting menuitem to None causes to disable this feature.

set_status(status)
Parameters:status (AppIndicator3.IndicatorStatus) – The status to set for this indicator

Wrapper function for property AppIndicator3.Indicator :status.

set_title(title)
Parameters:title (str or None) – Title of the app indicator

Sets the title of the application indicator, or how it should be referred in a human readable form. This string should be UTF-8 and localized as it expected that users will set it.

In the Unity desktop the most prominent place that this is show will be in the HUD. HUD listings for this application indicator will start with the title as the first part of the line for the menu items.

Setting title to None removes the title.

New in version 0.5.

do_connection_changed(connected, *user_data) virtual
Parameters:
do_new_attention_icon(*user_data) virtual
Parameters:user_data (object or None) –
do_new_icon(*user_data) virtual
Parameters:user_data (object or None) –
do_new_icon_theme_path(icon_theme_path, *user_data) virtual
Parameters:
do_new_label(label, guide, *user_data) virtual
Parameters:
do_new_status(status, *user_data) virtual
Parameters:
do_scroll_event(delta, direction, *user_data) virtual
Parameters:
do_unfallback(status_icon) virtual
Parameters:status_icon (Gtk.StatusIcon) –

Signal Details

AppIndicator3.Indicator.signals.connection_changed(indicator, arg1)
Signal Name:

connection-changed

Flags:

RUN_LAST

Parameters:

Signaled when we connect to a watcher, or when it drops away.

AppIndicator3.Indicator.signals.new_attention_icon(indicator)
Signal Name:new-attention-icon
Flags:RUN_LAST
Parameters:indicator (AppIndicator3.Indicator) – The object which received the signal

Emitted when AppIndicator3.Indicator :attention-icon-name is changed

AppIndicator3.Indicator.signals.new_icon(indicator)
Signal Name:new-icon
Flags:RUN_LAST
Parameters:indicator (AppIndicator3.Indicator) – The object which received the signal

when AppIndicator3.Indicator :icon-name is changed

AppIndicator3.Indicator.signals.new_icon_theme_path(indicator, object)
Signal Name:

new-icon-theme-path

Flags:

RUN_LAST

Parameters:

Signaled when there is a new icon set for the object.

AppIndicator3.Indicator.signals.new_label(indicator, object, p0)
Signal Name:

new-label

Flags:

RUN_LAST

Parameters:

Emitted when either AppIndicator3.Indicator :label or AppIndicator3.Indicator :label-guide are changed.

AppIndicator3.Indicator.signals.new_status(indicator, arg1)
Signal Name:

new-status

Flags:

RUN_LAST

Parameters:

Emitted when AppIndicator3.Indicator :status is changed

AppIndicator3.Indicator.signals.scroll_event(indicator, arg1, arg2)
Signal Name:

scroll-event

Flags:

RUN_LAST

Parameters:

Signaled when the AppIndicator3.Indicator receives a scroll event.

Property Details

AppIndicator3.Indicator.props.attention_icon_desc
Name:attention-icon-desc
Type:str
Default Value:None
Flags:READABLE, WRITABLE

If the indicator sets it’s status to AppIndicator3.IndicatorStatus.ATTENTION then this textual description of the icon shown.

AppIndicator3.Indicator.props.attention_icon_name
Name:attention-icon-name
Type:str
Default Value:None
Flags:READABLE, WRITABLE

If the indicator sets it’s status to AppIndicator3.IndicatorStatus.ATTENTION then this icon is shown.

AppIndicator3.Indicator.props.category
Name:category
Type:str
Default Value:None
Flags:READABLE, WRITABLE, CONSTRUCT_ONLY

The type of indicator that this represents. Please don’t use ‘Other’. Defaults to ‘ApplicationStatus’.

AppIndicator3.Indicator.props.connected
Name:connected
Type:bool
Default Value:False
Flags:READABLE

Pretty simple, True if we have a reasonable expectation of being displayed through this object. You should hide your TrayIcon if so.

AppIndicator3.Indicator.props.icon_desc
Name:icon-desc
Type:str
Default Value:None
Flags:READABLE, WRITABLE

The description of the regular icon that is shown for the indicator.

AppIndicator3.Indicator.props.icon_name
Name:icon-name
Type:str
Default Value:None
Flags:READABLE, WRITABLE

The name of the regular icon that is shown for the indicator.

AppIndicator3.Indicator.props.icon_theme_path
Name:icon-theme-path
Type:str
Default Value:None
Flags:READABLE, WRITABLE, CONSTRUCT

An additional place to look for icon names that may be installed by the application.

AppIndicator3.Indicator.props.id
Name:id
Type:str
Default Value:None
Flags:READABLE, WRITABLE, CONSTRUCT_ONLY

The ID for this indicator, which should be unique, but used consistently by this program and its indicator.

AppIndicator3.Indicator.props.label
Name:label
Type:str
Default Value:None
Flags:READABLE, WRITABLE

A label that can be shown next to the string in the application indicator. The label will not be shown unless there is an icon as well. The label is useful for numerical and other frequently updated information. In general, it shouldn’t be shown unless a user requests it as it can take up a significant amount of space on the user’s panel. This may not be shown in all visualizations.

AppIndicator3.Indicator.props.label_guide
Name:label-guide
Type:str
Default Value:None
Flags:READABLE, WRITABLE

An optional string to provide guidance to the panel on how big the AppIndicator3.Indicator :label string could get. If this is set correctly then the panel should never ‘jiggle’ as the string adjusts through out the range of options. For instance, if you were providing a percentage like “54% thrust” in AppIndicator3.Indicator :label you’d want to set this string to “100% thrust” to ensure space when Scotty can get you enough power.

AppIndicator3.Indicator.props.ordering_index
Name:ordering-index
Type:int
Default Value:0
Flags:READABLE, WRITABLE

The ordering index is an odd parameter, and if you think you don’t need it you’re probably right. In general, the application indicator try to place the applications in a recreatable place taking into account which category they’re in to try and group them. But, there are some cases where you’d want to ensure indicators are next to each other. To do that you can override the generated ordering index and replace it with a new one. Again, you probably don’t want to be doing this, but in case you do, this is the way.

AppIndicator3.Indicator.props.status
Name:status
Type:str
Default Value:None
Flags:READABLE, WRITABLE

Whether the indicator is shown or requests attention. Defaults to ‘Passive’.

AppIndicator3.Indicator.props.title
Name:title
Type:str
Default Value:None
Flags:READABLE, WRITABLE

Provides a way to refer to this application indicator in a human readable form. This is used in the Unity desktop in the HUD as the first part of the menu entries to distinguish them from the focused application’s entries.