1. Technology
You can opt-out at any time. Please refer to our privacy policy for contact information.

An Introduction to Shoes--Using Shoes for Online Applications

By

2 of 3

Hello World
An Introduction to Shoes--Using Shoes for Online Applications

The example application below is a simple "Hello World" type program. It will simply display the message "Hello World" in a window. Note that there is no shebang line (#!/usr/bin/env ruby) as this is intended to be run from Shoes itself, as is common with Shoes programs.

 Shoes.app :width => 200, :height => 140 do
   para "Hello World!"
 end
 

The Shoes.app method call encapsulates the entire Shoes application. The parameters passed to it are the width and height of the window in pixels. Inside are all things you'll see inside of the application window. In this case, a para (or "paragraph") displays the text "Hello World."

  1. About.com
  2. Technology
  3. Ruby
  4. Graphical User Interfaces
  5. Shoes
  6. Hello World

©2014 About.com. All rights reserved.