Tying Your Shoes
by Murray Steele on Nov 24, 2008
- 10,231 views
Accessibility
Categories
Tags
More...Upload Details
Uploaded via SlideShare as Adobe PDF
Usage Rights
© All Rights Reserved
Statistics
- Favorites
- 11
- Downloads
- 528
- Comments
- 43
- Embed Views
- Views on SlideShare
- 10,169
- Total Views
- 10,231

Note, this presentation was given as part of a 2-for-1 session with Martin Sadler at Ruby Manor in 2008. The video of my part of the talk is the 2nd half of the video. You can find Martin’s slides here: http://www.slideshare.net/martinbtt/monkeybars-in-the-manor-presentation 1 year ago Reply
All the images I used came from Flickr. Thanks to these photographers for making my terrible content look good. 3 years ago Reply
So, that’s it.
Hopefully I’ve whetted your appetite for Shoes, if you want to know more there are excellent resources out there about shoes. First is the shoes manual, which is built into every shoes app. Press cmd m to make it appear. Then go and get a copy of “nobody knows shoes” (the most superb manual for a programming library, ever). Then explore the rest.
I really recommend it. 3 years ago Reply
Shoes has an excellent in built packaging feature. From the “Package” menu of any Shoes app you can bundle up your Shoes code, along with Shoes and dependencies, as a Windows, OS X, Linux or Shoes application. Shoes has a cross-platform bundle called SHY which you can use instead.
It’s a really simple and nice way of bundling your code, much easier than any other mechanism I’ve used in the past, and it’s awesome that it’s built in. 3 years ago Reply
You can extend Shoes itself and this lets you define url endpoints which are methods in your Shoes class that you can then visit with the “visit” method. Visit takes a url, relative or absolute. You can have regexp’s in the URL and the groups become args to the methods called. The main advantage here is then being able to put your Shoes code into multiple files.
It’s not clear to me the full power of advantage of this, except for the fact that the urls you visit can be absolute, and thus you can put shoes apps online to perhaps combine the power of a desktop app with the simplicity of updating via a central web app.
(Note, this example code came from a sample app that ships with Shoes) 3 years ago Reply
Speaking, as I was just breifly about tidying up the code and so on, I should point out that all the code I’ve shown you has been from one file: talon.rb. That’s not to say that you can’t organise your code better. Shoes has some interesting features that could help this. I have to say, I’ve not fully explored this aspect of Shoes, so I’m just letting you know that it’s out there... 3 years ago Reply
Shoes has the ability to create custom controls, so if you need a dial or big flippy switch as a UI element, you can combine the drawing stuff I just mentioned and the existing controls and layouts in a class that extends from Shoes::Widget. You can then use these custom widgets inside your Shoes app and not have to worry about repeating code, or having code in the wrong place cluttering up your main logic.
If I had the time I’d probably have tried to make the login UI in Talon a widget so I can encapsulate all the display and shaky head logic in one place. 3 years ago Reply
I mentioned at the start that Shoes is influenced by Nodebox and Processing. Everything is a canvas and it has some really powerful animation (which I touched on) and drawing (which I didn’t) features. In recent builds _why has been building in more and more features for doing really neat graphical stuff (like filters and alpha transparency and so-on). Thankfully also without sacrificing the simplicity of the API. Remember, the goal of this is to power Hackety Hack, a tool for teaching kids to program. Adding this to the fact that you can do pixel perfect layout of elements means you could do some stunning looking animated UIs. For example, if you wanted a random name generator you could draw a hat that spits out stars and then picks a random name. Or... something good. 3 years ago Reply
So... I could go on and show you how I’ve built the rest of Talon. (It does connect to Twitter and get a list of your friends tweets and even allow you to post a tweet back to Twitter). But I won’t, I don’t have much time, and I want to briefly mention some other stuff that Shoes does (that I didn’t really have the time to build into Talon).
Also, the rest of the Talon code doesn’t really show off anything new, apart from perhaps some other style attributes, or UI elements. 3 years ago Reply