Skip to content
Tcl Source Code Artifact [224c75f059]
Login

Artifact [224c75f059]

Artifact 224c75f059523baeb2bf12af291cfe3a13ef91b7e6a67e231186fee59f0a39c6:

Ticket change [224c75f059] - Ticket [91b3a5bb14e6e8ae|91b3a5bb14] <i>msgcat with oo: error &quot;self may only be called from inside a method&quot;</i> status still Open with 3 other changes by dkf on 2024-07-15 08:23:00.
D 2024-07-15T08:23:00.477
J icomment The\s`self`\scommands\sall\srequire\sthat\sthe\scurrent\sstack\sframe\sat\spoint\sof\sinvocation\sbe\sone\smade\sby\sTclOO.\sThis\sis\sused\sto\slook\sup\scontext\sinformation\sthat\scan't\sbe\sminted\sotherwise\sby\sTcl\sscripts\s(it's\ssome\sflags\sand\sthe\sclientData\spointer,\snot\sjust\ssome\sundocumented\sTcl\svariable).\r\n\r\nThe\sproposed\schanges\smight\snot\swork;\sobject\snames\saren't\smatched\sto\snamespace\snames\sunder\squite\sa\sfew\scommon\scircumstances.\s(Objects\scan\sbe\s`rename`d;\snamespaces\scannot.)\sIt's\swise\sto\scheck\sthese\sthings\swith\san\sobject\smade\swith\s`oo::object\screate\sfoo`,\sthe\ssimplest\scase\swhere\ssuch\sa\smatch\sdoesn't\soccur.\r\n\r\nI\ssuspect\sthat\sthe\s*real*\sfix\sis\sto\salter\swhat\sthe\sspecific\s`namespace\sinscope`\sdoes\s(i.e.,\sthe\s`namespace\scode`\scall).\sIn\sparticular,\s`show\s.toolbar.one`\sshould\sprobably\sbecome\ssomething\smore\slike\sa\smethod\scall\s(`.toolbar.one\sshow`).\sThis\sis\swhy\sTcl\s8.7\sand\s9.0\shave\sa\s`callback`\scommand,\sso\sthat\sone\scan\swrite:\r\n\r\n```\r\n\s\s\safter\sidle\s[callback\sShow\s...]\r\n```\r\n\r\nWhere\s`Show`\sis\sa\snon-exported\smethod.\s(The\s`callback`\scommand\sis\sa\sshort\sprocedure.)
J login dkf
J mimetype text/x-markdown
K 91b3a5bb14e6e8ae1d1c5349af12e08879ea152d
U dkf
Z c4e98200816a956d81c2763e3d9b139c