Gtk.IMContextClass

Fields

Name

Type

Access

Description

activate_osk

object

r

commit

object

r

Default handler of the [signal`Gtk`.IMContext::commit] signal.

delete_surrounding

object

r

Default handler of the [signal`Gtk`.IMContext::delete-surrounding] signal.

filter_keypress

object

r

Called via [method`Gtk`.IMContext.filter_keypress] on every key press or release event. Every non-trivial input method needs to override this in order to implement the mapping from key events to text. A return value of True indicates to the caller that the event was consumed by the input method. In that case, the [signal`Gtk`.IMContext::commit] signal should be emitted upon completion of a key sequence to pass the resulting text back to the input widget. Alternatively, False may be returned to indicate that the event wasn’t handled by the input method. If a builtin mapping exists for the key, it is used to produce a character.

focus_in

object

r

Called via [method`Gtk`.IMContext.focus_in] when the input widget has gained focus. May be overridden to keep track of the current focus.

focus_out

object

r

Called via [method`Gtk`.IMContext.focus_out] when the input widget has lost focus. May be overridden to keep track of the current focus.

get_preedit_string

object

r

Called via [method`Gtk`.IMContext.get_preedit_string] to retrieve the text currently being preedited for display at the cursor position. Any input method which composes complex characters or any other compositions from multiple sequential key presses should override this method to provide feedback.

get_surrounding

object

r

Called via [method`Gtk`.IMContext.get_surrounding] to update the context around the cursor location. It is not necessary to override this method even with input methods which implement context-dependent behavior. The base implementation emits [signal`Gtk`.IMContext::retrieve-surrounding] and records the context received by the subsequent invocation of [vfunc`Gtk`.IMContext.get_surrounding].

get_surrounding_with_selection

object

r

Called via [method`Gtk`.IMContext.get_surrounding_with_selection] to update the context around the cursor location. It is not necessary to override this method even with input methods which implement context-dependent behavior. The base implementation emits [signal`Gtk`.IMContext::retrieve-surrounding] and records the context received by the subsequent invocation of [vfunc`Gtk`.IMContext.get_surrounding].

parent_class

GObject.ObjectClass

r

preedit_changed

object

r

Default handler of the [signal`Gtk`.IMContext::preedit-changed] signal.

preedit_end

object

r

Default handler of the [signal`Gtk`.IMContext::preedit-end] signal.

preedit_start

object

r

Default handler of the [signal`Gtk`.IMContext::preedit-start] signal.

reset

object

r

Called via [method`Gtk`.IMContext.reset] to signal a change such as a change in cursor position. An input method that implements preediting should override this method to clear the preedit state on reset.

retrieve_surrounding

object

r

Default handler of the [signal`Gtk`.IMContext::retrieve-surrounding] signal.

set_client_widget

object

r

Called via [method`Gtk`.IMContext.set_client_widget] when the input window where the entered text will appear changes. Override this to keep track of the current input window, for instance for the purpose of positioning a status display of your input method.

set_cursor_location

object

r

Called via [method`Gtk`.IMContext.set_cursor_location] to inform the input method of the current cursor location relative to the client window. May be overridden to implement the display of popup windows at the cursor position.

set_surrounding

object

r

Called via [method`Gtk`.IMContext.set_surrounding] in response to [signal`Gtk`.IMContext::retrieve-surrounding] signal to update the input method’s idea of the context around the cursor. It is not necessary to override this method even with input methods which implement context-dependent behavior. The base implementation is sufficient for [method`Gtk`.IMContext.get_surrounding] to work.

set_surrounding_with_selection

object

r

Called via [method`Gtk`.IMContext.set_surrounding_with_selection] in response to the [signal`Gtk`.IMContext::retrieve-surrounding] signal to update the input method’s idea of the context around the cursor. It is not necessary to override this method even with input methods which implement context-dependent behavior. The base implementation is sufficient for [method`Gtk`.IMContext.get_surrounding] to work.

set_use_preedit

object

r

Called via [method`Gtk`.IMContext.set_use_preedit] to control the use of the preedit string. Override this to display feedback by some other means if turned off.

Methods

None

Details

class Gtk.IMContextClass