The following code should give me (at least that's what I think) two list boxes with their individual scrollbars. But instead both scrollbars stick to the same listbox even though they work as they should (scroll individual listboxes). When I remove all the widgets on top everything works perfectly. Any help would be highly apprecciated. ps: all subsequent listboxes and scrollbars work perfectly, the first one (column 1 of main window) is the only one constantly off. library(tcltk) tt<-tktoplevel() mainFont<-tkfont.create(family="times",size=16) lbl.MainT<-tklabel(tt,text="Basic Manipulation",font=mainFont) tkgrid(lbl.MainT,sticky="nw") but.Browse<-tkbutton(tt,text=" Browse ",command=browse) but.Apply<-tkbutton(tt,text=" Apply ") scr1 <- tkscrollbar(tt, repeatinterval=5,command=function(...)tkyview(lsbDim1,...)) scr2 <- tkscrollbar(tt, repeatinterval=5,command=function(...)tkyview(lsbDim2,...)) lsbDim1<-tklistbox(tt,height=10,selectmode="multiple",yscrollcommand=function(...)tkset(scr1,...),background="white",exportselection=FALSE) lsbDim2<-tklistbox(tt,height=10,selectmode="multiple",yscrollcommand=function(...)tkset(scr2,...),background="white",exportselection=FALSE) for (i in 1:70) { tkinsert(lsbDim1,"end",i) } for (i in 1:70) { tkinsert(lsbDim2,"end",i) } tkgrid(lsbDim1,scr1,lsbDim2,scr2) tkgrid.configure(scr1,rowspan=10,sticky="nsw") tkgrid.configure(scr2,rowspan=10,sticky="nsw") [[alternative HTML version deleted]]
kapo coulibaly wrote:> The following code should give me (at least that's what I think) two list > boxes with their individual scrollbars. But instead both scrollbars stick to > the same listbox even though they work as they should (scroll individual > listboxes). When I remove all the widgets on top everything works perfectly. > Any help would be highly apprecciated. > ps: all subsequent listboxes and scrollbars work perfectly, the first one > (column 1 of main window) is the only one constantly off. > >Er,...... I just don't see it. What exactly goes wrong for you?> library(tcltk) > tt<-tktoplevel() > mainFont<-tkfont.create(family="times",size=16) > lbl.MainT<-tklabel(tt,text="Basic Manipulation",font=mainFont) > tkgrid(lbl.MainT,sticky="nw") > but.Browse<-tkbutton(tt,text=" Browse ",command=browse) > but.Apply<-tkbutton(tt,text=" Apply ") > scr1 <- tkscrollbar(tt, > repeatinterval=5,command=function(...)tkyview(lsbDim1,...)) > scr2 <- tkscrollbar(tt, > repeatinterval=5,command=function(...)tkyview(lsbDim2,...)) > lsbDim1<-tklistbox(tt,height=10,selectmode="multiple",yscrollcommand=function(...)tkset(scr1,...),background="white",exportselection=FALSE) > lsbDim2<-tklistbox(tt,height=10,selectmode="multiple",yscrollcommand=function(...)tkset(scr2,...),background="white",exportselection=FALSE) > for (i in 1:70) { > tkinsert(lsbDim1,"end",i) > } > for (i in 1:70) { > tkinsert(lsbDim2,"end",i) > } > > tkgrid(lsbDim1,scr1,lsbDim2,scr2) > tkgrid.configure(scr1,rowspan=10,sticky="nsw") > tkgrid.configure(scr2,rowspan=10,sticky="nsw") >-- O__ ---- Peter Dalgaard ?ster Farimagsgade 5, Entr.B c/ /'_ --- Dept. of Biostatistics PO Box 2099, 1014 Cph. K (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard at biostat.ku.dk) FAX: (+45) 35327907
For example, try to pack this label as follows: tkgrid(lbl.MainT,columnspan=2,sticky="nw") This worked once I changed columnspan=5, can you explain why. It seems i need to do the same for all widgets located above the ListBoxes. Thanks [[alternative HTML version deleted]]
Hi all can anybody give info what I do wrong when modeling a survival function with the CompetingRiskFrailty package in the following way? "accumulate", "reduce" and "closed" are dummy vectors with 0s indicating no event and 1s indicating the respective event in the appropriate column. action=data.frame(accumulate,reduce,closed) basis=CompetingRiskFrailtySurv(ID=Subject,surv.time=Duration,status=action) until here it seems to work fine. Then I fit the model: reg2.afteropening=CompetingRiskFrailtySurvfitCreate(formula=basis~Loss,na.ac tion=na.fail,control=list(niter.EM=5,niter.epoch = 2, tol.epoch = 1e-04, tol.variance = 1e-04,tol.frailty = 1e-04, print.penalty.mixture=TRUE,print.EM=TRUE,print.estimates=FALSE,print.log.lik =TRUE),risk.names=c("accumulate","reduce","closed")) Then R starts running and shows the running sand clock. The first output lines are penalty.mixture=0.001 EM.iteration=1 And then nothing happens anymore (while the sand clock is still showing after hours and hours). Can somebody give advice? It is highly appreciated. Cheers, Daniel ------------------------- cuncta stricte discussurus ------------------------- -----Urspr?ngliche Nachricht----- Von: r-help-bounces at r-project.org [mailto:r-help-bounces at r-project.org] Im Auftrag von kapo coulibaly Gesendet: Monday, October 08, 2007 1:21 AM An: r-help at r-project.org Betreff: [R] tcltk scrollbar The following code should give me (at least that's what I think) two list boxes with their individual scrollbars. But instead both scrollbars stick to the same listbox even though they work as they should (scroll individual listboxes). When I remove all the widgets on top everything works perfectly. Any help would be highly apprecciated. ps: all subsequent listboxes and scrollbars work perfectly, the first one (column 1 of main window) is the only one constantly off. library(tcltk) tt<-tktoplevel() mainFont<-tkfont.create(family="times",size=16) lbl.MainT<-tklabel(tt,text="Basic Manipulation",font=mainFont) tkgrid(lbl.MainT,sticky="nw") but.Browse<-tkbutton(tt,text=" Browse ",command=browse) but.Apply<-tkbutton(tt,text=" Apply ") scr1 <- tkscrollbar(tt, repeatinterval=5,command=function(...)tkyview(lsbDim1,...)) scr2 <- tkscrollbar(tt, repeatinterval=5,command=function(...)tkyview(lsbDim2,...)) lsbDim1<-tklistbox(tt,height=10,selectmode="multiple",yscrollcommand=functio n(...)tkset(scr1,...),background="white",exportselection=FALSE) lsbDim2<-tklistbox(tt,height=10,selectmode="multiple",yscrollcommand=functio n(...)tkset(scr2,...),background="white",exportselection=FALSE) for (i in 1:70) { tkinsert(lsbDim1,"end",i) } for (i in 1:70) { tkinsert(lsbDim2,"end",i) } tkgrid(lsbDim1,scr1,lsbDim2,scr2) tkgrid.configure(scr1,rowspan=10,sticky="nsw") tkgrid.configure(scr2,rowspan=10,sticky="nsw") [[alternative HTML version deleted]] ______________________________________________ R-help at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code.