View · Search · Index
No registered users in community xowiki
in last 10 minutes

Re: [Xotcl] Linking object instance variables to a widget -textvariable?

From: Ken Jones <ken_at_redsummit.net>
Date: Sat, 15 Nov 2003 23:37:24 -0800

At 11:12 AM 11/15/2003 +0100, Artur Trzewik wrote:
>The XOTcl are scoped (or can be scoped) in object namespace too.
>I use it as follow
>
>GUIClass instproc buildEntry win {
> my requireNamespace
> entry $win -textvariable [self]::entryValue
> my set entryValue {Init Value}
>}
>requireNamespace is required to build namespace for object.
>XOTcl object orientation is build (was build) on Tcl namespaces.

Ahh.... That's exactly what I was looking for. The documentation mentions that XOTcl is built on Tcl namespaces, but is a little vague in exactly how, aside from the discussion of aggregation. And I'd managed to overlook the documentation for the "requireNamespace" method. Actually, even after seeing your example, I don't think that the current "requireNamespace" method documentation is quite clear as to why it's needed. May I suggest adding a sentence or two to its description basically outlining an application of it, such as this, to help other newcomers to XOTcl understand its use?

Thanks for the clarification!

- Ken