Password Text Box

Hello,
I have two text boxes on screen, one a username and one a password. I
would like to have the password text replaced with stars instead of
displaying the actual characters.

I have seen the example from the helpfile and it appears as though it
creates the widgets at runtime. I would just like a few lines of code to
do the substitution and to keep the text entered.

I would appreciate any assistance with this.

Thanks

Adam

ps. PtPassword is of no use to me as I have two textboxes on a pre-made
screen. I do not want to have a separate popup screen.

Adam Williams <adam.williams@csiro.au> wrote:

Hello,
I have two text boxes on screen, one a username and one a password. I
would like to have the password text replaced with stars instead of
displaying the actual characters.

I have seen the example from the helpfile and it appears as though it
creates the widgets at runtime. I would just like a few lines of code to
do the substitution and to keep the text entered.

I would appreciate any assistance with this.

It’s been a while, but I think the method for this is to attach a
Modify Verify callback [Pt_CB_MODIFY_VERIFY] to the text widget.

In this callback, you’ll be given a PtTextCallback_t structure
that contains a char *text field that is the text to be inserted,
as well as int length field that is the number of characters to
be inserted. As someone types, you should get one of these callbacks
for each character – save the character in the *text field, and replace
it with a *. The * will be displayed.

-David

David Gibbs
QNX Training Services
dagibbs@qnx.com

I’ve used the example in /usr/free/qnx4/photon/examples/password.c.*
in the past
Should port without problem to Photon 2.0