From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=unavailable autolearn_force=no version=3.4.4 Path: eternal-september.org!reader01.eternal-september.org!reader02.eternal-september.org!news.eternal-september.org!news.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Simon Wright Newsgroups: comp.lang.ada Subject: Re: thick Tcl binding, am I being logical ? Date: Tue, 14 Jan 2014 17:43:46 +0000 Organization: A noiseless patient Spider Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx05.eternal-september.org; posting-host="d6dcbed888a91bae80923cc55b286b77"; logging-data="13113"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/BOAh5b5/a9CDAx6eX2aytnbhAGWX0GxM=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin) Cancel-Lock: sha1:DaMWVNOYius0Jl5cC7Ve+qyxGec= sha1:vGaUL/PwU4Fn2ainlc3Pzex90VI= Xref: news.eternal-september.org comp.lang.ada:18169 Date: 2014-01-14T17:43:46+00:00 List-Id: Patrick 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!