comp.lang.ada
 help / color / mirror / Atom feed
From: Simon Wright <simon@pushface.org>
Subject: Re: thick Tcl binding, am I being logical ?
Date: Tue, 14 Jan 2014 17:43:46 +0000
Date: 2014-01-14T17:43:46+00:00	[thread overview]
Message-ID: <ly38kqwjal.fsf@pushface.org> (raw)
In-Reply-To: e1edf2bc-c7bd-41ca-94a9-dfd94c75012c@googlegroups.com

Patrick <patrick@spellingbeewinnars.org> writes:

> I was tinkering with Tash again today. 

That's http://sourceforge.net/projects/tcladashell/. Thanks for your
interest.

> It has code like this:
> Tcl.Tk.Ada.Pack (Counter, "-side bottom -fill both");
>
> This calls the geometry manger to control the layout of the widget
> Counter.
>
> In pure Tcl it is:
> pack .counter -side bottom -fill both
>
> Tash is about 20K lines of code(in the src dir). There are some
> examples and it's not a bad project or anything. It's just that since
> Tcl/Tk changed it's API, it's a pretty thin binding.

But don't you think that most of the facilities lost with the API change
are things that (for an Ada program) are better got via Ada.Containers,
Ada.Directories etc?

> I was wondering if it would be logical to create a thick binding to
> Tcl only and feed in Tcl strings to display Tk widgets rather then
> trying to bind the Tk code as well.
>
> I frequently go on coding suicide missions, Am I on another? Does this
> sound logical?

I'm not quite sure what your intention is. To quote from my response to
bug #5,

   "Personally I've always thought the best reason for using TASH is to
   allow a Tcl interface to an Ada program; especially since Ada2005,
   why bother to use imported Tcl facilities in Ada? Of course, you'd
   only need a tiny subset of TASH to do that, and TASH is what it is."

so I'd write the graphical part of the application (view, controller) in
Tcl/Tk and do the model in Ada.

The only problem I've come across with this style is how to manage
changes in the model that need to be reflected in the view; polling
certainly works but seems less than ideal. Maybe Tcl_Eval and variable
tracing would do the trick.

Of course, Rapid (http://savannah.nongnu.org/projects/rapid/) is a
counter-example!

  reply	other threads:[~2014-01-14 17:43 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-13 23:03 thick Tcl binding, am I being logical ? Patrick
2014-01-14 17:43 ` Simon Wright [this message]
2014-01-16  1:33   ` Patrick
2014-01-16 12:30   ` Simon Wright
2014-01-19 17:56     ` Simon Wright
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox