This is an extraction from ticket [378209fe].

Quote:
For BWidget knows the command "use" for SelectColor, please add in pkgInit.tcl the command "::SelectColor::use" right at the end of the definition list for it.

I tried this:

<verbatim>
% SelectColor .s
% .s use
wrong # args: should be "::Dialog::use"
</verbatim>

Error message is bogus. No command "use" found in SelectColor or Dialog documentation.

But in Widget::define, there is a comment that the use command is related to late loading.
This is connected to pkgIndex.tcl.

Hello Harald,

to document why we got the "bogus" message, look at the beginning of source of SelectColor.
On line 2 we find "Widget::define SelectColor color Dialog".

Before the change the pseudo-class-mechanism try to call SelectColor::use,
which not exists and is not defined in the package to be created thru Widget::init.
So the next class (here Dialog) is requested.
It has no own definition (overwriting the Widget-base).
So the Widget::use is called with class "Dialog".
Unfortunately the class of .s (from our example above) is SelectColor and not Dialog!

After the change we claimed a "use" for SelectColor in the pkgIndex.tcl.
On initialization this proc is generated.
Now the same mechanism runs, calling the not overwritten SelectColor::use.
Not the Widget::use is called and not Dialog::use, but the own one with the right class of itself!
No error message any longer - and the "use" command resolves and
gives back the class hierarchy right.

Hope, this helps for the next problems...

All the best, Thomas W.