Unified Ruby GUI

2009
12.18

Ruby is incredibly adaptable to a multitude of environments, operating systems and GUI toolkits. It can become cumbersome to procrastinators like me who tend to be in search for the one true way to fit it all. Note that I call it unified ruby GUI vs standard ruby GUI, because I don’t think that a true standard toolkit would make the world happy. My humble expectations are:

  • can be installed as gem and uses gem
  • supports*: windows, mac os x, gnome, kde, web-interface
  • *using the preferred toolkit** of that platform
  • **no other dependencies should be added
  • simple things should be simple
  • complicated things should be possible

Gem

A Gem is a package that includes everything needed for that package to run. It works great, handles download, installing, updating. I used it to get parts of snippets of code I wrote works great.

Target OS

The toolkits I saw and are well enough for practical work:

Windows: rubydotnet
Mac OS X: rubycocoa
gnome: rubygnome
kde: korundum

The Simple and the not so simple

One could be lured to think that we can simply write an huge application by writting a script like:

application do
	window do
		label 'Your name please'
		input = textedit()
		result = label('')
		button 'ok' {
			result.text = input.text
		}
	end
end

As soon as we tackle a more real life example things tends to be a lot more like:

#
# in the model folder
#
class Book
	attr_accessor :title
end
 
class Bookshelf
	include Enumerable
	# some books
end
 
#
# in the controller folder
#
class Library
	def addBook
	end
 
	def query
	end
 
	#etc
end
 
#
# in the view folder
#
class DocumentWindow
	def setup
	end
 
	def onLoad
	end
end

There is often the situation where more troubles comes to us and we need plugins, custumizaton, hacking…
We need to stricly stick to the MVC paradigm.

I found somehting

Actually I was overzealous thinking their wasn’t already somehting that resembles to what I just described; it’s called Shoes.

Related posts:
  1. Ruby Inox Part 7: Native Originally this article formed one article with Ruby Inox Part...
  2. Ruby Inox Part 6: Widget We are steering toward a graphical user interface. In this...
  3. Ruby Inox Part 5: Component Something promised is something due. Only two days have passed...
  4. Convert to PDF I was astonished not to discover an easy way to...
  5. Convert to PDF Version 1.1 A minor update for a developer a major improvement for...

Tags: , , , , ,

Comments are closed.


Ironic Wolf is Digg proof thanks to caching by WP Super Cache