component(n)
β¨ component(n) β the itcl::component glow-up β¨
okay bestie, so this is the component(n) page from [incr Tcl] β yeah, manual name itcl, section n, she's a Tcl thing π
β and we're about to make components make sense, fr fr.
πΈ NAME πΈ
itcl::component β define components for extendedclass, widget or widgetadaptor
ngl, some parts of this description are literally "borrowed" from the Tcl extension [snit], because the functionality is mostly identical. we're giving credit where credit is due π«Ά
π WARNING! π
This is new functionality in [incr Tcl] where the API can still change!!
not me warning you that the API is still in her experimental era π things can shift under you, so stay alert bestie.
β¨ SYNOPSIS β¨
public component comp ?-inherit?
protected component comp ?-inherit?
private component comp ?-inherit?
three access levels, one iconic little command. pick your vibe π
π¦ DESCRIPTION π¦
so the component command is what you use inside an [incr Tcl] extendedclass/widget/widgetadaptor definition to define components. it's an inside-job situation, she does not work out in the open.
it explicitly declares a component called comp, and β the part that's lowkey magic β it automatically defines the component's instance variable. no extra work, she just appears. main character energy tbh β
if you pass the -inherit option, then all unknown methods and options get delegated to this component. and the way the name reads, -inherit is implying that instances of this new type inherit, in a sense, the methods and options of the component. like she's passing down the family recipes π
so basically, -inherit yes is equivalent to:
component mycomp
delegate option * to mycomp
delegate method * to mycomp
same energy, fewer lines. slay β¨
π₯ KEYWORDS π₯
component, widget, widgetadaptor, extendedclass
and that's the whole page, bestie β no cap π this was component(n) from itcl version 4.0, dated... well, the footer says component(n) right back at you, so consider yourself fully informed. go forth and delegate ππ¦π
π¦ where this page comes from
- alpine 3.22: tcl-doc 8.6.16-r0 Β· TCL
- alpine 3.23: tcl-doc 8.6.17-r0 Β· TCL
- alpine 3.23: tcl9-doc 9.0.3-r0 Β· TCL
- alpine 3.24: tcl-doc 8.6.17-r1 Β· TCL
- alpine 3.24: tcl9-doc 9.0.3-r2 Β· TCL
- arch rolling: tcl 8.6.16-1 Β· TCL
- fedora 43: itcl 4.3.2-1.fc43 Β· TCL
- fedora 43: itcl 4.3.2-2.fc43 Β· TCL
- fedora 44: itcl 4.3.2-3.fc44 Β· TCL
- nixos 26.05: tcl 9.0.3
- nixpkgs unstable: incrtcl 4.2.3
- nixpkgs unstable: tcl 9.1.0
- opensuse-leap 16.0: tcl 8.6.15-160000.2.2 Β· TCL
- opensuse-leap 16.0: tcl 8.6.15-160000.2.2 Β· TCL
- opensuse-leap 16.0: tcl 8.6.15-160000.2.2 Β· TCL
- opensuse-leap 16.0: tcl 8.6.15-160000.2.2 Β· 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