≡ Menu


shoes – A cross-platform Windowing Applikit

Shoes is a very informal graphics and windowing toolkit. It's for making regular old apps that run on Windows, Mac OS X and Linux. It's a blend of my favorite things from the Web, some Ruby style, and a sprinkling of cross-platform widgets. Shoes uses Ruby as its interface language.

It borrows a few things I like from the web:
=> Hyperlinks and URLs within Shoes and to the web.
=> Simple text layout -- though Shoes eschews floats.
=> Images and colors in the layout and in the background.
=> Margin and padding.
=> Resizable layouts.

How do I install shoes ?

First, get source code, enter:
$ cd /tmp
$ wget http://shoooes.net/dist/shoes-0.r925.tar.gz

Untar it:
$ tar -zxvf shoes-0.r925.tar.gz
$ cd shoes-0.r925
Now install required stuff under Debian / Ubuntu Linux:
$ sudo apt-get install libcairo2-dev libpixman-1-dev libpango1.0-dev libungif4-dev libjpeg62-dev libgtk2.0-dev vlc libvlc0-dev libsqlite3-dev libcurl4-openssl-dev ruby1.8-dev rake
If you are using RHEL / CentOS / Fedora Linux, enter:
# yum install giflib-devel cairo-devel libpixman-devel pango-devel libjpeg-devel gtk2-devel sqlite-devel vlc-devel libcurl-devel ruby-devel
Install it:
$ make
$ sudo make install

Sample output:

build options: shoes raisins (0.r925) [i486-linux]
CC       = cc
RUBY     = /usr
installing executable file to /usr/local/bin
installing libraries to /usr/local/lib/shoes

See READM for for more information.

Hello World application

Sample hello.rb

Shoes.app {
  para strong("Hello, "), " world!"


Shoes.app (:width => 200, :height => 50, :title => "Hi, Guest!") {
   para strong("Hello, "), " world!"
   @buttonQuit = button "Exit"
   @buttonQuit.click { exit() }

Run it as follows:
$ /usr/local/bin/shoes hello.rb
Another example:

Shoes.app {
  name = ask("Please, enter your name:")
  para "Hello, ", name

You can include images from web or create a simple links / urls:

Shoes.app (:title => "My App" ) {
  image "http://theos.in/wp-content/uploads/2008/06/honda-fcx-clarity-car-photo.jpg"
  para( link("Info").click{ alert ("The FCX Clarity, which runs on hydrogen and electricity, emits only water and none of the noxious fumes believed to induce global warming.") })
  para( link("Exit").click{ exit() } )

Sample output:

Loading images from the web

Fig.01: Loading images from the web

Sample applications

You can find sample application in /tmp/shoes-0.r925/samples/ directory. Here is animated clock program:

# Shoes Clock by Thomas Bell
# posted to the Shoes mailing list on 04 Dec 2007
Shoes.app :height => 260, :width => 250 do
  @radius, @centerx, @centery = 90, 126, 140
  animate(8) do
    @time = Time.now
    clear do
      stack do
        background black
        para @time.strftime("%a"),
          span(@time.strftime(" %b %d, %Y "), :stroke => "#ccc"),
          strong(@time.strftime("%I:%M"), :stroke => white),
          @time.strftime(".%S"), :align => "center", :stroke => "#666",
            :margin => 4
      clock_hand @time.sec + (@time.usec * 0.000001),2,30,red
      clock_hand @time.min + (@time.sec / 60.0),5
      clock_hand @time.hour + (@time.min / 60.0),8,6
  def draw_background
    background rgb(230, 240, 200)
    fill white
    stroke black
    strokewidth 4
    oval @centerx - 102, @centery - 102, 204, 204
    fill black
    oval @centerx - 5, @centery - 5, 10, 10
    stroke black
    strokewidth 1
    line(@centerx, @centery - 102, @centerx, @centery - 95)
    line(@centerx - 102, @centery, @centerx - 95, @centery)
    line(@centerx + 95, @centery, @centerx + 102, @centery)
    line(@centerx, @centery + 95, @centerx, @centery + 102)
  def clock_hand(time, sw, unit=30, color=black)
    radius_local = unit == 30 ? @radius : @radius - 15
    _x = radius_local * Math.sin( time * Math::PI / unit )
    _y = radius_local * Math.cos( time * Math::PI / unit )
    stroke color
    strokewidth sw
    line(@centerx, @centery, @centerx + _x, @centery - _y)
Fig. 02: Animated clock

Fig. 02: Animated clock

Shoes manual

The manual can be launched by typing the following command
$ shoes -m

Further readings:

Windows Vista Failure: Pay Extra $50 To Get Aging Windows XP

From the computerworld:

Dell Inc. will charge customers up to $50 for factory-installed Windows XP on some PCs after Wednesday, according to the company's Web site. Vista Business and Vista Ultimate are the only generally-available editions that allow downgrades, and they can be downgraded only to Windows XP Professional. Under Microsoft's licensing terms, the less-expensive XP Home cannot be installed as a downgrade.

This is really funny, Microsoft spent over 6-8 years developing MS-Vista and now users are willing to pay not to use it. This clearly indicate that end users only pay when you have a better product, which is free from DRM crap, faster and less buggy as compare to Vista. As usual, I suggest you get Dell with Ubuntu Linux loaded for 100% peace of mind.

Download of The Day: CRON-O-Meter Open Source Dieting Software

CRON-O-Meter is free, open source, and cross-platform (Windows, Linux and Mac OS X) dieting software written in Java. It is a fully featured nutrition and biomarker tracking tool. Designed for practitioners of Caloric Restriction (CRON) Diets.

From the project site:

CR (Calorie Reduced) diets require a lot of information to perform optimally. In order to restrict caloric intake, but remain healthy, users of the diet must track their vitamin, mineral, and protein intakes with great care.

We aim to provide a complete solution to the CR dieter. Current open-source diet-tracking applications fall short in some vital respects. Either they are not detailed enough, or they suffer from critical usability flaws. We believe that a diet tracker must be effortless to operate for the activity for which it will be used most of the time, keeping track of the foods eaten in a particular meal.

To this end, we are developing CRON-O-Meter, an application that will take into account good usability design and dense functionality. It will provide diet advice, track consumption and exercise, and generally assist in all aspects of a CR diet.

Download CRON-O-Meter

Linux Is A Platform For You and Me – Not Just For Specialists

An interesting interview with Canonical chief executive Mark Shuttleworth. He talks about choosing Ubuntu name and in a future undominated by Windows, how Ubuntu hopes to be the provider of a service ecosystem for free software. From the page:

Going to space and seeing the Earth from a distance makes it very clear just how interdependent we are. So I wanted to do something that was really global; free software is a phenomenon that is truly global.

=> Linux is a platform for people, not just specialists

Developers Deliberately Avoiding Vista for Mac OS and Linux

Programmers deliberately avoiding association with Vista, and habitually keeping away from Vista for Mac OS and Linux. According to a survey issued last week by Evans Data Corp. The headline was that most developers are still not targeting Windows Vista when they write new apps. Only 8% of the 380 developers surveyed were writing for Vista; 49% were still targeting Windows XP.

It appers that programmers may be developing an interest in something beyond the size of the installed operating system base, which is good news for Linux.

=> Survey: Programmers shunning Vista for Mac OS and Linux

Download Firefox 3 Release Candidate 1

Firefox 3 release candidate 1 (RC1) is available for download from official project web site. Firefox 3 is based upon Gecko 1.9 engine, which has more than 14,000 updates including some major re-architecting to provide improved performance, stability, rendering correctness, and code simplification and sustainability. Firefox 3 has been built on top of this new platform resulting in a more secure, easier to use, more personal product with a lot more under the hood to offer website and Firefox add-on developers.

Quick Firefox 3 RC1 Installation

Type the following command at a shell prompt:
$ cd /tmp && wget 'http://download.mozilla.org/?product=firefox-3.0rc1&os=linux&lang=en-US'
$ tar -jxvf firefox-3.0rc1.tar.bz2

Backup existing settings:
$ mkdir ~/backup
$ cp -avr ~/.mozilla/ ~/backup/

Now install new firefox at /opt:
$ sudo tar -jxvf firefox-3.0rc1.tar.bz2 -C /opt/
Start Firefox:
$ /opt/firefox/firefox &

(Fig.01: Firefox 3 in action [click to enlarge image])

Download FireFox 3 RC1 for Windows / Linux / OS X

A word about addons

Following addons are not compatible with FF3:

  • Firebug (beta version should work with FF3, see comments below)
  • Yslow
  • Google toolbar
  • Stumble toolbar

Updated for accuracy!

Mega List of low Cost ( Cheap ) Linux / Windows Ultraportables PCs

Check out this awesome post about all tiny device powered by Linux!

Over the past six months or so, Asus, Everex, and HP have managed to bring low-cost ultraportable notebooks to market. But dozens of other computer makers have promised to bring out their own mini-notebooks. Some will run Linux, while others will be preloaded with Windows XP or Vista. Some will have flash memory, while others will have hard drives. But every one will be smaller, lighter, and cheaper than most existing laptop computers. Here's a roundup of some of the computers that have been announced or are already available.

Comprehensive list of low-cost ultraportables (Via digg)