Libglade wrapper for Ruby
by Avi Bryant <avi@beta4.com>

v. 1.2: applied portability patches from Paul Brannan

This provides a very simple interface to the libglade library,
to load interfaces dynamically from a glade file.

Installing:

>ruby extconf.rb
>make
>su
>make install

It requires libglade, libxml (1.x), and libz.  You may have to
provide extconf.rb with the paths to these.

Usage:

The constructor takes the path to a glade file, and optionally the name
of the widget at the root of the desired section of the interface
(by default, the entire file will be loaded).  It expects an iterator
block to be supplied, which takes the name of a handler (as specified
in the glade file) and returns a Method or Proc to bind that handler to.

For example:

	GladeXML.new("file.glade") do |handler|
		case handler
		when "buttonClicked"
			proc { |aButton| puts "#{aButton} clicked"}
		when "quit"
			proc {Gtk.main_quit}
		end
	end

Alternatively:

	def buttonClicked(aButton)
		puts "#{aButton} clicked"
	end

	def quit
		Gtk.main_quit
	end

	GladeXML.new("file.glade") { |handler| method(handler) }

The other two methods are getWidget and getWidgetByLongName, which will
return a gtk widget object based on the name given to it in the glade
file (getWidgetByLongName takes a full widget path to resolve ambiguity).

e.g.

	glade = GladeXML.new("file.glade") {}
	@myEntryBox = glade.getWidget("entry1")
	@myList = glade.getWidgetByLongName("window2.hbox.clist")

A note about signal handlers:

If you're using methods as signal handlers, you need to be somewhat careful
about their arity.  Currently, for 0 argument signals, GladeXML supports
three forms of method: no argument, a single argument (the widget the signal
came from), or two arguments (the widget, and the contents of the data field
for that signal in the glade file).
For signals with one or more arguments (such as select_column),
only one format is supported: (widget, ... args ..., data).

-----------

GladeXML class

instance methods:

initialize(gladeFile [, rootWidget], &handlerBlock)
getWidget(widgetName) -> aWidget
getWidgetByLongName(longWidgetName) -> aWidget
