[R-gui] pure tcl/tk to R-tcltk / labeled frame and image
Thomas Unternaehrer
uth at zhwin.ch
Wed Jan 12 15:17:06 CET 2005
Dear List,
I try to have a picture in a labeled frame like this example shows it:
http://incrtcl.sourceforge.net/iwidgets/iwidgets/labeledframe.html
At this point I have the following R-code (An example with the R-Logo
based on the example by James Wettenhall):
## R =================
library(tcltk)
tclRequire("Iwidgets")
setwd(paste(system.file(), "/../../doc/html",sep=""))
.base <- tktoplevel()
tkwm.title(.base, "Labeledframe")
tkpack(.base.labelframe <- tkwidget(.base, "iwidgets::labeledframe",
labelpos = "nw",
labeltext = "Labelframe"),
fill = "both", expand = TRUE)
.base.labelframe.cs <- .Tk.subwin(.base.labelframe)
tclRequire("Img")
t.Logo <- tclVar()
tkcmd("image", "create", "photo", t.Logo,
file = "logo.jpg")
tkpack(tklabel(.base.labelframe.cs, image = t.Logo, bg = "white"),
fill = "both", expand = TRUE, padx = 5, pady = 5)
##===================
With the following errormessage:
Error in structure(.External("dotTclObjv", objv, PACKAGE = "tcltk"),
class = "tclObj") :
[tcl] bad window path name ".10.1.2".
As I understand it right the problem has to do with the fact that
"...cs" needs to be a child/sub - window.
See the following pure tcl-code:
## Tcl/Tk===============
## Need to get the childsite so that
## we can properly pack other widgets
## inside
set cs [.lf childsite]
##====================
.Tk.subwin seems not to be the right way. I also tried it with
.Tcl("pure Tcl commands") and tkcmd but faild.
Has anybody an idea how to solve my problem?
Thanks a lot
Thomas
ps: and sorry for my poor english
> version
platform i386-pc-mingw32
arch i386
os mingw32
system i386, mingw32
status
major 2
minor 0.1
year 2004
month 11
day 15
language R
More information about the R-SIG-GUI
mailing list