Re: password-entry widget [message #16462] |
Mon, 26 July 1999 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
David Fanning (davidf@dfanning.com) writes:
> Waleed Al-Nuaimy (geoserv@compuserve.com) writes:
>
>> Hi. I'm trying to get a WIDGET_TEXT to behave as a password-entry field,
>> echoing asterisks.. I was hoping someone had done this before.
>
> In the text widget, turn the keyword EDITABLE off and the
> keyword ALL_EVENTS on. Now you will be getting each
> input character event in your event handler. Simply
> take each character as it comes in and build your
> password internally. But write asterisks to the text
> widget. (Only you can edit the text widget, NOT the
> user.)
It wasn't difficult to modify an event handler named
Get Image_Integer_Only from my GetImage program to be
a password event handler, so I just went ahead and
did it. You call the program like this:
thePassword = Password()
If you are calling it from a widget program, be certain
you pass it a group leader. Probably something like this:
thePassword = Password(Group_Leader=event.top)
You can find the code here:
ftp://www.dfanning.com/pub/dfanning/outgoing/misc/password.p ro
I wouldn't be using this for national security applications.
I can think of several ways to hack it myself. But it
should keep out the casual user. It is certainly NOT
bomb-proof, but it will give you someplace to start. :-)
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|