Skip to content

Gtk.IMMulticontext

class — extends IMContext

Supports switching between multiple input methods.

Text widgets such as GtkText or GtkTextView use a GtkIMMultiContext to implement their im-module property for switching between different input methods.

Constructors

new

@classmethod
def new(cls) -> IMContext

Creates a new GtkIMMulticontext.

Methods

get_context_id

def get_context_id(self) -> str

Gets the id of the currently active delegate of the context.

set_context_id

def set_context_id(self, context_id: str | None = ...) -> None

Sets the context id for context.

This causes the currently active delegate of context to be replaced by the delegate corresponding to the new context id.

Setting this to a non-None value overrides the system-wide IM module setting. See the Settings.gtk-im-module property.

Parameters:

  • context_id — the id to use