Rebol 3 - How to create a password text field? (circles or stars instead of text)

StackOverflow https://stackoverflow.com/questions/17868021

  •  04-06-2022
  •  | 
  •  

سؤال

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