Gtk2::E...mpletion(3)

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

πŸ’– Gtk2::EntryCompletion β€” the manual, but make it make sense πŸ’–

okay bestie, so this is the page for Gtk2::EntryCompletion in the user-contributed Perl documentation, and it's literally a wrapper for GtkEntryCompletion. that's the whole NAME moment. she's a little autocomplete queen and she's about to run your whole text entry's life πŸ’…


🌸 HIERARCHY 🌸

so here's the family tree, and yes she's an heiress:

Glib::Object
+----Gtk2::EntryCompletion

πŸ¦‹ INTERFACES πŸ¦‹

she also showed up wearing two whole interfaces, no big deal:

  • Gtk2::CellLayout
  • Gtk2::Buildable

✨ METHODS ✨

this is the part you actually came for, so let's go 🫢

  • entrycompletion = Gtk2::EntryCompletion->new β€” constructor baby, makes you a fresh new completion object.
  • $completion->complete β€” tells her to go do the completing thing, right now, no waiting.
  • string or undef = $completion->get_completion_prefix β€” hands you back the current prefix, or undef if there isn't one. Since: gtk+ 2.12
  • $completion->delete_action ($index) β€” yeets the action sitting at that index.
    • $index (integer)
  • widget = $entry->get_entry β€” gives you back the entry widget. yes it's called on $entry, that's just how she is πŸ™ˆ
  • boolean = $completion->get_inline_completion β€” is inline completion on? true/false. Since: gtk+ 2.6
  • $completion->set_inline_completion ($inline_completion) β€” turn inline completion on or off.
    • $inline_completion (boolean)
    • Since: gtk+ 2.6
  • boolean = $completion->get_inline_selection β€” is inline selection on? true/false. Since: gtk+ 2.12
  • $completion->set_inline_selection ($inline_selection) β€” turn inline selection on or off.
    • $inline_selection (boolean)
    • Since: gtk+ 2.12
  • $completion->insert_action_markup ($index, $markup) β€” drops an action in at $index, with markup for the label.
    • $index (integer)
    • $markup (string)
  • $completion->insert_action_text ($index, $text) β€” same vibe, but plain text instead of markup.
    • $index (integer)
    • $text (string)
  • $completion->insert_prefix β€” inserts the prefix. that's it, that's the method. Since: gtk+ 2.6
  • $completion->set_match_func ($func, $func_data=undef) β€” hand her your own matching function so you decide what counts as a match. $func_data is optional, defaults to undef.
    • $func (scalar)
    • $func_data (scalar)
  • integer = $completion->get_minimum_key_length β€” how many characters you gotta type before she even starts looking. as an integer.
  • $completion->set_minimum_key_length ($length) β€” set that minimum yourself.
    • $length (integer)
  • treemodel = $completion->get_model β€” gives you the model she's matching against.
  • $completion->set_model ($model) β€” hand her the model to find matches in. it can be a Gtk2::TreeModel, or undef.
    • $model (Gtk2::TreeModel or undef)
  • boolean = $completion->get_popup_completion β€” are completions showing up in a popup? true/false. Since: gtk+ 2.6
  • $completion->set_popup_completion ($popup_completion) β€” decide whether completions appear in a popup window.
    • $popup_completion (boolean)
    • Since: gtk+ 2.6
  • boolean = $completion->get_popup_set_width β€” does the popup get sized to the entry? true/false. Since: gtk+ 2.8
  • $completion->set_popup_set_width ($popup_set_width) β€” flip that behaviour on or off.
    • $popup_set_width (boolean)
    • Since: gtk+ 2.8
  • boolean = $completion->get_popup_single_match β€” does the popup show even when there's only one match? true/false. Since: gtk+ 2.8
  • $completion->set_popup_single_match ($popup_single_match) β€” set whether a lone match still gets a popup.
    • $popup_single_match (boolean)
    • Since: gtk+ 2.8
  • integer = $completion->get_text_column β€” which column of the model holds your strings. as an integer. Since: gtk+ 2.6
  • $completion->set_text_column ($column) β€” point her at that column yourself.
    • $column (integer)

πŸŽ€ PROPERTIES πŸŽ€

every single one of these is readable / writable / private / static-nick / static-blurb, so that's the whole vibe, and here's the tea on each:

  • 'inline-completion' (boolean : default false : readable / writable / private / static-nick / static-blurb) β€” should the common prefix get inserted automatically? that's the question.
  • 'inline-selection' (boolean : default false : readable / writable / private / static-nick / static-blurb) β€” Your description here. no really, that's what it says. iconic honestly, someone left the placeholder in and never came back πŸ’€
  • 'minimum-key-length' (integer : default 1 : readable / writable / private / static-nick / static-blurb) β€” the shortest search key she'll accept before she bothers looking up matches.
  • 'model' (Gtk2::TreeModel : default undef : readable / writable / private / static-nick / static-blurb) β€” the model where she goes to find matches.
  • 'popup-completion' (boolean : default true : readable / writable / private / static-nick / static-blurb) β€” should completions pop up in a window?
  • 'popup-set-width' (boolean : default true : readable / writable / private / static-nick / static-blurb) β€” if TRUE, the popup window matches the entry's size. twinning fr fr.
  • 'popup-single-match' (boolean : default true : readable / writable / private / static-nick / static-blurb) β€” if TRUE, the popup window appears even for a single match.
  • 'text-column' (integer : default -1 : readable / writable / private / static-nick / static-blurb) β€” the column of the model that's holding the strings.

πŸ’œ SIGNALS πŸ’œ

four signals, four lil moments, all listed exactly like this:

  • action-activated (Gtk2::EntryCompletion, integer)
  • boolean = cursor-on-match (Gtk2::EntryCompletion, Gtk2::TreeModel, Gtk2::TreeIter)
  • boolean = insert-prefix (Gtk2::EntryCompletion, string)
  • boolean = match-selected (Gtk2::EntryCompletion, Gtk2::TreeModel, Gtk2::TreeIter)

πŸ‘‘ SEE ALSO πŸ‘‘

go read these too, bestie, they're the supporting cast:

  • 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.


and that's the whole page, babe 🫢 this little love letter shipped in perl v5.42.0 and it's dated 2025-07-25, so if you're reading this, drink some water, go finish your autocomplete, and remember: you understood the whole thing, periodt πŸ’…βœ¨

πŸ“¦ where this page comes from