[R-gui] Re: tcltk: "Image" rather than bitmap loaded on tklabel

James Wettenhall wettenhall at wehi.edu.au
Thu Jul 17 16:18:53 MEST 2003


Dirk,

Did you figure out how to display images in Tk widgets?

I finally got it working as follows:

library(tcltk)
tt <- tktoplevel()
tclRequire("Img")
tkcmd("image","create","photo","foo",file="foo.png")
imgAsLabel <- tklabel(tt,image="foo",bg="white")
tkpack(imgAsLabel)

(For a while I was completely missing the point that the image 
was supposed to go in a Tk label widget!)

Regards,
James

> How can I display images from external files in tcltk?
> Is there a simple way without having to re-code pieces of, say, tkrplot?
> Thanks, Dirk



More information about the R-SIG-GUI mailing list