Computer Science Canada Passwords in textfields? |
Author: | theuberk [ Mon Jan 09, 2006 6:54 pm ] |
Post subject: | Passwords in textfields? |
I was just wondering how I would input a password in a textfield. I know that I can use getch and save the character in a string and then put a * in place of the character, but how would I do this in a textfield? |
Author: | pavol [ Mon Jan 09, 2006 8:08 pm ] |
Post subject: | |
im not entirely sure, but you might be able to check every time a key is pressed and when it is, store the value of the key in a varibale. and then insead of writing the letter in the textfield you write an *. then you'd also have a variable counting how many keys have been pressed (letters have been entered), so the program knows how many * to put in the textfield. hope it helps (and i hope it's at least possible) |
Author: | Cervantes [ Mon Jan 09, 2006 9:26 pm ] |
Post subject: | |
You want to make your own textfields? |
Author: | theuberk [ Mon Jan 16, 2006 6:58 pm ] | ||
Post subject: | |||
Thanks for your help guys. I figured it out! Here's the procedure if anyone wants to use it: tf = the text field widgit ID text = the variable in which you'd like to save the inputted text
|
Author: | MysticVegeta [ Mon Jan 16, 2006 7:28 pm ] |
Post subject: | |
yes but it does now serve the purpose, cause after you enter the pass then you press enter inorder to blank it, meanwhile it is still visible to others So if you want to make it accurate you have to make it "asterisk" it every character that a person types, just like how Cervantes did it. |
Author: | theuberk [ Mon Jan 16, 2006 7:40 pm ] | ||
Post subject: | |||
Sorry, I didn't specify. You have to run this procedure constantly within the GUI.ProcessEvent loop, with a small delay to avoid flickering. For Example:
|
Author: | MysticVegeta [ Mon Jan 16, 2006 8:34 pm ] | ||
Post subject: | |||
ok since you tried, I will tell you an easier way:
|
Author: | theuberk [ Mon Jan 16, 2006 9:24 pm ] |
Post subject: | |
Doesn't that mean that I'd have to use the altered TextFieldClass.tu file? |
Author: | Rasta Fella [ Mon Jan 16, 2006 9:35 pm ] |
Post subject: | |
Quote: Doesn't that mean that I'd have to use the altered TextFieldClass.tu file?
Well, you can but Crevantes way is more efficient. check his link. |
Author: | MysticVegeta [ Mon Jan 16, 2006 10:32 pm ] |
Post subject: | |
theuberk wrote: Doesn't that mean that I'd have to use the altered TextFieldClass.tu file?
You mean as in Turing 4.0.5? You dont have 4.0.5? |