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

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

From: Artur Trzewik <mail_at_xdobry.de>
Date: Sat, 15 Nov 2003 11:12:01 +0100

Hi!

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.

You have access to variable per
my set userName
or
instvar userName
set userName

I recommend also to use list command to programm callbacks

button $win -text "My Button" -command [list [self] buttonPressed]

Look at XOTclIDE http://www.xdobry.de/xotclIDE
component (IDEBaseGUI) to have many examples how
to bind XOTcl with Tk

Artur Trzewik