Gtk2::IMContext(3)
π Gtk2::IMContext β the whole vibe π
okay so bestie, this is Gtk2::IMContext(3), from the User Contributed Perl Documentation corner of the world. It's the Perl wrapper for GtkIMContext β that's the little guy that handles input methods, like when you're typing in Japanese or Korean or any of the input-method girlies and your keyboard needs to do a whole sΓ©ance before the right character shows up. π
No cap, this page is basically a list of methods and signals, so let's get into it. β¨
πΈ HIERARCHY πΈ
it's giving object-oriented royalty, and the family tree is real simple:
Glib::Object
+----Gtk2::IMContext
one parent, one baby. iconic. π
π METHODS π
okay so here's every method, and I'm not skipping a single one, because we don't do that here. π«Ά
$context->set_client_window ($window)β hands over the client window. takes one arg:$window(aGtk2::Gdk::Window, orundefif you're feeling mysterious and windowless) π¦
$context->set_cursor_location ($area)β tells the context where the cursor is chillin'. takes one arg:$area(aGtk2::Gdk::Rectangle) πΈ
boolean = $context->delete_surrounding ($offset, $n_chars)β returns a boolean, and it takes:$offset(integer)$n_chars(integer)
boolean = $context->filter_keypress ($key_event)β returns a boolean, and it takes:$key_event(aGtk2::Gdk::Event) β¨οΈ
$context->focus_inβ no args, no drama, it just happens. main character energy. β¨$context->focus_outβ the exit, the outro, the closing credits. πlist = $context->get_preedit_stringβ no args, and you get a list back. π$context->resetβ the literal factory reset of vibes. no args. πlist = $context->get_surroundingβ no args, returns a list. π$context->set_surrounding ($text, $cursor_index)β sets the surrounding text, takes:$text(string)$cursor_index(integer) π
$context->set_use_preedit ($use_preedit)β toggles the preedit situation, takes:$use_preedit(boolean) β
π₯ SIGNALS π₯
these are the signals it emits, and yes I'm listing all six because every single one matters:
commitβ signature is(Gtk2::IMContext, string)π«boolean = delete-surroundingβ signature is(Gtk2::IMContext, integer, integer)πpreedit-changedβ signature is(Gtk2::IMContext)πΈpreedit-endβ signature is(Gtk2::IMContext)πpreedit-startβ signature is(Gtk2::IMContext)β¨boolean = retrieve-surroundingβ signature is(Gtk2::IMContext)π
π¦ SEE ALSO π¦
if you wanna go deeper (iykyk), go check out:
Gtk2Glib::Object
π COPYRIGHT π
Copyright (C) 2003-2011 by the gtk2-perl team. π«Ά
This software is licensed under the LGPL. See Gtk2 for a full notice. π
not me actually respecting the license terms, as one does π
and that's the whole page bestie!! this came to you from perl v5.42.0, dated 2025-07-25, and it's the Gtk2::IMContext(3) page β slay, ate, no crumbs left, periodt. πβ¨π
π¦ where this page comes from
- fedora 43: perl-Gtk2 1.24993-23.fc43 Β· LicenseRef-Callaway-LGPLv2+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms