component(3itcl)
β¨ NAME β¨
itcl::component β bestie, this is the one that lets you define components for extendedclass, widget, or widgetadaptor π
It lives in section 3itcl of the [incr Tcl] manual, and honestly? It's giving main character energy.
Heads up: parts of this description are "borrowed" from the Tcl extension [snit], because the functionality is mostly identical. Credit where credit is due, periodt. π«Ά
π WARNING! π
Not me having to say this but: this is new functionality in [incr Tcl] where the API can still change!! π So likeβ¦ don't build your whole personality on it yet. It might shift under you.
πΈ SYNOPSIS πΈ
public component comp ?-inherit?
protected component comp ?-inherit?
private component comp ?-inherit?
π¦ DESCRIPTION π¦
Okay so the component command is what you use inside an [incr Tcl] extendedclass / widget / widgetadaptor definition to define your components. It's literally the whole point of this page, iykyk. β¨
What it does:
- Explicitly declares a component called
compπ - And automatically defines that component's instance variable for you, no extra work required π
π the -inherit option
If you pass the -inherit option, then all unknown methods and options get delegated to this component. Slay.
The name -inherit is lowkey implying that instances of this new type inherit, in a sense, the methods and options of the component. So -inherit yes is equivalent to this:
component mycomp
delegate option * to mycomp
delegate method * to mycomp
Likeβ¦ that's the whole vibe right there. Obsessed. π
π₯ KEYWORDS π₯
component, widget, widgetadaptor, extendedclass
Okay bestie, that's the whole page!! This was component(3itcl) from itcl 4.0, brought to you by [incr Tcl] β go forth and define your components, you absolute icon π§β¨π
π¦ where this page comes from
- debian bookworm: tcl-itcl4-doc 4.2.3-1 Β· BSD-Tcl
- debian trixie: tcl-itcl4-doc 4.3.2-3 Β· BSD-Tcl
- ubuntu jammy: tcl-itcl4-doc 4.2.2-1 Β· BSD-Tcl
- ubuntu noble: tcl-itcl4-doc 4.2.4-1 Β· BSD-Tcl
- ubuntu questing: tcl-itcl4-doc 4.3.2-3
- ubuntu resolute: tcl-itcl4-doc 4.3.5-1 Β· BSD-Tcl
- ubuntu stonking: tcl-itcl4-doc 4.3.8-1 Β· BSD-Tcl
- Copyright (c) 2008 Arnulf Wiedemann
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms