Gtk2::E...mpletion(3)
π 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::CellLayoutGtk2::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, orundefif 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_datais optional, defaults toundef.$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 aGtk2::TreeModel, orundef.$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: defaultfalse: readable / writable / private / static-nick / static-blurb) β should the common prefix get inserted automatically? that's the question.'inline-selection'(boolean: defaultfalse: 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: default1: readable / writable / private / static-nick / static-blurb) β the shortest search key she'll accept before she bothers looking up matches.'model'(Gtk2::TreeModel: defaultundef: readable / writable / private / static-nick / static-blurb) β the model where she goes to find matches.'popup-completion'(boolean: defaulttrue: readable / writable / private / static-nick / static-blurb) β should completions pop up in a window?'popup-set-width'(boolean: defaulttrue: readable / writable / private / static-nick / static-blurb) β ifTRUE, the popup window matches the entry's size. twinning fr fr.'popup-single-match'(boolean: defaulttrue: readable / writable / private / static-nick / static-blurb) β ifTRUE, 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:
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.
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
- 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