[prev in list] [next in list] [prev in thread] [next in thread] 

List:       r-sig-gui
Subject:    Re: [R-gui] "..." in R tcltk example List Box With A Scroll Bar
From:       Peter Dalgaard <p.dalgaard () biostat ! ku ! dk>
Date:       2005-08-28 9:25:18
Message-ID: x2vf1qtnup.fsf () turmalin ! kubism ! ku ! dk
[Download RAW message or body]

morphwj@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@biostat.ku.dk)                  FAX: (+45) 35327907


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic