13.Aug.2007
Once again, a work by _why is feature on this blog. He just doesn’t stop creating awesome tools and frameworks with is favorite language. Now he even has his own icecream ipscream flavor (see the last one on the list).
This time, the development of Hackety Hack was stopped in favor of Shoes, which why calls the soul of the programmer starter kit’s new version. It’s basically a cross-platform toolkit to create simple GUIs. It gives you elements from HTML for your desktop application interface. It works well under Windows, OSX and GTK without changing one line of code. It’s main feature is how the otherwise tedious task of creating buttons and layouts gets simpler, using the characteristics of the ruby language.
The toolkit is still under development and you can find out where to download it from here. It comes already with ruby inside, in case you don’t have it on your machine.
Now it’s time for an example gently ripped of (and slightly changed) from Hackety’s blog.
name, phone, address = nil
Shoes.app do
background "rgb(240, 245, 220)"
stack do
stack :margin => 10 do
text "Name"
name = list_box :items =>
["Philarp Tremaine", "Dirk Hockeybranch"]
text "Address"
address = edit_line
text "Phone"
phone = edit_line
button "Save" do
Shoes.p [name.text, address.text, phone.text]
end
end
end
end
As you can see, besides not doing something actually useful, the code is very readable and easy to understand. You can encapsulate elements inside Stacks and flows. The text can get actual HTML elements in the string like span tags. You can find more examples here, as well on Hackety where _why presents the latest features.
Disclamer (by _why): Shoes isn’t an acronym. It’s just a name. And the name is Shoes. Its pronounced just like normal shoes. Except it’s spelled Shoes. It’s not spelled in any other way. If you are Charles Dickens, you have permission to call it Shuse. But UNLESS YOU ARE CHARLES DICKENS, I beg you. Shoes. Trust me, I know what I’m doing this time!
Sérgio Santos | Creative Commons | micro theme by seaofclouds, and powered with Mephisto
Leave a Comment
Follow this post comments with this RSS feed.