[R-gui] R tcltk/tcltk2 vs. R GTk2

Peter Dalgaard p.dalgaard at biostat.ku.dk
Tue Jul 31 17:54:29 CEST 2007


Michael Lawrence wrote:
> GTK+ has many more features than tcl/tk (tile included), though tcl/tk does
> have some features that GTK+ lacks, like a canvas widget.
>
> The API of the underlying toolkits, as well as the R interfaces, are quite
> different. I've heard many people say that they prefer the GTK+/RGtk2 style,
> though there are probably many people that feel the opposite. The tcltk
> package is a binding to the Tcl language, while RGtk2 is a binding to a
> collection of C libraries.
>   
Minor quibble: tcltk (mostly) binds directly to the Tcl *engine*, 
bypassing the parsing layer, $-substitution, quoting hell, etc. The 
Tcl/Tk engine is just another collection of C libraries. The major 
difference to Gtk+ is that the Tcl/Tk engine was designed to support 
interpreted languages (mainly, of course, Tcl).

Apart from that, I pretty much agree that RGtk2 could well be the 
toolkit of the future. It's main detraction at this point is that it is, 
at the tutorial level, mainly documented by demos and that it seems to 
be a bit sensitive to changes in the underlying toolkit and have a 
couple of rough edges in general. But it can certainly do amazing stuff; 
all it needs is a dedicated effort to take care of a number of little 
issues (esp. portability). That and an introductory document that covers 
the concepts involved.

(It needs to be no secret that I have been approached about the 
possibility of a book on R/tcltk, and ended up resolving that there 
would certainly be a market, but of the 3 or 4 candidates to write it, 
probably none would want to. However, in due course, when the obvious 
author completes his academic obligations, a book on RGtk2 should be a 
very interesting prospect.)

> RGtk2 also binds libglade, meaning that one can design a GUI graphically
> using the Glade tool and display it using R. Glade may or may not be useful,
> depending on the application. The Rattle tool seems to have used Glade
> effectively, but I personally prefer to construct the interfaces
> dynamically.
>
> Since GTK+ is object-oriented, RGtk2 is able to support the creation of new
> widget classes that override the functionality of their parents. This is a
> neat feature, but is rarely necessary.
>
> For graphics, RGtk2 binds several useful libraries, including Cairo (vector
> graphics) and GdkPixbuf (image manipulation).
>
> You might also consider the gWidgets package. It is a convenient API for
> creating simple GUIs in R. It abstracts away the underlying toolkit.
> Implementations exist using RGtk2 and rJava (swing). You could always start
> using a GUI this way and then convert to RGtk2 or some other toolkit later
> if necessary.
>
> I hope this helps,
> Michael
>
> On 7/28/07, morphwj at comcast.net <morphwj at comcast.net> wrote:
>   
>> Why use R tcltk/tcltk2 instead of R GTk2, or why use R GTk2 instead of R
>> tcltk/tcltk2?
>> Bill Morphet
>>         [[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-SIG-GUI mailing list
>> R-SIG-GUI at stat.math.ethz.ch
>> https://stat.ethz.ch/mailman/listinfo/r-sig-gui
>>
>>     
>
> 	[[alternative HTML version deleted]]
>
> _______________________________________________
> R-SIG-GUI mailing list
> R-SIG-GUI at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-gui
>



More information about the R-SIG-GUI mailing list