Okay, Well... Shoes

July 30th 15:48
by why

The technology is called Shoes. I must be delusional to even try, I know. Anyway, it’s primitive and not too well-mannered. To download a build, go here.

And the sample is:

label, time = nil, Time.now
Shoes.app :height => 150, :width => 250 do
  background "rgb(240, 250, 208)"
  stack :margin => 10 do
    start = button "Start" do
      time = Time.now
      label.replace "Stop watch started at #{time}"
    end
    stop = button "Stop" do
      label.replace "Stopped, #{Time.now - time} seconds elapsed."
    end
    label = text "Press start to begin timing."
  end
end

More as the week goes on.

9 comments

_why

said on July 30th 16:43

Samples like the one above will appear here.

jashkenas

said on July 30th 20:36

Why!

I don’t think you’ll rest while there’s a single arena left in the potential Rubyverse where you haven’t drawn your line in the sand.

Three cheers.

Rebol

said on July 30th 21:36

Why:

Have you taken a serious look at Rebol? I’m curious to know your thoughts about it. It seems like Try Ruby and Hackety Hack could very easily have been written in Rebol and advanced very far. There is so much good work that has been done in Rebol and yet people continue to ignore it for some reason.

_why

said on July 30th 22:40

Sure, yeah, I’ve followed REBOL a few months longer than I’ve followed Ruby.

The succinctness of REBOL/View is awesome. Shoes is definitely inspired by it! The look of REBOL/View apps is kind of weird. REBOL itself is a fun language. I just can’t get myself to think in it. Ruby is my blood type now, it’s irreversible.

Also, it’s vital for my language of choice to be free software. Hacking Ruby internals has been an essential and glorious part of the whole experience for me.

zimbatm

said on July 31st 02:44

By first impression, the code seems a bit spagetty-like. Why not follow your Web inspiration and split data (html), presentation (css) and logic (js) ?

Maybe you’ll also be interested by LEL, that nice table constructing DSL : http://ihate.rubyforge.org/profligacy/lel.html

I wish you all the success for your project, that really looks fantastic as usual :)

Cheers,
zimbatm

prae

said on July 31st 08:46

Like Zim, I agree that presentation and logic should be split. Strangely enough, I’ve always liked Visual Basic for desktop GUI programming. The way you can easily bind click events to a method can’t really be beat.

In the button block format above, for instance, how would you go about setting an action to be executed on right click? Double-click versus single click? Mouse up versus mouse down? Method bindings seem the obvious choice:

def start_click
# Do something
end

def start_right_click
# Do something completely different
end

start = button(“Start”,
:click => start_click,
:right_click => start_right_click
)

Of course, scoping becomes an issue (there’s a reason why global variables are so popular in VB). But I’m sure it could be figured out relatively easily.

_why

said on July 31st 09:25

Well, these samples are small, so I’ve just inlined everything. There’s a technique for cutting things up so it looks just like a Camping app. I mean that’s exactly how I’m doing Hackety Hack. All in due time.

netghost

said on July 31st 10:51

Every time you create something my day gets just a little bit better. Beware, I may slip off into ecstatic hallucinations if you keep this up.

Peter

said on August 2nd 02:11

The wiki mentions ShoesLib.zip as being required for a Windows build, but it’s nowhere to find…

Comments are closed for this entry.