Re: Need hidden password entry



On Fri, 12 Dec 1997, Owen Taylor wrote:

> 
> > I need to have users type passwords _hidden_ in a gtk_entry text field. It
> > should either be "white text on white background" or asterisks or similar.
> > Anyone got a hint for me how to e.g. set text color to bg color?
> 
> gtk_entry_set_visible (entry, FALSE), should do almost what you
> want. One problem is that it doesn't disable selecting the
> text and pasting it somewhere else, so at the very least you
> should make sure either to destroy the entry or clear the text
> in it once the user has input the text.

This is just fine, the dialog in which the password is given will be destroyed
right after typing it (and pressing OK, of course).

> 
> (If you wanted to implement the asterisks, the approach would be to
> add a key_press handler that called gtk_signal_emit_stop_by_name
> (GTK_OBJECT (entry), "key_press_event"). Handle the key presses
> yourself, then append asterisks to the entry field as appropriate.
> 

Well, I don't think I'm going to do this, it's unnecessary work, because the
above will do. The point is that if an asterisklike thing would have been
implemented (and there wouldn't be gtk_entry_set_visible) I would have used
this, it's just for a project at college, will not be used after we got our
ratings for it, I think.

> Some people consider echoing asterisks a bad idea since it allows
> shoulder-surfers to count the password length.)
> 

Yes.

Thank you very much,
Nils
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Nils Philippsen                      @college: nils@rhlx01.rz.fht-esslingen.de
Vogelsangstrasse 115                @home: nils@wombat.dialup.fht-esslingen.de
D 70197 Stuttgart                             Microsoft: They do it for money.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]