[R-gui] Question about a gTable in r package " gWidgets"

john verzani jverzani at gmail.com
Tue Jan 12 16:52:57 CET 2010


zeljko krizek <z.krizek <at> gmail.com> writes:

> 
> Hi there !
> 
> Can someone say to me (send a sample) how can I select one value in a
> populated gTable element without to click in a list.
> 
> The scope is following.
> 
> I want to populate such a gTable with a list of entries and to make a kind
> of sugestion to the user, i want to select first element in the list before
> user can make any action.
> 
> I found the method svalue().
> With this method I can only get already selected value but I cannot select
> anything programmatically in a gTable.

Dear Zak, that method can select programaticaly by row index or value:

g <- gtable(mtcars, cont = gwindow("test"))
svalue(g, index=TRUE) <- 1 ## by index
svalue(g) <- 22.8          ## or by value

For the latter, the constructor has an argument chosencol, which by default is
the first column. In this example, the values aren't unique, so the choice is
maybe not as expected.

--John


> 
> Thanks in advance
> 
> Zak
> 
> 	[[alternative HTML version deleted]]
>



More information about the R-SIG-GUI mailing list