itclcomponent(n)

itclcomponentn

Define components for extendedclass, widget or widgetadaptor parts of this description are "borrowed" from tcl extension [snit], as the functionality is mostly identical.

Usage

public component comp ?-inherit?
protected component comp ?-inherit?
private component comp ?-inherit?

    


    


    

Warning!

This is new functionality in [incr Tcl] where the API can still change!!

Overview

The component command is used inside an [incr Tcl] extendedclass/widget/widgetadaptor definition to define components.

Explicitly declares a component called comp, and automatically defines the component's instance variable.

If the -inherit option is specified then all unknown methods and options will be delegated to this component. The name -inherit implies that instances of this new type inherit, in a sense, the methods and options of the component. That is, -inherit yes is equivalent to:

component mycomp
delegate option * to mycomp
delegate method * to mycomp

Keywords

component, widget, widgetadaptor, extendedclass

From tcl 8.6.16-1 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.