Skip to content
Prev 31652 / 398506 Next

bitmap images in tcltk

On Tue, May 06, 2003 at 02:24:10PM -0400, John Fox wrote:
Seconded. It is truly excellent, and cross-platform without any heachaches.
There is a much easier solution thanks to Luke's tkrplot which is available
for win32 and unix on CRAN.  A simple example is
It can do fancier stuff too by using a 'replot' feature. The example from
the help page varies a simple function by tieing a callback command and
variable from a scale to a function around tkreplot():

     tt <- tktoplevel()
     bb<-1
     img <-tkrplot(tt, function() plot(1:20,(1:20)^bb))
     f<-function(...) {
         b <- as.numeric(tclvalue("bb"))
         if (b != bb) {
             bb <<- b
             tkrreplot(img)
         }
     }
     s <- tkscale(tt, command=f, from=0.05, to=2.00, variable="bb",
                  showvalue=FALSE, resolution=0.05, orient="horiz")
     tkpack(img,s)
			   
Dirk