Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Shoes and edit boxes
Index -> Programming, Ruby -> Ruby Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
apomb




PostPosted: 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
Sponsor
sponsor
Tony




PostPosted: Mon Jun 08, 2009 12:13 pm   Post subject: RE:Shoes and edit boxes

with Events
http://help.shoooes.net/Events.html#keypress{|key|...}
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
apomb




PostPosted: Mon Jun 08, 2009 7:37 pm   Post subject: RE:Shoes and edit boxes

thanks tony, ill check that out.
apomb




PostPosted: 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




PostPosted: 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...
Latest from compsci.ca/blog: Tony's programming blog. DWITE - a programming contest.
apomb




PostPosted: 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.
Display posts from previous:   
   Index -> Programming, Ruby -> Ruby Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: