matchbox(3tcl)
π matchbox β the manual, but make it cute π
okay bestie, sit down, hydrate, because we're about to talk about matchbox from the Tk Themed Widget family (that's the 3tcl manual, for the record π). It's a text field with popdown selection and completion lists and honestly? she ate. π
β¨ NAME β¨
matchbox β a text field with popdown selection and completion lists π
πΈ SYNOPSIS πΈ
package require Tk 8.6.3
package require matchbox 1.0
like, that's it. that's the whole summoning ritual. no cap. β¨
π¦ DESCRIPTION π¦
so the ttk::matchbox widget is literally an extension of the regular ttk::combobox widget. which means you can drop it in anywhere you're currently using a ttk::combobox and change absolutely nothing else in your code. it's giving effortless. it's giving plug-and-play. π
the difference between ttk::matchbox and ttk::combobox? it's all in how she interacts with the user. an empty ttk::matchbox looks exactly like a ttk::combobox β same vibe, same energy. but the moment there's any text in the ttk::matchbox, an icon pops up on the right-hand side of the text field. π and bestie, the user can just click that icon to erase the text. one tap. gone. iconic.
π WIDGET-SPECIFIC OPTIONS π
-matchcommandβ if you specify this option, an extra drop-down list can show up with possible completions for whatever string got entered. β¨
okay so here's the tea on how -matchcommand actually works: whenever the user changes the value of the ttk::matchbox widget, the command you handed over via -matchcommand gets invoked with one additional argument β and that argument is the current value of the widget. π«Ά
your command is expected to return a list of possible completions. those completions get presented to the user through the widget's second drop-down list. and if your command returns an empty list, then guess what β the drop-down list will not be displayed at all. no list, no drama. π
β οΈ Note: the match command is not invoked when the user selects an entry from the main drop-down list. so don't be out here expecting it to fire in that case, bestie. it simply does not. π
π§ DEFAULT BINDINGS π§
the ttk::matchbox has one extra key binding on top of everything else:
Control-uβ also erases all the text in thettk::matchbox. keyboard shortcut queen. β¨οΈπ
β COPYRIGHT β
Copyright (c) 2017 Schelte Bron πΈ
and that's the whole page, fr fr. this was matchbox version 1.0, documented as part of the doc collection and living its best life in the 3tcl manual section. mwah, love u, go build something cute with her πππ¦
π¦ where this page comes from
- debian bookworm: tk-fsdialog 2.0~fs20200322.97fa62c-1 Β· ISC
- debian trixie: tk-fsdialog 2.0~fs20200322.97fa62c-1 Β· ISC
- ubuntu jammy: tk-fsdialog 2.0~fs20200322.97fa62c-1 Β· ISC
- ubuntu noble: tk-fsdialog 2.0~fs20200322.97fa62c-1 Β· ISC
- ubuntu questing: tk-fsdialog 2.0~fs20200322.97fa62c-1
- Copyright (c) 2017 Schelte Bron
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms