ModalDialog.InfoOSD: Cinnamon Javascript Reference Manual

## ModalDialog.InfoOSD ModalDialog.InfoOSD — An OSD that displays information to users |

## Functions

| _init ()
| show ()
| hide ()
| destroy ()
| addText ()
| addActor ()

## Properties

St.BoxLayout | actor |

## Object Hierarchy

        Object
        ╰── ModalDialog.InfoOSD

## Description

Creates an OSD to show information to user at the center of the screen. Can display texts or a general `St.Widget`. This is useful as "hints" to the user, eg. the popup shown when the user clicks the "Add panel" button to guide them how to add a panel.

This does not destroy itself, and the caller of this is responsible for destroying it after usage (via the `destroy` function), or hiding it with `hide` for later reuse.

## Functions

### _init ()

    _init (string   text);

Constructor function. Creates an OSD and adds it to the chrome. Adds a label with text `text` if specified.

#### Parameters

text | (optional) Text to display on the OSD |

### show ()

    show (int   monitorIndex);

Shows the OSD at the center of monitor `monitorIndex`. Shows at the primary monitor if not specified.

#### Parameters

monitorIndex | (optional) Monitor to display OSD on. Default is primary monitor |

### hide ()

    hide ();

Hides the OSD.

### destroy ()

    destroy ();

Destroys the OSD

### addText ()

    addText (string   text,
             JSON     params);

Adds a text label displaying `text` to the OSD

#### Parameters

text | text to display |
params | parameters to be used when adding text |

### addActor ()

    addActor (St.Widget   actor,
              JSON        params);

Adds the actor `actor` to the OSD

#### Parameters

actor | actor to add |
params | parameters to be used when adding actor |

## Property Details

### The `“actor”` property

      “actor”                    St.BoxLayout

actor of the OSD