From sundar.dorai-raj at pdf.com  Thu Oct 30 17:30:38 2008
From: sundar.dorai-raj at pdf.com (Sundar Dorai-Raj)
Date: Thu, 30 Oct 2008 09:30:38 -0700
Subject: [Rd] using yscrollcommand in tkcanvas crashes R (PR#13231)
In-Reply-To: <20081030154013.A9635282BEBF@mail.pubhealth.ku.dk>
References: <20081030154013.A9635282BEBF@mail.pubhealth.ku.dk>
Message-ID: <4909E12E.8000007@pdf.com>

Hi, Greg,

Thanks again for your comments. I got it to work with your suggestion:

library(tcltk)
tt <- tktoplevel()
ts <- ttkscrollbar(tt)
tc <- tkcanvas(tt)
tkconfigure(ts, command = function(...) tkyview(tc, ...))
tkconfigure(tc, yscrollcommand = function(...) tkset(ts, ...))
tkpack(tc, side = "left")
tkpack(ts, side = "right", fill = "y")

I think the bug should remain open though, because crashing R is never a 
good thing. But for now, it's not on my critical path.

Thanks,

--sundar

Greg.Snow at imail.org said the following on 10/30/2008 8:40 AM:
> I don't know if this is the case here or not, but putting in scrollbars and=
>  scrolling can be a bit tricky.  It usually works best to create the canvas=
>  without a scroll command, then create the scrollbar(s), then use tkconfig =
> to go back and add the scroll command to the canvas after the scrollbar has=
>  been created and placed.
> 
> Hope this helps,
> 
> --
> Gregory (Greg) L. Snow Ph.D.
> Statistical Data Center
> Intermountain Healthcare
> greg.snow at imail.org
> 801.408.8111
> 
> 
>> -----Original Message-----
>> From: r-devel-bounces at r-project.org [mailto:r-devel-bounces at r-
>> project.org] On Behalf Of sundar.dorai-raj at pdf.com
>> Sent: Wednesday, October 29, 2008 11:10 PM
>> To: r-devel at stat.math.ethz.ch
>> Cc: R-bugs at r-project.org
>> Subject: [Rd] using yscrollcommand in tkcanvas crashes R (PR#13231)
>>
>> Full_Name: Sundar Dorai-Raj
>> Version: 2.8.0
>> OS: Windows
>> Submission from: (NULL) (76.220.41.126)
>>
>>
>> The following code crashes R:
>>
>> library(tcltk)
>> tt <- tktoplevel()
>> tc <- tkcanvas(tt, yscrollcommand =3D function(...) tkset(ts, ...))
>>
>>> sessionInfo()
>> R version 2.8.0 (2008-10-20)
>> i386-pc-mingw32
>>
>> locale:
>> LC_COLLATE=3DEnglish_United States.1252;LC_CTYPE=3DEnglish_United
>> States.1252;LC_MONETARY=3DEnglish_United
>> States.1252;LC_NUMERIC=3DC;LC_TIME=3DEnglish_United States.1252
>>
>> attached base packages:
>> [1] tcltk     stats     graphics  grDevices utils     datasets  methods
>> [8] base
>>
>> ______________________________________________
>> R-devel at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-devel
> 
> ______________________________________________
> R-devel at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel



[Rd] using yscrollcommand in tkcanvas crashes R (PR#13231)
Sundar Dorai-Raj