From: <no...@tc...> - 2025-08-05 14:18:16
|
Automated mail by fx, on behalf of no...@tc... Ticket Change [67cb3c7515526ca58ba7a10a68265772eb56735149ce65e5097bb6fbe2127af3] [Add "::SelectColor::use" to pckIndex.tcl] By anonymous For BWidget On 2025-08-05T14:04:33.220 Details https://core.tcl-lang.org/bwidget/tinfo?name=67cb3c7515526ca58ba7a10a68265772eb56735149ce65e5097bb6fbe2127af3 Ticket https://core.tcl-lang.org/bwidget/tktview/c847b2c68dfbf89453de19b2fcf341a02338ca82 Changed Fields closedate: 2025-08-05 14:04:33 closer: anonymous comment: 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 username: TWu ------------------------------------------------------------ See Tcl/Tk development @ http://core.tcl-lang.org/ ------------------------------------------------------------ |