In Rebol 2, in order to create a password text field it is possible to write

view [
    field hide
]

How to do it in Rebol 3?

有帮助吗?

解决方案

You can use the hide-input facet of text input widgets to control whether input is shown or not.

There are two ways how to do this. First, you can override the facet directly in your layout specification:

view [field options [hide-input: true]]

Second, you can create a custom widget (let's call it password) derived from field but overriding the hide-input facet:

stylize [
    password: field [         ;; Create a PASSWORD widget, derived from FIELD.
        facets: [             ;; Override FIELD's facets.
            hide-input: true  ;; Mask the input with asterisks.
        ]
    ]
]

view [password]

I hope that a password widget will eventually come bundled with stock R3-GUI.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top