Skip to content

Gtk.EmojiChooser

class — extends Popover, Accessible, Buildable, ConstraintTarget, Native, ShortcutManager

Used by text widgets to let users insert Emoji characters.

<picture> <source srcset="emojichooser-dark.png" media="(prefers-color-scheme: dark)"> <img alt="An example GtkEmojiChooser" src="emojichooser.png"> </picture>

GtkEmojiChooser emits the EmojiChooser.emoji-picked signal when an Emoji is selected.

Shortcuts and Gestures

GtkEmojiChooser supports the following keyboard shortcuts:

  • <kbd>Ctrl</kbd>+<kbd>N</kbd> scrolls th the next section.
  • <kbd>Ctrl</kbd>+<kbd>P</kbd> scrolls th the previous section.

Actions

GtkEmojiChooser defines a set of built-in actions:

  • scroll.section scrolls to the next or previous section.

CSS nodes

popover
├── box.emoji-searchbar
│   ╰── entry.search
╰── box.emoji-toolbar
    ├── button.image-button.emoji-section
    ├── ...
    ╰── button.image-button.emoji-section

Every GtkEmojiChooser consists of a main node called popover. The contents of the popover are largely implementation defined and supposed to inherit general styles. The top searchbar used to search emoji and gets the .emoji-searchbar style class itself. The bottom toolbar used to switch between different emoji categories consists of buttons with the .emoji-section style class and gets the .emoji-toolbar style class itself.

Constructors

new

@classmethod
def new(cls) -> Widget

Creates a new GtkEmojiChooser.

Signals

emoji-picked

def on_emoji_picked(self, text: str) -> None: ...

Emitted when the user selects an Emoji.