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

[Xotcl] Re: [Xotcl] Widgets

From: Catherine Letondal <letondal_at_pasteur.fr>
Date: Mon, 05 Feb 2001 15:20:01 +0100

"Rick Hedin" wrote:
>
> Hello all.
>
> I want to build an object on top of a canvas. The object adds some
> internationalized features. I'm not clear how to manage the XOTcl object in
> conjunction with the Tk object. For now, I'm just managing the two as
> separate entities.
>
> Icanvas icanvas .f ;# I pass the path for the tk object.
> pack .f.icanvas -fill both -expand true ;# And manipulate the tk object
> with tk commands.
>
> Or maybe I should:
>
> pack [icanvas tkpath] -fill both -expand true
>
> Or give my object a truly wicked name:
>
> Icanvas .f.icanvas ;# Will this work?
>
> Or wrap every tk command in my xotcl object.
>
> What is your thinking regarding widgets from XOTcl?

I have a data structure registering object names for tk widgets.
Thus, a tk callback looks generally like:

        ::bind $path <tk event> {
            set object [names object %W]
            $object method args
        }

(names is an XOtcl Object knowing which object a tk widget belongs to)


--
Catherine Letondal -- Pasteur Institute Computing Center