RebGUI - How to Display a long wrapping text field as Read-Only?

Started by JackKort on 21-Feb-2018/18:11:16-8:00
I want to display all fields for a record on a form for editing, but I want some of the fields to be uneditable. I thought about just displaying them using the TEXT widget, but these fields could contain long comments that need to wrap. I would like to have something like the AREA widget, but prevent the user from modifying the contents. Thank you for any suggestions.
Info fieĺd maybe. Think it wraps. http://www.rebol.com/how-to/fields.html#section-6
The default wrap property of the text widget is true: ? ctx-rebgui/widgets/text/para So this will wrap by default: x: copy clipboard:// display "" [a: text x 100x100] do-events If you want to display lots of scrollable text, it may simplest to use an area widget, and do a little hack like this to keep it from being editable: display "" [ a: area x on-edit [a/text: copy x show a] ] Or if you want to go deeper, you could adjust the feel functions: probe get in ctx-rebgui/widgets/area/feel 'engage
And, BTW, you can use any VID style in RebGUI, like this: display "" [style 100x100 data [info x]] do-events That displays a normal 'info widget from the built-in VID dialect.
Hello Nick, I realize now my text wouldn't wrap b/c I didn't specify a size. I must be doing something wrong in trying to put a VID info in the middle of my form, as nothing was displaying, but your AREA hack works so well I'm going to run with it! Thanks yet again for your help!

Reply