Quick Tip: Shoes and text
Posted by Vince Wadhwani on Jun 28, 2008
I'm starting to use Shoes for a project I'm working on. I've never done used it before so this is all new. Going through the tutorials page I ran into one called Running with Shoes. Problem was I couldn't get the basic code running. The error I got was a daunting one considering I had only 12 lines of code.:
undefined method 'text' for app
Fortunately it turns out that the text method has been replaced with para in Shoes and simply swapping the command will fix the problem. That means that a simple Shoes app now looks like this:
1. my_text_field = nil 2. Shoes.app :height => 200, :width => 200 do 3. stack :margin => 10 do 4. button "Button One" do 5. my_text_field.replace "Button One Pressed" 6. end 7. button "Button Two" do 8. my_text_field.replace "Button Two Pressed" 9. end 10. my_text_field = para "Text Field" 11. end 12. end
If you're on Sidux or Debian Unstable and you want to install shoes, simply type in
sudo apt-get install shoes
Happy hacking!