Gtk2::IMContext(3)

πŸ“¦
version 1.24993 Β· 2 versions
, in fedora 43

πŸ’– 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 (a Gtk2::Gdk::Window, or undef if you're feeling mysterious and windowless) πŸ¦‹
  • $context->set_cursor_location ($area) β€” tells the context where the cursor is chillin'. takes one arg:
    • $area (a Gtk2::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 (a Gtk2::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:

  • Gtk2
  • Glib::Object

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