[R] tcltk scrollbar
Peter Dalgaard
P.Dalgaard at biostat.ku.dk
Mon Oct 8 16:16:03 CEST 2007
kapo coulibaly wrote:
> This is approximately what I get:
> ------------------------ -- ---------------------------
> ! ! !S! ! !S!
> ! ! !C! ! !C!
> ! ! !R! ! !R!
> ! ! !O! ! !O!
> ! ! !L! ! !L!
> ! ! !L! ! !L!
> ! ListBox1 ! !B! ! ListBox2 !B!
> ! ! !A! ! !A!
> ! ! !R! ! !R!
> ! ! !1! ! !2!
> ------------------------- -- ---------------------------
>
> I could never get the 1st scrollbar to stick to the 1st ListBox!!
>
>
Is there a delay somewhere? The reason and a fix has already been posted
twice (by me and Jonne Zutt)
> On 10/8/07, Peter Dalgaard <p.dalgaard at biostat.ku.dk> wrote:
>
>> 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
>>
>>
>>
>>
>
>
--
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
More information about the R-help
mailing list