Re: [Rd] tcltk GUIs (was need gui matrix editor: does R Core team have advice on how?)

From: Duncan Murdoch <murdoch.duncan_at_gmail.com>
Date: Mon, 30 Jan 2012 10:13:15 -0500

On 30/01/2012 9:17 AM, Kevin R. Coombes wrote:
>
> On 1/29/2012 4:35 PM, Paul Johnson wrote:
> > On Sun, Jan 29, 2012 at 6:10 AM, Prof Brian Ripley
> > <ripley_at_stats.ox.ac.uk> wrote:
> >> On 28/01/2012 22:04, John Fox wrote:
> >>> Dear Paul and Gabor,
> >>>
> >>> The Rcmdr GUI uses the tcltk package, so I have some experience with
> >>> providing an R tcltk-based GUI for various platforms.
> >>>
> >>> As Gabor says, everything works very smoothly on Windows because the R
> >>> Windows binary includes Tcl/Tk.
> >>
> >> Maybe, but getting it there was very far from smooth. Tcl/Tk compiled under
> >> the compilers we used, but the resulting DLLs crashed R. No one has ever
> >> found the cause and I used the system SDK (essentiallly a version of VC++)
> >> to build them. And that puts us in a bind since the current system SDKs
> >> generate code depending on DLLs that are not part of the minimal OS versions
> >> we support (e.g. Windows XP and Server 2003, and the machine used to build
> >> was retired 2 years ago).
> >>
> > Thanks, this is clearing things up. I believe these comments mean
> > that, at the current time, tcl/tk is as close as there is to an
> > officially endorsed graphical toolkit. As I search more, I find many
> > other community contributors (besides Prof. Fox) using tcl/tk
> > (Sciviews). So I should learn how to work with that. Prof Ripley's
> > comment makes me think the endorsement is not entirely enthusiastic,
> > though.
> There's this famous quotation from Winston Churchill: "it has been said
> that democracy is the worst form of government except all those other
> forms that have been tried."
>
> Using Tcl/Tk in R is similar. It's there, and the R Core team (mostly)
> makes sure it works cross-platform, so it is the obvious choice for GUI
> development in R. But it is far from perfect. For one thing, the
> documentation in R is quite limited. The manual pages list all of the
> functions in the tcltk package, but they basically take "..." as their
> arguments. As a result, you sometimes have to guess how to get the
> inputs formatted correctly to pass them back-and-forth between the R
> process and the Tcl/Tk process (which have very different syntax). For
> another thing, communication between the two processes (at least on
> Windows) sometimes breaks down in non-reproducible and hard-to-debug
> ways. We built a tcltk GUI that uses a tabbed notebook interface, which
> is supposed to display five tabs. Most of the time, it does. But it
> can end up displaying anything from 1 to 5 tabs. It always displays
> them in order, so it apparently runs into a problem at some random point
> and stops. Closing the GUi and restarting it usually fixes the
> problem. Since we cannot trigger it reproducibly, we have never found
> the underlying source of the problem.
>
> This message is not meant to dissuade you from using Tcl/Tk. It's just
> a warning to expect some bumps along the way....

Just one addition: the full Tcl/Tk documentation should be available to most users. It is included in the Windows distribution (and referenced from the ?tcltk help page) and I would guess other platforms install it when they install Tcl/Tk. It is written assuming that you're writing in Tcl rather than R, but once you work out the translation, it's actually somewhat usable.

Duncan Murdoch



R-devel_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel Received on Mon 30 Jan 2012 - 15:25:01 GMT

This quarter's messages: by month, or sorted: [ by date ] [ by thread ] [ by subject ] [ by author ]

All messages

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 30 Jan 2012 - 17:30:12 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-devel. Please read the posting guide before posting to the list.

list of date sections of archive