Shoes and edit boxes
Author |
Message |
apomb
|
Posted: Sat Jun 06, 2009 2:16 pm Post subject: Shoes and edit boxes |
|
|
Alright, so i've been messing around with shoes, and i'm wondering if there is a way of changing input text when dealing with edit lines.
For example, as the user is typing, the text inside the box is masked as an asterisk
here's what i have so far. Its not much, but its where im going to start from.
Ruby: | Shoes.app do
stack :margin => 4 do
@fill = para strong("Guess the password")
@line = edit_line :width => 100
@butt = button "Hit this button to enter text"
@text = para " "
@butt.click{
@new = @line.text
if @new == "pass"
@fill.replace strong("Congrats")
@text.replace " "
else
@text.replace "Not correct"
end
}
end
end
|
|
|
|
|
|
|
Sponsor Sponsor
|
|
|
Tony
|
|
|
|
|
apomb
|
Posted: Mon Jun 08, 2009 7:37 pm Post subject: RE:Shoes and edit boxes |
|
|
thanks tony, ill check that out. |
|
|
|
|
|
apomb
|
Posted: Thu Jun 11, 2009 8:45 am Post subject: RE:Shoes and edit boxes |
|
|
Ok, well ive tried that out, but it doesnt work when I'm typing inside the edit box. |
|
|
|
|
|
Tony
|
Posted: Thu Jun 11, 2009 10:52 am Post subject: RE:Shoes and edit boxes |
|
|
You could get them to type outside of an edit box, effectively building your own control.
Though it's odd... it seems like there should be an easier way for something like this. I don't actually use Shoes... |
Tony's programming blog. DWITE - a programming contest. |
|
|
|
|
apomb
|
Posted: Fri Jun 12, 2009 10:04 am Post subject: RE:Shoes and edit boxes |
|
|
Indeed it seems like a somewhat common thing. I'll look into it further, thanks for the help though. and yeah, i guess i could just make my own text box essentially by drawing a box, fill it white and just update the letters using the keystroke {|key|...} idea. |
|
|
|
|
|
|
|