Applet.Applet: Cinnamon Javascript Reference Manual

## Applet.Applet Applet.Applet — Base applet class |

## Functions

| _init ()
| set_applet_tooltip ()
| set_applet_enabled ()
| on_applet_clicked ()
| on_applet_instances_changed ()
| on_applet_added_to_panel ()
| on_applet_removed_from_panel ()
| setOrientation ()
| on_orientation_changed ()
| setPanelHeight ()
| on_panel_height_changed ()

## Properties

St.BoxLayout | actor |
int | instance_id |
string | _uuid |
St.BoxLayout | _panelLocation |
Panel.Panel | panel |
JSON | _meta |
int | _order |
Dnd._Draggable | _draggable |
boolean | _scaleMode |
Tooltips.PanelItemTooltip | _applet_tooltip |
PopupMenu.PopupMenuManager | _menuManager |
Applet.AppletContextMenu | _applet_context_menu |
string | _applet_tooltip_text |

## Object Hierarchy

        Object
        ╰── Applet.Applet

## Description

Base applet class that other applets can inherit

## Functions

### _init ()

    _init (St.Side   orientation,
           int       panelHeight,
           int       instance_id);

#### Parameters

orientation | orientation of the applet; Orientation of panel containing the actor |
panelHeight | height of the panel containing the applet |
instance_id | instance id of the applet |

### set_applet_tooltip ()

    set_applet_tooltip (string   text);

Sets the tooltip of the applet

#### Parameters

text | the tooltip text to be set |

### set_applet_enabled ()

    set_applet_enabled (boolean   enabled);

Sets whether the applet is enabled or not. A disabled applet sets its padding to 0px and doesn't react to clicks

#### Parameters

enabled | whether this applet is enabled or not |

### on_applet_clicked ()

    on_applet_clicked (Clutter.Event   event);

This function is called when the applet is clicked.

This is meant to be overridden in individual applets.

#### Parameters

event | the event object |

### on_applet_instances_changed ()

    on_applet_instances_changed ();

This function is called when an applet of the same uuid is added or removed from the panels. It is intended to assist in delegation of responsibilities between duplicate applet instances.

This is meant to be overridden in individual applets

### on_applet_added_to_panel ()

    on_applet_added_to_panel ();

This function is called by appletManager when the applet is added to the panel.

This is meant to be overridden in individual applets.

### on_applet_removed_from_panel ()

    on_applet_removed_from_panel ();

This function is called by appletManager when the applet is removed from the panel.

This is meant to be overridden in individual applets.

### setOrientation ()

    setOrientation (St.Side   orientation);

Sets the orientation of the applet.

This function should only be called by appletManager

#### Parameters

orientation | the orientation |

### on_orientation_changed ()

    on_orientation_changed (St.Side   orientation);

This function is called when the applet is changes orientation.

This is meant to be overridden in individual applets.

#### Parameters

orientation | new orientation of the applet |

### setPanelHeight ()

    setPanelHeight (int   panelHeight);

Sets the panel height property of the applet.

#### Parameters

panelHeight | panelHeight |

### on_panel_height_changed ()

    on_panel_height_changed ();

This function is called when the panel containing the applet changes height

This is meant to be overridden in individual applets.

## Property Details

### The `“actor”` property

      “actor”                St.BoxLayout

Actor of the applet

### The `“instance_id”` property

      “instance_id”          int

Instance id of the applet

### The `“_uuid”` property

      “_uuid”                string

UUID of the applet. This is set by appletManager after the applet is loaded.

### The `“_panelLocation”` property

      “_panelLocation”       St.BoxLayout

Panel sector containing the applet. This is set by appletManager after the applet is loaded.

### The `“panel”` property

      “panel”                Panel.Panel

The panel object containing the applet. This is set by appletManager after the applet is loaded.

### The `“_meta”` property

      “_meta”                JSON

The metadata of the applet. This is set by appletManager after the applet is loaded.

### The `“_order”` property

      “_order”               int

The order of the applet within a panel location This is set by appletManager after the applet is loaded.

### The `“_draggable”` property

      “_draggable”           Dnd._Draggable

The draggable object of the applet

### The `“_scaleMode”` property

      “_scaleMode”           boolean

Whether the applet scales according to the panel size

### The `“_applet_tooltip”` property

      “_applet_tooltip”      Tooltips.PanelItemTooltip

The tooltip of the applet

### The `“_menuManager”` property

      “_menuManager”         PopupMenu.PopupMenuManager

The menu manager of the applet

### The `“_applet_context_menu”` property

      “_applet_context_menu”  Applet.AppletContextMenu

The context menu of the applet

### The `“_applet_tooltip_text”` property

      “_applet_tooltip_text”  string

Text of the tooltip