I can use Chinese fonts in R.

I can also use Chinese fonts in tcl/tk.

But I can not write Chinese using tkgrid in R.

The attached file is an example trying to write Chinese.

The Chinese font can not be displayed correctly.

Can anyone help me ?

Sincerely

library(tcltk)
tkt.test<-tktoplevel()
heading <- tklabel(tkt.test, text="Input Data File")
row1.name <- tklabel(tkt.test, text=" following is chinese ÀÉ®×")
row2.name <- tklabel(tkt.test, text="File2")
row1.entry <- tkentry(tkt.test, width=30)
row2.entry <- tkentry(tkt.test, width=20)
tkgrid(heading,columnspan=2)
tkgrid(row1.name, row1.entry)
tkgrid(row2.name, row2.entry)
tkgrid.configure(row1.entry, row2.entry, sticky="w")
tkgrid.configure(row1.name, row2.name, sticky="e")

# row.entry = variable
file1.name<-tclVar()
tkconfigure(row1.entry, textvariable=file1.name)
file2.name<-tclVar()
tkconfigure(row2.entry, textvariable=file2.name)
# get the filenames
# tclvalue(file1.name)
# tclvalue(file2.name) 
# we can put the entry content to the window
# tclvalue(file1.name)<-"aa"

flag<-tkbutton(tkt.test, text="OK", command=function() tkdestroy(tkt.test))
#flag<-tkbutton(tkt.test, text="OK")
#flag<-tkbutton(tkt.test, text="OK", command=tkdestroy(tkt.test))
# must use command=function() tkdestroy(tkt.test), 
# cannot use command=tkdestroy(tkt.test)
tkgrid(flag)

#next.step <- function(){
##cat("OW!\n")
##tkconfigure(flag, text="receive successful")
#tkdestroy(tkt.test)
#}

#tkconfigure(flag,command=next.step)
______________________________________________
[EMAIL PROTECTED] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Reply via email to