1.68 <AdwToastOverlay>

Class: <AdwToastOverlay>

It derives from <GtkWidget>.

A widget showing toasts above its content.

Much like <GtkOverlay>, <AdwToastOverlay> is a container with a single main child, on top of which it can display a Toast, overlaid. Toasts can be shown with ToastOverlay.add_toast.

Use ToastOverlay.dismiss_all to dismiss all toasts at once, or Toast.dismiss to dismiss a single toast.

See Toast for details.

CSS nodes

toastoverlay
├── [child]
├── toast
┊   ├── widget
┊   │   ├── [label.heading]
    │   ╰── [custom title]
    ├── [button]
    ╰── button.circular.flat

<AdwToastOverlay>’s CSS node is called toastoverlay. It contains the child, as well as zero or more toast subnodes.

Each of the toast nodes contains a widget subnode, optionally a button subnode, and another button subnode with .circular and .flat style classes.

The widget subnode contains a label subnode with the .heading style class, or a custom widget provided by the application.

Accessibility

<AdwToastOverlay> uses the Gtk.AccessibleRole.group role.

Properties

Property: toast-overlay:child self

The child widget.

Its value is a <GtkWidget>, or #f.

Set it with (set! (toast-overlay:child self) value).

Procedures

Method: toast-overlay:add-toast self toast
Method: add-toast self toast

Displays toast.

Only one toast can be shown at a time; if a toast is already being displayed, either toast or the original toast will be placed in a queue, depending on the priority of toast. See Toast:priority.

If called on a toast that’s already displayed, its timeout will be reset.

If called on a toast currently in the queue, the toast will be bumped forward to be shown as soon as possible.

self

Passed: a <AdwToastOverlay>.

a toast overlay

toast

Passed: a <AdwToast>.

a toast

Method: toast-overlay:dismiss-all self
Method: dismiss-all self

Dismisses all displayed toasts.

Use Toast.dismiss to dismiss a single toast.

self

Passed: a <AdwToastOverlay>.

a toast overlay

Method: toast-overlay:get-child self ⇒ %return
Method: get-child self ⇒ %return

Gets the child widget of self.

self

Passed: a <AdwToastOverlay>.

a toast overlay

%return

Returned: a <GtkWidget>, or #f.

the child widget of self

Procedure: toast-overlay:new ⇒ %return

Creates a new <AdwToastOverlay>.

%return

Returned: a <GtkWidget>.

the new created <AdwToastOverlay>

Method: toast-overlay:set-child self [child]
Method: set-child self [child]

Sets the child widget of self.

self

Passed: a <AdwToastOverlay>.

a toast overlay

child

Passed, or left out: a <GtkWidget>, or #f.

the child widget