[R-gui] "..." in R tcltk example List Box With A Scroll Bar

Peter Dalgaard p.dalgaard at biostat.ku.dk
Sun Aug 28 11:25:18 CEST 2005


morphwj at comcast.net writes:

> In the R tcltk example "List Box With A Scroll Bar" in List Boxes at http://bioinf.wehi.edu.au/~wettenhall/RTclTkExamples/
> 
> removal of "..." in 
> 
> scr <- tkscrollbar(tt, repeatinterval=5,
>     command = function(...) tkyview(tl,...))
> 
> tl <- tklistbox(tt, height=4, selectmode="single",
>     yscrollcommand=function(...) tkset(scr,...), 
>     background="white")
> 
> results in message
> 
> "Error in function ()  : unused argument(s) ( ...)".
> 
> Why does the example work with "..." and not work when "..." are omitted,
> or what process is occuring that requires "..."?

(There are 4 cases of "...", which one did you try to remove??)

The reason is that the callback commands get invoked with arguments
which need to be passed from the scrollbar to the listbox and vice
versa.  

The structure of these arguments depends somewhat on the particular
event (exactly where you clicked the scrollbar), so you can't have an
ordinary argument list. In any case, named arguments to callback are
translated to %X style calls on the Tk side, so wouldn't work.

-- 
   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-SIG-GUI mailing list