jverzani / gWidgets2

Rewrite of gWidgets
35 stars 9 forks source link

`editable=FALSE` for gtext() #48

Closed landroni closed 10 years ago

landroni commented 10 years ago

Please allow for gtext() widget to be read-only. I would like for the user to be able to see a cursor and move the cursor (as it is), but simply be unable to perform any modifications via the keyboard (the current feature request). This can be useful when you want to output in the GUI, say,

> describe(iris[ , 3:5])
iris[, 3:5] 

 3  Variables      150  Observations
----------------------------------------------------------------------------------------------
Petal.Length 
      n missing  unique    Mean     .05     .10     .25     .50     .75     .90     .95 
    150       0      43   3.758    1.30    1.40    1.60    4.35    5.10    5.80    6.10 

lowest : 1.0 1.1 1.2 1.3 1.4, highest: 6.3 6.4 6.6 6.7 6.9 
----------------------------------------------------------------------------------------------
Petal.Width 
      n missing  unique    Mean     .05     .10     .25     .50     .75     .90     .95 
    150       0      22   1.199     0.2     0.2     0.3     1.3     1.8     2.2     2.3 

lowest : 0.1 0.2 0.3 0.4 0.5, highest: 2.1 2.2 2.3 2.4 2.5 
----------------------------------------------------------------------------------------------
Species 
      n missing  unique 
    150       0       3 

setosa (50, 33%), versicolor (50, 33%), virginica (50, 33%) 
----------------------------------------------------------------------------------------------

You would want the user to easily select and copy the text, but NOT inadvertently modify it.

jverzani commented 10 years ago

Try editable(widget) <- FALSE. It is implemented in a method, not an argument.

landroni commented 10 years ago

Perfect!

As for the docs, shouldn't editable() be mentioned in ?gtext (and elsewhere applicable)?

jverzani commented 10 years ago

I need to add it for the tcltk part first. I forget if I just tried that and couldn't or just overlooked it.

On Sat, Jul 12, 2014 at 9:57 AM, landroni notifications@github.com wrote:

Perfect!

As for the docs, shouldn't editable() be mentioned in ?gtext (and elsewhere applicable)?

— Reply to this email directly or view it on GitHub https://github.com/jverzani/gWidgets2/issues/48#issuecomment-48812124.

John Verzani Chair, Department of Mathematics College of Staten Island, CUNY verzani@math.csi.cuny.edu