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