News for hackers. Stuff that matters.
Re:Colorful programs for Mac OS X, Linux and Windows by rcoder on Thursday August 14, 2008 @09:56PM (#276683)
Shoes is a GUI framework. It just handles drawing widgets (buttons, text boxes, video player frames, etc.) on screen. Think of it as a equivalent to a web browser, with a single language (Ruby) used to define content, layout, and behavior, instead of the mish-mash that is HTML, CSS, and Javascript.

True, once you break out into the "big bad world" of network protocols and disk I/O, your code may not be quite as dead simple, but it really shouldn't be too hard for most folks to jump from this:

  Shoes.app do
    button "PUSH!"
  end
...to this:

  Shoes.app do
    stack do
      @text = para("hostnames go here...")
      button("PUSH!") { @text.replace(File.read("/etc/hosts")) }
    end
  end
...and from there to this:

  Shoes.setup do
    gem 'simple-rss'
  end
  
  require 'simple-rss'
  require 'open-uri'
  
  Shoes.app do
    stack do
      banner "News.YC Headlines"
  
      button("Fetch") do
        @articles.clear
        
        rss = SimpleRSS.parse(open("http://news.ycombinator.com/rss").read)
        
        rss.items.each do |item|
          @articles.append { para(item.title) }
        end
      end
      
      @articles = stack
    end
  end
That isn't so bad, is it?

There are no comments on this comment yet.