Overview
Artifact ID: | 67cb3c7515526ca58ba7a10a68265772eb56735149ce65e5097bb6fbe2127af3 (Awaiting Moderator Approval) |
---|---|
Ticket: | c847b2c68dfbf89453de19b2fcf341a02338ca82
Add "::SelectColor::use" to pckIndex.tcl |
User & Date: | anonymous 2025-08-05 14:04:33 |
Changes
- closedate changed to: "2460893.0864956"
- closer changed to: "anonymous"
- comment changed to:
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.
- icomment:
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.
- login: "anonymous"
- mimetype: "text/plain"
- username: "TWu"