Desklet.Desklet: Cinnamon Javascript Reference Manual

## Desklet.Desklet Desklet.Desklet — Base desklet class to be inherited |

## Functions

| _init ()
| setHeader ()
| setContent ()
| on_desklet_removed ()
| on_desklet_reloaded ()
| destroy ()
| on_desklet_added_to_desktop ()
| highlight ()

## Properties

dictionary | metadata |
St.BoxLayout | actor |
St.Bin | content |
int | instance_id |

## Object Hierarchy

        Object
        ╰── Desklet.Desklet

## Description

`Desklet` is a base class in which other desklets can inherit

## Functions

### _init ()

    _init (dictionary   metadata,
           int          desklet_id);

Constructor function

#### Parameters

metadata | the metadata of the desklet |
desklet_id | instance id of the desklet |

### setHeader ()

    setHeader (string   header);

Sets the header text of the desklet to `header`

#### Parameters

header | the header of the desklet |

### setContent ()

    setContent (Clutter.Actor   actor,
                dictionary      params);

Sets the content actor of the desklet as `actor`

#### Parameters

actor | actor to be set as child |
params | (optional) parameters to be sent. This argument is ignored. Only kept for compatibility reasons |

### on_desklet_removed ()

    on_desklet_removed ();

Callback when desklet is removed. To be overridden by individual desklets

### on_desklet_reloaded ()

    on_desklet_reloaded ();

Callback when desklet is reloaded. To be overridden by individual desklets

### destroy ()

    destroy ();

Destroys the actor with an fading animation

### on_desklet_added_to_desktop ()

    on_desklet_added_to_desktop ();

This function is called by deskletManager when the desklet is added to the desktop.

This is meant to be overridden in individual applets.

### highlight ()

    highlight (boolean   highlight);

Turns on/off the highlight of the desklet

#### Parameters

highlight | whether to turn on or off |

## Property Details

### The `“metadata”` property

      “metadata”                 dictionary

Metadata of desklet

### The `“actor”` property

      “actor”                    St.BoxLayout

Actor of desklet

### The `“content”` property

      “content”                  St.Bin

The actor containing the content of the actor

### The `“instance_id”` property

      “instance_id”              int

Instance id of the desklet