shoes/shoes4 — pull request #451 by PragTob (2013-10-09 23:18:20+00:00)
Title: Basic Slot#prepend implementation

This was an idea I got and it works! =)

It was quick to try out. There are no tests yet (please forgive me for not doing TDD but I just wanted to see if it works after I had this simple idea in my head for some time).

Basically it introduces the new prepending state to a slot. If we are prepending we put elements to the start of the contents array and if not we just append them. This works as layouting goes through the elements one by one.

However this does not fully work yet. E.g. it prepends elements but the order is messed up. E.g. when we do prepend the elements 1, 2, 3 then in the app they will show up as 3, 2, 1 (previous slot content). Need to fix that, will do tomorrow/this weekend. Maybe if we just append to a special prepending array during that time, and prepend that array to the existing contents array when prepending is finished... hmm.

Oh here is a simple script to try it out right now:

```ruby
Shoes.app do
slot = stack do
button 'Yo'
end
button 'append' do
slot.append do button 'appended' end
end
button 'prepend' do
slot.prepend do button 'prepended' end
end
end
```

This takes care of #332 and cc @rjack1201

So everyone what do you think? Good approach?