<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Pyadav</id>
	<title>Expertiza_Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.expertiza.ncsu.edu/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Pyadav"/>
	<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=Special:Contributions/Pyadav"/>
	<updated>2026-06-08T19:32:28Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.41.0</generator>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/oss_paa&amp;diff=80896</id>
		<title>CSC/ECE 517 Fall 2013/oss paa</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/oss_paa&amp;diff=80896"/>
		<updated>2013-10-30T17:52:56Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* Filter */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Expertiza OSS Project –E809  (TreeDisplay)'''&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
The [http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza] project has a collapsible tree view structure to facilitate traversal through all learning objects. The problem statement is to redesign the underlying structure and include efficient search, filter and sort mechanism in the tree view structure. The tree is composed of different folders namely Assignments, Courses, Questionnaires and their subfolders respectively.&lt;br /&gt;
&lt;br /&gt;
==Existing Design==&lt;br /&gt;
Currently the folders structure is displayed as a tree. The structure of the tree is as follows -&lt;br /&gt;
&lt;br /&gt;
: •	Questionnaire&lt;br /&gt;
&lt;br /&gt;
:: o	Review&lt;br /&gt;
&lt;br /&gt;
:: o	Metareview&lt;br /&gt;
&lt;br /&gt;
:: o	Author Feedback&lt;br /&gt;
&lt;br /&gt;
:: o	Teammate Review&lt;br /&gt;
&lt;br /&gt;
:: o	Survey&lt;br /&gt;
&lt;br /&gt;
:: o	Global Survey&lt;br /&gt;
&lt;br /&gt;
:: o	Course Evaluation&lt;br /&gt;
&lt;br /&gt;
: •	Courses&lt;br /&gt;
&lt;br /&gt;
:: o	Course&lt;br /&gt;
&lt;br /&gt;
::: 	assignment&lt;br /&gt;
&lt;br /&gt;
: •	Assignments&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The whole set of Courses, Assignments and Questionnaires are displayed on screen in a collapsible tree view upon login. Items may be expanded and collapsed. There is no functionality to search/filter results.&lt;br /&gt;
The sort functionality has been provided which sorts the tree structure with important metrics such as creation date, name and directory in ascending as well as descending order. &lt;br /&gt;
We also have the option to view either the public and private items or the private items only.&lt;br /&gt;
&lt;br /&gt;
 '''[[File:ExistingUI.jpg]]'''&lt;br /&gt;
&lt;br /&gt;
Fig.1 Existing UI which implements display of nodes and a sort utility&lt;br /&gt;
&lt;br /&gt;
==Project Requirement==&lt;br /&gt;
The tree display can be inefficient given many objects (courses, etc.).  We are supposed to design the underlying structure at the model level to efficiently retrieve organized data. &lt;br /&gt;
&lt;br /&gt;
We are also required to redesign the view to enable users to filter/search and sort by important metrics such as creation date, name (alphabetical) and relationship (e.g. filter all assignments by a course). &lt;br /&gt;
&lt;br /&gt;
The interface should be kept modular in the code to increase extensibility for future metrics.  We have to keep the controller as ‘skinny’ as possible, leaving the model to perform computational logic.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
We have introduced two new features - search and filter.&lt;br /&gt;
To implement the search/filter, we have decided to use the same tree display which is efficient and simple to show the current data.&lt;br /&gt;
&lt;br /&gt;
 '''[[File:newUI.jpg]]'''&lt;br /&gt;
&lt;br /&gt;
Fig.2 Above is the new UI which includes search and filter functionality&lt;br /&gt;
&lt;br /&gt;
===Search===&lt;br /&gt;
This functionality searches for a keyword among 3 categories courses/assignment/questionnaire. It is implemented using substring search. All the entries whose substring matches with the search string are returned. Based on the input the user can view the filtered results in any of the 3 categories.&lt;br /&gt;
&lt;br /&gt;
 '''[[File:sample1.jpg]]'''&lt;br /&gt;
&lt;br /&gt;
Fig.3 A sample output of searching “demo” in assignments.&lt;br /&gt;
&lt;br /&gt;
===Filter===&lt;br /&gt;
There are 2 main relationships in the tree structure. These are as follows -&lt;br /&gt;
&lt;br /&gt;
: 1.  A course can have many assignments.&lt;br /&gt;
&lt;br /&gt;
: 2.  An assignment can have many questionnaires.&lt;br /&gt;
&lt;br /&gt;
If the user selects one of the two fields and enters the course/assignment name, then he can see a list of all the elements which are related to that course/assignment.&lt;br /&gt;
&lt;br /&gt;
 '''[[File:sample2.jpg]]'''&lt;br /&gt;
&lt;br /&gt;
Fig.4 Sample output which shows the result of filtering assignments by course “CourseTest1”&lt;br /&gt;
&lt;br /&gt;
===Compatibility with existing features===&lt;br /&gt;
A user can search all assignments for a respective course, and also search for all questionnaires related to one assignment, Also a search can be performed on all the nodes. We preserve the sort feature across the implementation which means that the user can sort the filtered/search results also. The user can also view the public and private items or the private items only for the filtered/search results.&lt;br /&gt;
&lt;br /&gt;
 '''[[File:sample3.jpg]]'''&lt;br /&gt;
&lt;br /&gt;
Fig.5 Sample output which shows the same result of searching “demo” in assignments but sorted in descending order.&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===View===&lt;br /&gt;
Since the tree display is the best way to show the folder structure and to maximize code reuse, we choose the same display style for search results.  We add search and filter boxes to input the search/filter keyword on the main page and output the result on the same page. We also add the reset button to reset the filter/search and display all the results again.&lt;br /&gt;
All the above changes are done in -&lt;br /&gt;
 ''' \view \tree_display\_page_header.html.erb  '''&lt;br /&gt;
&lt;br /&gt;
===Controller===&lt;br /&gt;
We modify the existing list function in the tree_display_controller.rb as it is responsible for all the inputs on the tree display page. We also add a new function filter in the file which parses the input string given by the user and converts it into a meaningful string depending on what user wants to filter. Filter is called by list function and the filter/search string is placed into a global variable, so that future operations can make use of the previous search.&lt;br /&gt;
 '''tree_display_controller.rb '''&lt;br /&gt;
&lt;br /&gt;
===Model===&lt;br /&gt;
We have made changes to the following models to search/filter for the keyword in corresponding nodes.-&lt;br /&gt;
&lt;br /&gt;
 '''questionnaire_node.rb '''&lt;br /&gt;
 '''assignment_node.rb '''&lt;br /&gt;
 '''course_node.rb '''&lt;br /&gt;
 '''node.rb '''&lt;br /&gt;
 '''folder_node.rb '''&lt;br /&gt;
&lt;br /&gt;
All the models have the same logic to parse the input search string and accordingly find the nodes in the model objects. The design is extensible and controller is left skinny which just does the parsing of input string and calls a generic model function.  The summary is given below&lt;br /&gt;
&lt;br /&gt;
The view takes the string and passes to controller&lt;br /&gt;
&lt;br /&gt;
 '''User  -&amp;gt; input string  -&amp;gt;  Controller. '''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Controller does the parsing and calls a generic function which iterates over folders.&lt;br /&gt;
&lt;br /&gt;
 '''Controller  -&amp;gt;  search string  -&amp;gt;  Models(Iterator) '''&lt;br /&gt;
 '''Iterator  -&amp;gt;  Controller  -&amp;gt;  View(display) '''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Model returns the required nodes and controller handles them to view. The code which has been put in all model objects is generic. The same code can be used with future nodes or new folders when they are added in future.&lt;br /&gt;
&lt;br /&gt;
The controller code remains generic and it only needs to include a new case which specifies the new filter. This way we can extend the same controller and model code later for future searches. By adding the code in this manner, we have introduced maximum cohesion as all search/filter functionality always uses the same code.&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
&lt;br /&gt;
:1. [http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza]&lt;br /&gt;
&lt;br /&gt;
:2. [http://152.46.20.83:3000/ VCL Link]&lt;br /&gt;
&lt;br /&gt;
:3. [https://github.com/prateeky1407/expertiza Git repository]&lt;br /&gt;
&lt;br /&gt;
:4. [https://docs.google.com/a/ncsu.edu/document/d/1Z0xjFZu-Zy-xm73YyUVUgFCtfWgRwhN1rZuThoyF-U0/edit Steps to setup Expertiza]&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/oss_paa&amp;diff=80894</id>
		<title>CSC/ECE 517 Fall 2013/oss paa</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/oss_paa&amp;diff=80894"/>
		<updated>2013-10-30T17:52:23Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;'''Expertiza OSS Project –E809  (TreeDisplay)'''&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
== Introduction ==&lt;br /&gt;
The [http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza] project has a collapsible tree view structure to facilitate traversal through all learning objects. The problem statement is to redesign the underlying structure and include efficient search, filter and sort mechanism in the tree view structure. The tree is composed of different folders namely Assignments, Courses, Questionnaires and their subfolders respectively.&lt;br /&gt;
&lt;br /&gt;
==Existing Design==&lt;br /&gt;
Currently the folders structure is displayed as a tree. The structure of the tree is as follows -&lt;br /&gt;
&lt;br /&gt;
: •	Questionnaire&lt;br /&gt;
&lt;br /&gt;
:: o	Review&lt;br /&gt;
&lt;br /&gt;
:: o	Metareview&lt;br /&gt;
&lt;br /&gt;
:: o	Author Feedback&lt;br /&gt;
&lt;br /&gt;
:: o	Teammate Review&lt;br /&gt;
&lt;br /&gt;
:: o	Survey&lt;br /&gt;
&lt;br /&gt;
:: o	Global Survey&lt;br /&gt;
&lt;br /&gt;
:: o	Course Evaluation&lt;br /&gt;
&lt;br /&gt;
: •	Courses&lt;br /&gt;
&lt;br /&gt;
:: o	Course&lt;br /&gt;
&lt;br /&gt;
::: 	assignment&lt;br /&gt;
&lt;br /&gt;
: •	Assignments&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The whole set of Courses, Assignments and Questionnaires are displayed on screen in a collapsible tree view upon login. Items may be expanded and collapsed. There is no functionality to search/filter results.&lt;br /&gt;
The sort functionality has been provided which sorts the tree structure with important metrics such as creation date, name and directory in ascending as well as descending order. &lt;br /&gt;
We also have the option to view either the public and private items or the private items only.&lt;br /&gt;
&lt;br /&gt;
 '''[[File:ExistingUI.jpg]]'''&lt;br /&gt;
&lt;br /&gt;
Fig.1 Existing UI which implements display of nodes and a sort utility&lt;br /&gt;
&lt;br /&gt;
==Project Requirement==&lt;br /&gt;
The tree display can be inefficient given many objects (courses, etc.).  We are supposed to design the underlying structure at the model level to efficiently retrieve organized data. &lt;br /&gt;
&lt;br /&gt;
We are also required to redesign the view to enable users to filter/search and sort by important metrics such as creation date, name (alphabetical) and relationship (e.g. filter all assignments by a course). &lt;br /&gt;
&lt;br /&gt;
The interface should be kept modular in the code to increase extensibility for future metrics.  We have to keep the controller as ‘skinny’ as possible, leaving the model to perform computational logic.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Implementation==&lt;br /&gt;
We have introduced two new features - search and filter.&lt;br /&gt;
To implement the search/filter, we have decided to use the same tree display which is efficient and simple to show the current data.&lt;br /&gt;
&lt;br /&gt;
 '''[[File:newUI.jpg]]'''&lt;br /&gt;
&lt;br /&gt;
Fig.2 Above is the new UI which includes search and filter functionality&lt;br /&gt;
&lt;br /&gt;
===Search===&lt;br /&gt;
This functionality searches for a keyword among 3 categories courses/assignment/questionnaire. It is implemented using substring search. All the entries whose substring matches with the search string are returned. Based on the input the user can view the filtered results in any of the 3 categories.&lt;br /&gt;
&lt;br /&gt;
 '''[[File:sample1.jpg]]'''&lt;br /&gt;
&lt;br /&gt;
Fig.3 A sample output of searching “demo” in assignments.&lt;br /&gt;
&lt;br /&gt;
===Filter===&lt;br /&gt;
There are 2 main relationships in the tree structure. These are as follows -&lt;br /&gt;
&lt;br /&gt;
: 1.  A course can have many assignments.&lt;br /&gt;
&lt;br /&gt;
: 2.  An assignment can have many questionnaires.&lt;br /&gt;
&lt;br /&gt;
If the user selects one of the two fields and enters the course/assignment name, Then he can see a list of all the elements which are related to that course/assignment.&lt;br /&gt;
&lt;br /&gt;
 '''[[File:sample2.jpg]]'''&lt;br /&gt;
&lt;br /&gt;
Fig.4 Sample output which shows the result of filtering assignments by course “CourseTest1” &lt;br /&gt;
&lt;br /&gt;
===Compatibility with existing features===&lt;br /&gt;
A user can search all assignments for a respective course, and also search for all questionnaires related to one assignment, Also a search can be performed on all the nodes. We preserve the sort feature across the implementation which means that the user can sort the filtered/search results also. The user can also view the public and private items or the private items only for the filtered/search results.&lt;br /&gt;
&lt;br /&gt;
 '''[[File:sample3.jpg]]'''&lt;br /&gt;
&lt;br /&gt;
Fig.5 Sample output which shows the same result of searching “demo” in assignments but sorted in descending order.&lt;br /&gt;
&lt;br /&gt;
==Design==&lt;br /&gt;
===View===&lt;br /&gt;
Since the tree display is the best way to show the folder structure and to maximize code reuse, we choose the same display style for search results.  We add search and filter boxes to input the search/filter keyword on the main page and output the result on the same page. We also add the reset button to reset the filter/search and display all the results again.&lt;br /&gt;
All the above changes are done in -&lt;br /&gt;
 ''' \view \tree_display\_page_header.html.erb  '''&lt;br /&gt;
&lt;br /&gt;
===Controller===&lt;br /&gt;
We modify the existing list function in the tree_display_controller.rb as it is responsible for all the inputs on the tree display page. We also add a new function filter in the file which parses the input string given by the user and converts it into a meaningful string depending on what user wants to filter. Filter is called by list function and the filter/search string is placed into a global variable, so that future operations can make use of the previous search.&lt;br /&gt;
 '''tree_display_controller.rb '''&lt;br /&gt;
&lt;br /&gt;
===Model===&lt;br /&gt;
We have made changes to the following models to search/filter for the keyword in corresponding nodes.-&lt;br /&gt;
&lt;br /&gt;
 '''questionnaire_node.rb '''&lt;br /&gt;
 '''assignment_node.rb '''&lt;br /&gt;
 '''course_node.rb '''&lt;br /&gt;
 '''node.rb '''&lt;br /&gt;
 '''folder_node.rb '''&lt;br /&gt;
&lt;br /&gt;
All the models have the same logic to parse the input search string and accordingly find the nodes in the model objects. The design is extensible and controller is left skinny which just does the parsing of input string and calls a generic model function.  The summary is given below&lt;br /&gt;
&lt;br /&gt;
The view takes the string and passes to controller&lt;br /&gt;
&lt;br /&gt;
 '''User  -&amp;gt; input string  -&amp;gt;  Controller. '''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Controller does the parsing and calls a generic function which iterates over folders.&lt;br /&gt;
&lt;br /&gt;
 '''Controller  -&amp;gt;  search string  -&amp;gt;  Models(Iterator) '''&lt;br /&gt;
 '''Iterator  -&amp;gt;  Controller  -&amp;gt;  View(display) '''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Model returns the required nodes and controller handles them to view. The code which has been put in all model objects is generic. The same code can be used with future nodes or new folders when they are added in future.&lt;br /&gt;
&lt;br /&gt;
The controller code remains generic and it only needs to include a new case which specifies the new filter. This way we can extend the same controller and model code later for future searches. By adding the code in this manner, we have introduced maximum cohesion as all search/filter functionality always uses the same code.&lt;br /&gt;
&lt;br /&gt;
== External Links ==&lt;br /&gt;
&lt;br /&gt;
:1. [http://wikis.lib.ncsu.edu/index.php/Expertiza Expertiza]&lt;br /&gt;
&lt;br /&gt;
:2. [http://152.46.20.83:3000/ VCL Link]&lt;br /&gt;
&lt;br /&gt;
:3. [https://github.com/prateeky1407/expertiza Git repository]&lt;br /&gt;
&lt;br /&gt;
:4. [https://docs.google.com/a/ncsu.edu/document/d/1Z0xjFZu-Zy-xm73YyUVUgFCtfWgRwhN1rZuThoyF-U0/edit Steps to setup Expertiza]&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=78340</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=78340"/>
		<updated>2013-09-19T01:36:09Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* Shoes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver.&amp;lt;ref name=one &amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&amp;lt;/ref&amp;gt; Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&amp;lt;ref name=two&amp;gt;http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 300, :height =&amp;gt; 200 do&lt;br /&gt;
   para &amp;quot;Hello World!!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The Shoes.app method call encapsulates the entire Shoes application.It starts up a Shoes app window. This is the starting place for making a Shoes program. The parameters passed to it are the width and height of the window in pixels.Inside the block,we can fill the window with various Shoes elements.It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&amp;lt;ref&amp;gt;http://ruby.about.com/od/shoes/ss/shoes1_2.htm&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://shoesrb.com/manual/App.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&amp;lt;ref name=two /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries:&lt;br /&gt;
**	[http://en.wikipedia.org/wiki/Cairo_(graphics) Cairo ]– for device independent API using vector graphics&lt;br /&gt;
**	[http://en.wikipedia.org/wiki/Pango Pango] – for full-function rendering of text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
*Shoes is one of a kind,with its very own layout mechanisms “stack” and “flow”.&amp;lt;ref name=six &amp;gt;http://pragtob.wordpress.com/2013/07/17/shoes-4-a-progress-report/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.The default backend implementation uses JRuby + SWT, but there also is a proof of concept backend in Qt.&amp;lt;ref name=six /&amp;gt;&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to Shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&amp;lt;ref name=six /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&amp;lt;ref name=eight &amp;gt;http://www.fxruby.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&amp;lt;ref&amp;gt;https://code.google.com/p/fox-toolkit/&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&amp;lt;ref&amp;gt;http://rubydoc.info/github/larskanis/fxruby/1.6/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&amp;lt;ref name=one /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &amp;lt;ref&amp;gt;http://www.tutorialspoint.com/ruby/ruby_tk_guide.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk we can create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In this program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we call main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Qt_%28framework%29&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture.&amp;lt;ref&amp;gt;http://lists.qt.nokia.com/public/qt5-feedback/2011-October/001622.html&amp;lt;/ref&amp;gt; Qt5 brings significant improvements to the speed and ease of developing user interfaces.&amp;lt;ref&amp;gt;http://blog.qt.digia.com/blog/2011/05/09/thoughts-about-qt-5/&amp;lt;/ref&amp;gt; Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing.&amp;lt;ref name=seven &amp;gt;http://ruby.about.com/od/gui/a/wxwidgets.htm&amp;lt;/ref&amp;gt; There are several benefits of using WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator.&amp;lt;ref name=seven /&amp;gt;It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. the third parameter of the Wx::Frame constructor is the text to display in the title bar. The string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the task bar. After creating a widget, you must call show on it or it won't be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This simply creates an instance of MyApp, then calls the method main_loop on it which ends when you click the close button.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/GTK&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk trough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=78339</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=78339"/>
		<updated>2013-09-19T01:35:40Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* Shoes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver.&amp;lt;ref name=one &amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&amp;lt;/ref&amp;gt; Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&amp;lt;ref name=two&amp;gt;http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit) shoes&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 300, :height =&amp;gt; 200 do&lt;br /&gt;
   para &amp;quot;Hello World!!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The Shoes.app method call encapsulates the entire Shoes application.It starts up a Shoes app window. This is the starting place for making a Shoes program. The parameters passed to it are the width and height of the window in pixels.Inside the block,we can fill the window with various Shoes elements.It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&amp;lt;ref&amp;gt;http://ruby.about.com/od/shoes/ss/shoes1_2.htm&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://shoesrb.com/manual/App.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&amp;lt;ref name=two /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries:&lt;br /&gt;
**	[http://en.wikipedia.org/wiki/Cairo_(graphics) Cairo ]– for device independent API using vector graphics&lt;br /&gt;
**	[http://en.wikipedia.org/wiki/Pango Pango] – for full-function rendering of text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
*Shoes is one of a kind,with its very own layout mechanisms “stack” and “flow”.&amp;lt;ref name=six &amp;gt;http://pragtob.wordpress.com/2013/07/17/shoes-4-a-progress-report/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.The default backend implementation uses JRuby + SWT, but there also is a proof of concept backend in Qt.&amp;lt;ref name=six /&amp;gt;&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to Shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&amp;lt;ref name=six /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&amp;lt;ref name=eight &amp;gt;http://www.fxruby.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&amp;lt;ref&amp;gt;https://code.google.com/p/fox-toolkit/&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&amp;lt;ref&amp;gt;http://rubydoc.info/github/larskanis/fxruby/1.6/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&amp;lt;ref name=one /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &amp;lt;ref&amp;gt;http://www.tutorialspoint.com/ruby/ruby_tk_guide.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk we can create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In this program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we call main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Qt_%28framework%29&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture.&amp;lt;ref&amp;gt;http://lists.qt.nokia.com/public/qt5-feedback/2011-October/001622.html&amp;lt;/ref&amp;gt; Qt5 brings significant improvements to the speed and ease of developing user interfaces.&amp;lt;ref&amp;gt;http://blog.qt.digia.com/blog/2011/05/09/thoughts-about-qt-5/&amp;lt;/ref&amp;gt; Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing.&amp;lt;ref name=seven &amp;gt;http://ruby.about.com/od/gui/a/wxwidgets.htm&amp;lt;/ref&amp;gt; There are several benefits of using WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator.&amp;lt;ref name=seven /&amp;gt;It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. the third parameter of the Wx::Frame constructor is the text to display in the title bar. The string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the task bar. After creating a widget, you must call show on it or it won't be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This simply creates an instance of MyApp, then calls the method main_loop on it which ends when you click the close button.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/GTK&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk trough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=78335</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=78335"/>
		<updated>2013-09-19T00:55:00Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* Cool Features */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver.&amp;lt;ref name=one &amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&amp;lt;/ref&amp;gt; Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&amp;lt;ref name=two&amp;gt;http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 300, :height =&amp;gt; 200 do&lt;br /&gt;
   para &amp;quot;Hello World!!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The Shoes.app method call encapsulates the entire Shoes application.It starts up a Shoes app window. This is the starting place for making a Shoes program. The parameters passed to it are the width and height of the window in pixels.Inside the block,we can fill the window with various Shoes elements.It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&amp;lt;ref&amp;gt;http://ruby.about.com/od/shoes/ss/shoes1_2.htm&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://shoesrb.com/manual/App.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&amp;lt;ref name=two /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries:&lt;br /&gt;
**	[http://en.wikipedia.org/wiki/Cairo_(graphics) Cairo ]– for device independent API using vector graphics&lt;br /&gt;
**	[http://en.wikipedia.org/wiki/Pango Pango] – for full-function rendering of text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
*Shoes is one of a kind,with its very own layout mechanisms “stack” and “flow”.&amp;lt;ref name=six &amp;gt;http://pragtob.wordpress.com/2013/07/17/shoes-4-a-progress-report/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.The default backend implementation uses JRuby + SWT, but there also is a proof of concept backend in Qt.&amp;lt;ref name=six /&amp;gt;&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to Shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&amp;lt;ref name=six /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&amp;lt;ref name=eight &amp;gt;http://www.fxruby.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&amp;lt;ref&amp;gt;https://code.google.com/p/fox-toolkit/&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&amp;lt;ref&amp;gt;http://rubydoc.info/github/larskanis/fxruby/1.6/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&amp;lt;ref name=one /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &amp;lt;ref&amp;gt;http://www.tutorialspoint.com/ruby/ruby_tk_guide.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk we can create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In this program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we call main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Qt_%28framework%29&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture.&amp;lt;ref&amp;gt;http://lists.qt.nokia.com/public/qt5-feedback/2011-October/001622.html&amp;lt;/ref&amp;gt; Qt5 brings significant improvements to the speed and ease of developing user interfaces.&amp;lt;ref&amp;gt;http://blog.qt.digia.com/blog/2011/05/09/thoughts-about-qt-5/&amp;lt;/ref&amp;gt; Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing.&amp;lt;ref name=seven &amp;gt;http://ruby.about.com/od/gui/a/wxwidgets.htm&amp;lt;/ref&amp;gt; There are several benefits of using WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator.&amp;lt;ref name=seven /&amp;gt;It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. the third parameter of the Wx::Frame constructor is the text to display in the title bar. The string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the task bar. After creating a widget, you must call show on it or it won't be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This simply creates an instance of MyApp, then calls the method main_loop on it which ends when you click the close button.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/GTK&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk trough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=78334</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=78334"/>
		<updated>2013-09-19T00:50:50Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* ffi-tk */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver.&amp;lt;ref name=one &amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&amp;lt;/ref&amp;gt; Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&amp;lt;ref name=two&amp;gt;http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 300, :height =&amp;gt; 200 do&lt;br /&gt;
   para &amp;quot;Hello World!!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The Shoes.app method call encapsulates the entire Shoes application.It starts up a Shoes app window. This is the starting place for making a Shoes program. The parameters passed to it are the width and height of the window in pixels.Inside the block,we can fill the window with various Shoes elements.It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&amp;lt;ref&amp;gt;http://ruby.about.com/od/shoes/ss/shoes1_2.htm&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://shoesrb.com/manual/App.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&amp;lt;ref name=two /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries&amp;lt;ref&amp;gt;http://rubydoc.info/gems/shoes/frames&amp;lt;/ref&amp;gt;:&lt;br /&gt;
**	[http://en.wikipedia.org/wiki/Cairo_(graphics) Cairo ]– for device independent API using vector graphics&lt;br /&gt;
**	[http://en.wikipedia.org/wiki/Pango Pango] – for full-function rendering of text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
*Shoes is one of a kind,with its very own layout mechanisms “stack” and “flow”.&amp;lt;ref name=six &amp;gt;http://pragtob.wordpress.com/2013/07/17/shoes-4-a-progress-report/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.The default backend implementation uses JRuby + SWT, but there also is a proof of concept backend in Qt.&amp;lt;ref name=six /&amp;gt;&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to Shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&amp;lt;ref name=six /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&amp;lt;ref name=eight &amp;gt;http://www.fxruby.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&amp;lt;ref&amp;gt;https://code.google.com/p/fox-toolkit/&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&amp;lt;ref&amp;gt;http://rubydoc.info/github/larskanis/fxruby/1.6/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&amp;lt;ref name=one /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &amp;lt;ref&amp;gt;http://www.tutorialspoint.com/ruby/ruby_tk_guide.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk we can create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In this program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we call main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Qt_%28framework%29&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture.&amp;lt;ref&amp;gt;http://lists.qt.nokia.com/public/qt5-feedback/2011-October/001622.html&amp;lt;/ref&amp;gt; Qt5 brings significant improvements to the speed and ease of developing user interfaces.&amp;lt;ref&amp;gt;http://blog.qt.digia.com/blog/2011/05/09/thoughts-about-qt-5/&amp;lt;/ref&amp;gt; Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing.&amp;lt;ref name=seven &amp;gt;http://ruby.about.com/od/gui/a/wxwidgets.htm&amp;lt;/ref&amp;gt; There are several benefits of using WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator.&amp;lt;ref name=seven /&amp;gt;It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. the third parameter of the Wx::Frame constructor is the text to display in the title bar. The string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the task bar. After creating a widget, you must call show on it or it won't be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This simply creates an instance of MyApp, then calls the method main_loop on it which ends when you click the close button.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/GTK&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk trough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=78333</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=78333"/>
		<updated>2013-09-19T00:50:07Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver.&amp;lt;ref name=one &amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&amp;lt;/ref&amp;gt; Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&amp;lt;ref name=two&amp;gt;http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 300, :height =&amp;gt; 200 do&lt;br /&gt;
   para &amp;quot;Hello World!!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The Shoes.app method call encapsulates the entire Shoes application.It starts up a Shoes app window. This is the starting place for making a Shoes program. The parameters passed to it are the width and height of the window in pixels.Inside the block,we can fill the window with various Shoes elements.It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&amp;lt;ref&amp;gt;http://ruby.about.com/od/shoes/ss/shoes1_2.htm&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://shoesrb.com/manual/App.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&amp;lt;ref name=two /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries&amp;lt;ref&amp;gt;http://rubydoc.info/gems/shoes/frames&amp;lt;/ref&amp;gt;:&lt;br /&gt;
**	[http://en.wikipedia.org/wiki/Cairo_(graphics) Cairo ]– for device independent API using vector graphics&lt;br /&gt;
**	[http://en.wikipedia.org/wiki/Pango Pango] – for full-function rendering of text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
*Shoes is one of a kind,with its very own layout mechanisms “stack” and “flow”.&amp;lt;ref name=six &amp;gt;http://pragtob.wordpress.com/2013/07/17/shoes-4-a-progress-report/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.The default backend implementation uses JRuby + SWT, but there also is a proof of concept backend in Qt.&amp;lt;ref name=six /&amp;gt;&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to Shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&amp;lt;ref name=six /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&amp;lt;ref name=eight &amp;gt;http://www.fxruby.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&amp;lt;ref&amp;gt;https://code.google.com/p/fox-toolkit/&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&amp;lt;ref&amp;gt;http://rubydoc.info/github/larskanis/fxruby/1.6/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&amp;lt;ref&amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules/Tk&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &amp;lt;ref&amp;gt;http://www.tutorialspoint.com/ruby/ruby_tk_guide.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk we can create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In this program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we call main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Qt_%28framework%29&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture.&amp;lt;ref&amp;gt;http://lists.qt.nokia.com/public/qt5-feedback/2011-October/001622.html&amp;lt;/ref&amp;gt; Qt5 brings significant improvements to the speed and ease of developing user interfaces.&amp;lt;ref&amp;gt;http://blog.qt.digia.com/blog/2011/05/09/thoughts-about-qt-5/&amp;lt;/ref&amp;gt; Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing.&amp;lt;ref name=seven &amp;gt;http://ruby.about.com/od/gui/a/wxwidgets.htm&amp;lt;/ref&amp;gt; There are several benefits of using WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator.&amp;lt;ref name=seven /&amp;gt;It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. the third parameter of the Wx::Frame constructor is the text to display in the title bar. The string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the task bar. After creating a widget, you must call show on it or it won't be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This simply creates an instance of MyApp, then calls the method main_loop on it which ends when you click the close button.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/GTK&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk trough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=78332</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=78332"/>
		<updated>2013-09-19T00:49:43Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* ffi-tk */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver.&amp;lt;ref&amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&amp;lt;/ref&amp;gt; Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&amp;lt;ref name=two&amp;gt;http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 300, :height =&amp;gt; 200 do&lt;br /&gt;
   para &amp;quot;Hello World!!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The Shoes.app method call encapsulates the entire Shoes application.It starts up a Shoes app window. This is the starting place for making a Shoes program. The parameters passed to it are the width and height of the window in pixels.Inside the block,we can fill the window with various Shoes elements.It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&amp;lt;ref&amp;gt;http://ruby.about.com/od/shoes/ss/shoes1_2.htm&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://shoesrb.com/manual/App.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&amp;lt;ref name=two /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries&amp;lt;ref&amp;gt;http://rubydoc.info/gems/shoes/frames&amp;lt;/ref&amp;gt;:&lt;br /&gt;
**	[http://en.wikipedia.org/wiki/Cairo_(graphics) Cairo ]– for device independent API using vector graphics&lt;br /&gt;
**	[http://en.wikipedia.org/wiki/Pango Pango] – for full-function rendering of text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
*Shoes is one of a kind,with its very own layout mechanisms “stack” and “flow”.&amp;lt;ref name=six &amp;gt;http://pragtob.wordpress.com/2013/07/17/shoes-4-a-progress-report/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.The default backend implementation uses JRuby + SWT, but there also is a proof of concept backend in Qt.&amp;lt;ref name=six /&amp;gt;&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to Shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&amp;lt;ref name=six /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&amp;lt;ref name=eight &amp;gt;http://www.fxruby.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&amp;lt;ref&amp;gt;https://code.google.com/p/fox-toolkit/&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&amp;lt;ref&amp;gt;http://rubydoc.info/github/larskanis/fxruby/1.6/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&amp;lt;ref&amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules/Tk&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &amp;lt;ref&amp;gt;http://www.tutorialspoint.com/ruby/ruby_tk_guide.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk we can create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In this program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we call main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Qt_%28framework%29&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture.&amp;lt;ref&amp;gt;http://lists.qt.nokia.com/public/qt5-feedback/2011-October/001622.html&amp;lt;/ref&amp;gt; Qt5 brings significant improvements to the speed and ease of developing user interfaces.&amp;lt;ref&amp;gt;http://blog.qt.digia.com/blog/2011/05/09/thoughts-about-qt-5/&amp;lt;/ref&amp;gt; Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing.&amp;lt;ref name=seven &amp;gt;http://ruby.about.com/od/gui/a/wxwidgets.htm&amp;lt;/ref&amp;gt; There are several benefits of using WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator.&amp;lt;ref name=seven /&amp;gt;It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. the third parameter of the Wx::Frame constructor is the text to display in the title bar. The string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the task bar. After creating a widget, you must call show on it or it won't be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This simply creates an instance of MyApp, then calls the method main_loop on it which ends when you click the close button.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/GTK&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk trough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=78331</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=78331"/>
		<updated>2013-09-19T00:48:58Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* Shoes 4 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver.&amp;lt;ref&amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&amp;lt;/ref&amp;gt; Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&amp;lt;ref name=two&amp;gt;http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 300, :height =&amp;gt; 200 do&lt;br /&gt;
   para &amp;quot;Hello World!!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The Shoes.app method call encapsulates the entire Shoes application.It starts up a Shoes app window. This is the starting place for making a Shoes program. The parameters passed to it are the width and height of the window in pixels.Inside the block,we can fill the window with various Shoes elements.It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&amp;lt;ref&amp;gt;http://ruby.about.com/od/shoes/ss/shoes1_2.htm&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://shoesrb.com/manual/App.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&amp;lt;ref name=two /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries&amp;lt;ref&amp;gt;http://rubydoc.info/gems/shoes/frames&amp;lt;/ref&amp;gt;:&lt;br /&gt;
**	[http://en.wikipedia.org/wiki/Cairo_(graphics) Cairo ]– for device independent API using vector graphics&lt;br /&gt;
**	[http://en.wikipedia.org/wiki/Pango Pango] – for full-function rendering of text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
*Shoes is one of a kind,with its very own layout mechanisms “stack” and “flow”.&amp;lt;ref name=six &amp;gt;http://pragtob.wordpress.com/2013/07/17/shoes-4-a-progress-report/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.The default backend implementation uses JRuby + SWT, but there also is a proof of concept backend in Qt.&amp;lt;ref name=six /&amp;gt;&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to Shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&amp;lt;ref name=six /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&amp;lt;ref name=eight &amp;gt;http://www.fxruby.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&amp;lt;ref&amp;gt;https://code.google.com/p/fox-toolkit/&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&amp;lt;ref&amp;gt;http://rubydoc.info/github/larskanis/fxruby/1.6/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&amp;lt;ref&amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules/Tk&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &amp;lt;ref&amp;gt;http://www.tutorialspoint.com/ruby/ruby_tk_guide.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk we can create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In this program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we call main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Qt_%28framework%29&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture.&amp;lt;ref&amp;gt;http://lists.qt.nokia.com/public/qt5-feedback/2011-October/001622.html&amp;lt;/ref&amp;gt; Qt5 brings significant improvements to the speed and ease of developing user interfaces.&amp;lt;ref&amp;gt;http://blog.qt.digia.com/blog/2011/05/09/thoughts-about-qt-5/&amp;lt;/ref&amp;gt; Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing.&amp;lt;ref name=seven &amp;gt;http://ruby.about.com/od/gui/a/wxwidgets.htm&amp;lt;/ref&amp;gt; There are several benefits of using WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator.&amp;lt;ref name=seven /&amp;gt;It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. the third parameter of the Wx::Frame constructor is the text to display in the title bar. The string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the task bar. After creating a widget, you must call show on it or it won't be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This simply creates an instance of MyApp, then calls the method main_loop on it which ends when you click the close button.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/GTK&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk trough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=78330</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=78330"/>
		<updated>2013-09-19T00:47:45Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* GTK+ */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver.&amp;lt;ref&amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&amp;lt;/ref&amp;gt; Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&amp;lt;ref name=two&amp;gt;http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 300, :height =&amp;gt; 200 do&lt;br /&gt;
   para &amp;quot;Hello World!!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The Shoes.app method call encapsulates the entire Shoes application.It starts up a Shoes app window. This is the starting place for making a Shoes program. The parameters passed to it are the width and height of the window in pixels.Inside the block,we can fill the window with various Shoes elements.It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&amp;lt;ref&amp;gt;http://ruby.about.com/od/shoes/ss/shoes1_2.htm&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://shoesrb.com/manual/App.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&amp;lt;ref name=two /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries&amp;lt;ref&amp;gt;http://rubydoc.info/gems/shoes/frames&amp;lt;/ref&amp;gt;:&lt;br /&gt;
**	[http://en.wikipedia.org/wiki/Cairo_(graphics) Cairo ]– for device independent API using vector graphics&lt;br /&gt;
**	[http://en.wikipedia.org/wiki/Pango Pango] – for full-function rendering of text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
*Shoes is one of a kind,with its very own layout mechanisms “stack” and “flow”.&amp;lt;ref name=six &amp;gt;http://pragtob.wordpress.com/2013/07/17/shoes-4-a-progress-report/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.The default backend implementation uses JRuby + SWT, but there also is a proof of concept backend in Qt.&amp;lt;ref&amp;gt;http://pragtob.wordpress.com/2013/07/17/shoes-4-a-progress-report/&amp;lt;/ref&amp;gt;&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to Shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&amp;lt;ref name=six /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&amp;lt;ref name=eight &amp;gt;http://www.fxruby.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&amp;lt;ref&amp;gt;https://code.google.com/p/fox-toolkit/&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&amp;lt;ref&amp;gt;http://rubydoc.info/github/larskanis/fxruby/1.6/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&amp;lt;ref&amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules/Tk&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &amp;lt;ref&amp;gt;http://www.tutorialspoint.com/ruby/ruby_tk_guide.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk we can create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In this program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we call main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Qt_%28framework%29&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture.&amp;lt;ref&amp;gt;http://lists.qt.nokia.com/public/qt5-feedback/2011-October/001622.html&amp;lt;/ref&amp;gt; Qt5 brings significant improvements to the speed and ease of developing user interfaces.&amp;lt;ref&amp;gt;http://blog.qt.digia.com/blog/2011/05/09/thoughts-about-qt-5/&amp;lt;/ref&amp;gt; Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing.&amp;lt;ref name=seven &amp;gt;http://ruby.about.com/od/gui/a/wxwidgets.htm&amp;lt;/ref&amp;gt; There are several benefits of using WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator.&amp;lt;ref name=seven /&amp;gt;It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. the third parameter of the Wx::Frame constructor is the text to display in the title bar. The string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the task bar. After creating a widget, you must call show on it or it won't be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This simply creates an instance of MyApp, then calls the method main_loop on it which ends when you click the close button.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/GTK&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk trough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=78329</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=78329"/>
		<updated>2013-09-19T00:47:09Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* FxRuby */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver.&amp;lt;ref&amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&amp;lt;/ref&amp;gt; Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&amp;lt;ref name=two&amp;gt;http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 300, :height =&amp;gt; 200 do&lt;br /&gt;
   para &amp;quot;Hello World!!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The Shoes.app method call encapsulates the entire Shoes application.It starts up a Shoes app window. This is the starting place for making a Shoes program. The parameters passed to it are the width and height of the window in pixels.Inside the block,we can fill the window with various Shoes elements.It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&amp;lt;ref&amp;gt;http://ruby.about.com/od/shoes/ss/shoes1_2.htm&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://shoesrb.com/manual/App.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&amp;lt;ref name=two /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries&amp;lt;ref&amp;gt;http://rubydoc.info/gems/shoes/frames&amp;lt;/ref&amp;gt;:&lt;br /&gt;
**	[http://en.wikipedia.org/wiki/Cairo_(graphics) Cairo ]– for device independent API using vector graphics&lt;br /&gt;
**	[http://en.wikipedia.org/wiki/Pango Pango] – for full-function rendering of text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
*Shoes is one of a kind,with its very own layout mechanisms “stack” and “flow”.&amp;lt;ref name=six &amp;gt;http://pragtob.wordpress.com/2013/07/17/shoes-4-a-progress-report/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.The default backend implementation uses JRuby + SWT, but there also is a proof of concept backend in Qt.&amp;lt;ref&amp;gt;http://pragtob.wordpress.com/2013/07/17/shoes-4-a-progress-report/&amp;lt;/ref&amp;gt;&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to Shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&amp;lt;ref name=six /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&amp;lt;ref name=eight &amp;gt;http://www.fxruby.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&amp;lt;ref&amp;gt;https://code.google.com/p/fox-toolkit/&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&amp;lt;ref&amp;gt;http://rubydoc.info/github/larskanis/fxruby/1.6/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&amp;lt;ref&amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules/Tk&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &amp;lt;ref&amp;gt;http://www.tutorialspoint.com/ruby/ruby_tk_guide.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk we can create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In this program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we call main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Qt_%28framework%29&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture.&amp;lt;ref&amp;gt;http://lists.qt.nokia.com/public/qt5-feedback/2011-October/001622.html&amp;lt;/ref&amp;gt; Qt5 brings significant improvements to the speed and ease of developing user interfaces.&amp;lt;ref&amp;gt;http://blog.qt.digia.com/blog/2011/05/09/thoughts-about-qt-5/&amp;lt;/ref&amp;gt; Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing.&amp;lt;ref name=seven &amp;gt;http://ruby.about.com/od/gui/a/wxwidgets.htm&amp;lt;/ref&amp;gt; There are several benefits of using WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator.&amp;lt;ref name=seven /&amp;gt;It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. the third parameter of the Wx::Frame constructor is the text to display in the title bar. The string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the task bar. After creating a widget, you must call show on it or it won't be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This simply creates an instance of MyApp, then calls the method main_loop on it which ends when you click the close button.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/GTK&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;ref&amp;gt;http://ruby-gnome.sourceforge.net/programming/hello.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk trough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=78328</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=78328"/>
		<updated>2013-09-19T00:46:39Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* FxRuby */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver.&amp;lt;ref&amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&amp;lt;/ref&amp;gt; Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&amp;lt;ref name=two&amp;gt;http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 300, :height =&amp;gt; 200 do&lt;br /&gt;
   para &amp;quot;Hello World!!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The Shoes.app method call encapsulates the entire Shoes application.It starts up a Shoes app window. This is the starting place for making a Shoes program. The parameters passed to it are the width and height of the window in pixels.Inside the block,we can fill the window with various Shoes elements.It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&amp;lt;ref&amp;gt;http://ruby.about.com/od/shoes/ss/shoes1_2.htm&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://shoesrb.com/manual/App.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&amp;lt;ref name=two /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries&amp;lt;ref&amp;gt;http://rubydoc.info/gems/shoes/frames&amp;lt;/ref&amp;gt;:&lt;br /&gt;
**	[http://en.wikipedia.org/wiki/Cairo_(graphics) Cairo ]– for device independent API using vector graphics&lt;br /&gt;
**	[http://en.wikipedia.org/wiki/Pango Pango] – for full-function rendering of text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
*Shoes is one of a kind,with its very own layout mechanisms “stack” and “flow”.&amp;lt;ref name=six &amp;gt;http://pragtob.wordpress.com/2013/07/17/shoes-4-a-progress-report/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.The default backend implementation uses JRuby + SWT, but there also is a proof of concept backend in Qt.&amp;lt;ref&amp;gt;http://pragtob.wordpress.com/2013/07/17/shoes-4-a-progress-report/&amp;lt;/ref&amp;gt;&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to Shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&amp;lt;ref name=six /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&amp;lt;ref = eight &amp;gt;http://www.fxruby.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&amp;lt;ref&amp;gt;https://code.google.com/p/fox-toolkit/&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&amp;lt;ref&amp;gt;http://rubydoc.info/github/larskanis/fxruby/1.6/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&amp;lt;ref&amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules/Tk&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &amp;lt;ref&amp;gt;http://www.tutorialspoint.com/ruby/ruby_tk_guide.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk we can create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In this program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we call main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Qt_%28framework%29&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture.&amp;lt;ref&amp;gt;http://lists.qt.nokia.com/public/qt5-feedback/2011-October/001622.html&amp;lt;/ref&amp;gt; Qt5 brings significant improvements to the speed and ease of developing user interfaces.&amp;lt;ref&amp;gt;http://blog.qt.digia.com/blog/2011/05/09/thoughts-about-qt-5/&amp;lt;/ref&amp;gt; Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing.&amp;lt;ref name=seven &amp;gt;http://ruby.about.com/od/gui/a/wxwidgets.htm&amp;lt;/ref&amp;gt; There are several benefits of using WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator.&amp;lt;ref name=seven /&amp;gt;It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. the third parameter of the Wx::Frame constructor is the text to display in the title bar. The string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the task bar. After creating a widget, you must call show on it or it won't be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This simply creates an instance of MyApp, then calls the method main_loop on it which ends when you click the close button.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/GTK&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;ref&amp;gt;http://ruby-gnome.sourceforge.net/programming/hello.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk trough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=78327</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=78327"/>
		<updated>2013-09-19T00:44:47Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* wxRuby */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver.&amp;lt;ref&amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&amp;lt;/ref&amp;gt; Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&amp;lt;ref name=two&amp;gt;http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 300, :height =&amp;gt; 200 do&lt;br /&gt;
   para &amp;quot;Hello World!!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The Shoes.app method call encapsulates the entire Shoes application.It starts up a Shoes app window. This is the starting place for making a Shoes program. The parameters passed to it are the width and height of the window in pixels.Inside the block,we can fill the window with various Shoes elements.It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&amp;lt;ref&amp;gt;http://ruby.about.com/od/shoes/ss/shoes1_2.htm&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://shoesrb.com/manual/App.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&amp;lt;ref name=two /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries&amp;lt;ref&amp;gt;http://rubydoc.info/gems/shoes/frames&amp;lt;/ref&amp;gt;:&lt;br /&gt;
**	[http://en.wikipedia.org/wiki/Cairo_(graphics) Cairo ]– for device independent API using vector graphics&lt;br /&gt;
**	[http://en.wikipedia.org/wiki/Pango Pango] – for full-function rendering of text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
*Shoes is one of a kind,with its very own layout mechanisms “stack” and “flow”.&amp;lt;ref name=six &amp;gt;http://pragtob.wordpress.com/2013/07/17/shoes-4-a-progress-report/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.The default backend implementation uses JRuby + SWT, but there also is a proof of concept backend in Qt.&amp;lt;ref&amp;gt;http://pragtob.wordpress.com/2013/07/17/shoes-4-a-progress-report/&amp;lt;/ref&amp;gt;&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to Shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&amp;lt;ref name=six /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&amp;lt;ref&amp;gt;http://www.fxruby.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&amp;lt;ref&amp;gt;https://code.google.com/p/fox-toolkit/&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;ref&amp;gt;http://www.fxruby.org/doc/tutorial1.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&amp;lt;ref&amp;gt;http://rubydoc.info/github/larskanis/fxruby/1.6/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&amp;lt;ref&amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules/Tk&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &amp;lt;ref&amp;gt;http://www.tutorialspoint.com/ruby/ruby_tk_guide.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk we can create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In this program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we call main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Qt_%28framework%29&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture.&amp;lt;ref&amp;gt;http://lists.qt.nokia.com/public/qt5-feedback/2011-October/001622.html&amp;lt;/ref&amp;gt; Qt5 brings significant improvements to the speed and ease of developing user interfaces.&amp;lt;ref&amp;gt;http://blog.qt.digia.com/blog/2011/05/09/thoughts-about-qt-5/&amp;lt;/ref&amp;gt; Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing.&amp;lt;ref name=seven &amp;gt;http://ruby.about.com/od/gui/a/wxwidgets.htm&amp;lt;/ref&amp;gt; There are several benefits of using WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator.&amp;lt;ref name=seven /&amp;gt;It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. the third parameter of the Wx::Frame constructor is the text to display in the title bar. The string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the task bar. After creating a widget, you must call show on it or it won't be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This simply creates an instance of MyApp, then calls the method main_loop on it which ends when you click the close button.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/GTK&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;ref&amp;gt;http://ruby-gnome.sourceforge.net/programming/hello.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk trough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=78326</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=78326"/>
		<updated>2013-09-19T00:42:58Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* Shoes 4 */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver.&amp;lt;ref&amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&amp;lt;/ref&amp;gt; Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&amp;lt;ref name=two&amp;gt;http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 300, :height =&amp;gt; 200 do&lt;br /&gt;
   para &amp;quot;Hello World!!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The Shoes.app method call encapsulates the entire Shoes application.It starts up a Shoes app window. This is the starting place for making a Shoes program. The parameters passed to it are the width and height of the window in pixels.Inside the block,we can fill the window with various Shoes elements.It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&amp;lt;ref&amp;gt;http://ruby.about.com/od/shoes/ss/shoes1_2.htm&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://shoesrb.com/manual/App.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&amp;lt;ref name=two /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries&amp;lt;ref&amp;gt;http://rubydoc.info/gems/shoes/frames&amp;lt;/ref&amp;gt;:&lt;br /&gt;
**	[http://en.wikipedia.org/wiki/Cairo_(graphics) Cairo ]– for device independent API using vector graphics&lt;br /&gt;
**	[http://en.wikipedia.org/wiki/Pango Pango] – for full-function rendering of text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
*Shoes is one of a kind,with its very own layout mechanisms “stack” and “flow”.&amp;lt;ref name=six &amp;gt;http://pragtob.wordpress.com/2013/07/17/shoes-4-a-progress-report/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.The default backend implementation uses JRuby + SWT, but there also is a proof of concept backend in Qt.&amp;lt;ref&amp;gt;http://pragtob.wordpress.com/2013/07/17/shoes-4-a-progress-report/&amp;lt;/ref&amp;gt;&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to Shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&amp;lt;ref name=six /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&amp;lt;ref&amp;gt;http://www.fxruby.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&amp;lt;ref&amp;gt;https://code.google.com/p/fox-toolkit/&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;ref&amp;gt;http://www.fxruby.org/doc/tutorial1.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&amp;lt;ref&amp;gt;http://rubydoc.info/github/larskanis/fxruby/1.6/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&amp;lt;ref&amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules/Tk&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &amp;lt;ref&amp;gt;http://www.tutorialspoint.com/ruby/ruby_tk_guide.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk we can create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In this program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we call main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Qt_%28framework%29&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture.&amp;lt;ref&amp;gt;http://lists.qt.nokia.com/public/qt5-feedback/2011-October/001622.html&amp;lt;/ref&amp;gt; Qt5 brings significant improvements to the speed and ease of developing user interfaces.&amp;lt;ref&amp;gt;http://blog.qt.digia.com/blog/2011/05/09/thoughts-about-qt-5/&amp;lt;/ref&amp;gt; Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing.&amp;lt;ref&amp;gt;http://ruby.about.com/od/gui/a/wxwidgets.htm&amp;lt;/ref&amp;gt; There are several benefits of using WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator.&amp;lt;ref&amp;gt;http://ruby.about.com/od/gui/a/wxwidgets.htm&amp;lt;/ref&amp;gt; It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. the third parameter of the Wx::Frame constructor is the text to display in the title bar. The string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the task bar. After creating a widget, you must call show on it or it won't be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This simply creates an instance of MyApp, then calls the method main_loop on it which ends when you click the close button.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/GTK&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;ref&amp;gt;http://ruby-gnome.sourceforge.net/programming/hello.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk trough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=78325</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=78325"/>
		<updated>2013-09-19T00:42:04Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* Cool Features */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver.&amp;lt;ref&amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&amp;lt;/ref&amp;gt; Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&amp;lt;ref name=two&amp;gt;http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 300, :height =&amp;gt; 200 do&lt;br /&gt;
   para &amp;quot;Hello World!!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The Shoes.app method call encapsulates the entire Shoes application.It starts up a Shoes app window. This is the starting place for making a Shoes program. The parameters passed to it are the width and height of the window in pixels.Inside the block,we can fill the window with various Shoes elements.It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&amp;lt;ref&amp;gt;http://ruby.about.com/od/shoes/ss/shoes1_2.htm&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://shoesrb.com/manual/App.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&amp;lt;ref name=two /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries&amp;lt;ref&amp;gt;http://rubydoc.info/gems/shoes/frames&amp;lt;/ref&amp;gt;:&lt;br /&gt;
**	[http://en.wikipedia.org/wiki/Cairo_(graphics) Cairo ]– for device independent API using vector graphics&lt;br /&gt;
**	[http://en.wikipedia.org/wiki/Pango Pango] – for full-function rendering of text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
*Shoes is one of a kind,with its very own layout mechanisms “stack” and “flow”.&amp;lt;ref name=six &amp;gt;http://pragtob.wordpress.com/2013/07/17/shoes-4-a-progress-report/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.The default backend implementation uses JRuby + SWT, but there also is a proof of concept backend in Qt.&amp;lt;ref&amp;gt;http://pragtob.wordpress.com/2013/07/17/shoes-4-a-progress-report/&amp;lt;/ref&amp;gt;&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to Shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&amp;lt;ref&amp;gt;https://github.com/shoes/shoes&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&amp;lt;ref&amp;gt;http://www.fxruby.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&amp;lt;ref&amp;gt;https://code.google.com/p/fox-toolkit/&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;ref&amp;gt;http://www.fxruby.org/doc/tutorial1.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&amp;lt;ref&amp;gt;http://rubydoc.info/github/larskanis/fxruby/1.6/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&amp;lt;ref&amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules/Tk&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &amp;lt;ref&amp;gt;http://www.tutorialspoint.com/ruby/ruby_tk_guide.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk we can create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In this program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we call main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Qt_%28framework%29&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture.&amp;lt;ref&amp;gt;http://lists.qt.nokia.com/public/qt5-feedback/2011-October/001622.html&amp;lt;/ref&amp;gt; Qt5 brings significant improvements to the speed and ease of developing user interfaces.&amp;lt;ref&amp;gt;http://blog.qt.digia.com/blog/2011/05/09/thoughts-about-qt-5/&amp;lt;/ref&amp;gt; Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing.&amp;lt;ref&amp;gt;http://ruby.about.com/od/gui/a/wxwidgets.htm&amp;lt;/ref&amp;gt; There are several benefits of using WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator.&amp;lt;ref&amp;gt;http://ruby.about.com/od/gui/a/wxwidgets.htm&amp;lt;/ref&amp;gt; It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. the third parameter of the Wx::Frame constructor is the text to display in the title bar. The string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the task bar. After creating a widget, you must call show on it or it won't be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This simply creates an instance of MyApp, then calls the method main_loop on it which ends when you click the close button.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/GTK&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;ref&amp;gt;http://ruby-gnome.sourceforge.net/programming/hello.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk trough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=78324</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=78324"/>
		<updated>2013-09-19T00:41:09Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* Versions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver.&amp;lt;ref&amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&amp;lt;/ref&amp;gt; Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&amp;lt;ref name=two&amp;gt;http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 300, :height =&amp;gt; 200 do&lt;br /&gt;
   para &amp;quot;Hello World!!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The Shoes.app method call encapsulates the entire Shoes application.It starts up a Shoes app window. This is the starting place for making a Shoes program. The parameters passed to it are the width and height of the window in pixels.Inside the block,we can fill the window with various Shoes elements.It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&amp;lt;ref&amp;gt;http://ruby.about.com/od/shoes/ss/shoes1_2.htm&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://shoesrb.com/manual/App.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&amp;lt;ref name=two /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries&amp;lt;ref&amp;gt;http://rubydoc.info/gems/shoes/frames&amp;lt;/ref&amp;gt;:&lt;br /&gt;
**	[http://en.wikipedia.org/wiki/Cairo_(graphics) Cairo ]– for device independent API using vector graphics&lt;br /&gt;
**	[http://en.wikipedia.org/wiki/Pango Pango] – for full-function rendering of text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
*Shoes is one of a kind,with its very own layout mechanisms “stack” and “flow”.&amp;lt;ref&amp;gt;http://pragtob.wordpress.com/2013/07/17/shoes-4-a-progress-report/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.The default backend implementation uses JRuby + SWT, but there also is a proof of concept backend in Qt.&amp;lt;ref&amp;gt;http://pragtob.wordpress.com/2013/07/17/shoes-4-a-progress-report/&amp;lt;/ref&amp;gt;&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to Shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&amp;lt;ref&amp;gt;https://github.com/shoes/shoes&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&amp;lt;ref&amp;gt;http://www.fxruby.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&amp;lt;ref&amp;gt;https://code.google.com/p/fox-toolkit/&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;ref&amp;gt;http://www.fxruby.org/doc/tutorial1.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&amp;lt;ref&amp;gt;http://rubydoc.info/github/larskanis/fxruby/1.6/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&amp;lt;ref&amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules/Tk&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &amp;lt;ref&amp;gt;http://www.tutorialspoint.com/ruby/ruby_tk_guide.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk we can create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In this program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we call main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Qt_%28framework%29&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture.&amp;lt;ref&amp;gt;http://lists.qt.nokia.com/public/qt5-feedback/2011-October/001622.html&amp;lt;/ref&amp;gt; Qt5 brings significant improvements to the speed and ease of developing user interfaces.&amp;lt;ref&amp;gt;http://blog.qt.digia.com/blog/2011/05/09/thoughts-about-qt-5/&amp;lt;/ref&amp;gt; Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing.&amp;lt;ref&amp;gt;http://ruby.about.com/od/gui/a/wxwidgets.htm&amp;lt;/ref&amp;gt; There are several benefits of using WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator.&amp;lt;ref&amp;gt;http://ruby.about.com/od/gui/a/wxwidgets.htm&amp;lt;/ref&amp;gt; It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. the third parameter of the Wx::Frame constructor is the text to display in the title bar. The string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the task bar. After creating a widget, you must call show on it or it won't be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This simply creates an instance of MyApp, then calls the method main_loop on it which ends when you click the close button.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/GTK&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;ref&amp;gt;http://ruby-gnome.sourceforge.net/programming/hello.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk trough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=78323</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=78323"/>
		<updated>2013-09-19T00:40:17Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* Shoes */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver.&amp;lt;ref&amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&amp;lt;/ref&amp;gt; Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&amp;lt;ref name=two&amp;gt;http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 300, :height =&amp;gt; 200 do&lt;br /&gt;
   para &amp;quot;Hello World!!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The Shoes.app method call encapsulates the entire Shoes application.It starts up a Shoes app window. This is the starting place for making a Shoes program. The parameters passed to it are the width and height of the window in pixels.Inside the block,we can fill the window with various Shoes elements.It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&amp;lt;ref&amp;gt;http://ruby.about.com/od/shoes/ss/shoes1_2.htm&amp;lt;/ref&amp;gt;&amp;lt;ref&amp;gt;http://shoesrb.com/manual/App.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries&amp;lt;ref&amp;gt;http://rubydoc.info/gems/shoes/frames&amp;lt;/ref&amp;gt;:&lt;br /&gt;
**	[http://en.wikipedia.org/wiki/Cairo_(graphics) Cairo ]– for device independent API using vector graphics&lt;br /&gt;
**	[http://en.wikipedia.org/wiki/Pango Pango] – for full-function rendering of text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
*Shoes is one of a kind,with its very own layout mechanisms “stack” and “flow”.&amp;lt;ref&amp;gt;http://pragtob.wordpress.com/2013/07/17/shoes-4-a-progress-report/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.The default backend implementation uses JRuby + SWT, but there also is a proof of concept backend in Qt.&amp;lt;ref&amp;gt;http://pragtob.wordpress.com/2013/07/17/shoes-4-a-progress-report/&amp;lt;/ref&amp;gt;&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to Shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&amp;lt;ref&amp;gt;https://github.com/shoes/shoes&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&amp;lt;ref&amp;gt;http://www.fxruby.org/&amp;lt;/ref&amp;gt;&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&amp;lt;ref&amp;gt;https://code.google.com/p/fox-toolkit/&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&amp;lt;ref&amp;gt;http://www.fxruby.org/doc/tutorial1.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&amp;lt;ref&amp;gt;http://rubydoc.info/github/larskanis/fxruby/1.6/&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&amp;lt;ref&amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules/Tk&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &amp;lt;ref&amp;gt;http://www.tutorialspoint.com/ruby/ruby_tk_guide.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk we can create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In this program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we call main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Qt_%28framework%29&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture.&amp;lt;ref&amp;gt;http://lists.qt.nokia.com/public/qt5-feedback/2011-October/001622.html&amp;lt;/ref&amp;gt; Qt5 brings significant improvements to the speed and ease of developing user interfaces.&amp;lt;ref&amp;gt;http://blog.qt.digia.com/blog/2011/05/09/thoughts-about-qt-5/&amp;lt;/ref&amp;gt; Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing.&amp;lt;ref&amp;gt;http://ruby.about.com/od/gui/a/wxwidgets.htm&amp;lt;/ref&amp;gt; There are several benefits of using WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator.&amp;lt;ref&amp;gt;http://ruby.about.com/od/gui/a/wxwidgets.htm&amp;lt;/ref&amp;gt; It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. the third parameter of the Wx::Frame constructor is the text to display in the title bar. The string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the task bar. After creating a widget, you must call show on it or it won't be shown.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This simply creates an instance of MyApp, then calls the method main_loop on it which ends when you click the close button.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/GTK&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&amp;lt;ref&amp;gt;http://ruby-gnome.sourceforge.net/programming/hello.html&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk trough&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77938</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77938"/>
		<updated>2013-09-18T17:26:24Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* ffi-tk */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver.&amp;lt;ref&amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&amp;lt;/ref&amp;gt; Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 200, :height =&amp;gt; 140 do&lt;br /&gt;
   para &amp;quot;Hello World!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: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. It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries:&lt;br /&gt;
**	Cairo – for drawing&lt;br /&gt;
**	Pango – for text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
==Advantages==&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&amp;lt;ref&amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules/Tk&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &amp;lt;ref&amp;gt;http://www.tutorialspoint.com/ruby/ruby_tk_guide.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk we can create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In this program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we call main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Qt_%28framework%29&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture.&amp;lt;ref&amp;gt;http://lists.qt.nokia.com/public/qt5-feedback/2011-October/001622.html&amp;lt;/ref&amp;gt; Qt5 brings significant improvements to the speed and ease of developing user interfaces.&amp;lt;ref&amp;gt;http://blog.qt.digia.com/blog/2011/05/09/thoughts-about-qt-5/&amp;lt;/ref&amp;gt; Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing.&amp;lt;ref&amp;gt;http://ruby.about.com/od/gui/a/wxwidgets.htm&amp;lt;/ref&amp;gt; There are several benefits of using WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator.&amp;lt;ref&amp;gt;http://ruby.about.com/od/gui/a/wxwidgets.htm&amp;lt;/ref&amp;gt; It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. the third parameter of the Wx::Frame constructor is the text to display in the title bar. The string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the task bar. After creating a widget, you must call show on it or it won't be shown.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This simply creates an instance of MyApp, then calls the method main_loop on it which ends when you click the close button.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walktrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77936</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77936"/>
		<updated>2013-09-18T17:22:48Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* wxRuby */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver.&amp;lt;ref&amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&amp;lt;/ref&amp;gt; Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 200, :height =&amp;gt; 140 do&lt;br /&gt;
   para &amp;quot;Hello World!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: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. It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries:&lt;br /&gt;
**	Cairo – for drawing&lt;br /&gt;
**	Pango – for text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
==Advantages==&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&amp;lt;ref&amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules/Tk&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &amp;lt;ref&amp;gt;http://www.tutorialspoint.com/ruby/ruby_tk_guide.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk you create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In our program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we pack the root frame and enter the main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Qt_%28framework%29&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture.&amp;lt;ref&amp;gt;http://lists.qt.nokia.com/public/qt5-feedback/2011-October/001622.html&amp;lt;/ref&amp;gt; Qt5 brings significant improvements to the speed and ease of developing user interfaces.&amp;lt;ref&amp;gt;http://blog.qt.digia.com/blog/2011/05/09/thoughts-about-qt-5/&amp;lt;/ref&amp;gt; Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing.&amp;lt;ref&amp;gt;http://ruby.about.com/od/gui/a/wxwidgets.htm&amp;lt;/ref&amp;gt; There are several benefits of using WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator.&amp;lt;ref&amp;gt;http://ruby.about.com/od/gui/a/wxwidgets.htm&amp;lt;/ref&amp;gt; It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. the third parameter of the Wx::Frame constructor is the text to display in the title bar. The string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the task bar. After creating a widget, you must call show on it or it won't be shown.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This simply creates an instance of MyApp, then calls the method main_loop on it which ends when you click the close button.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walktrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77934</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77934"/>
		<updated>2013-09-18T17:21:55Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* wxRuby */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver.&amp;lt;ref&amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&amp;lt;/ref&amp;gt; Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&amp;lt;ref&amp;gt;[http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)]&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 200, :height =&amp;gt; 140 do&lt;br /&gt;
   para &amp;quot;Hello World!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: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. It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries:&lt;br /&gt;
**	Cairo – for drawing&lt;br /&gt;
**	Pango – for text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
==Advantages==&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&amp;lt;ref&amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules/Tk&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &amp;lt;ref&amp;gt;http://www.tutorialspoint.com/ruby/ruby_tk_guide.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk you create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In our program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we pack the root frame and enter the main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Qt_%28framework%29&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture.&amp;lt;ref&amp;gt;http://lists.qt.nokia.com/public/qt5-feedback/2011-October/001622.html&amp;lt;/ref&amp;gt; Qt5 brings significant improvements to the speed and ease of developing user interfaces.&amp;lt;ref&amp;gt;http://blog.qt.digia.com/blog/2011/05/09/thoughts-about-qt-5/&amp;lt;/ref&amp;gt; Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing.&amp;lt;ref&amp;gt;http://ruby.about.com/od/gui/a/wxwidgets.htm&amp;lt;/ref&amp;gt; There are several benefits of using WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator.&amp;lt;ref&amp;gt;http://ruby.about.com/od/gui/a/wxwidgets.htm&amp;lt;/ref&amp;gt; It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. the third parameter of the Wx::Frame constructor is the text to display in the title :bar. The string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the task bar. After creating a widget, you must call show on it or it won't be shown.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This simply creates an instance of MyApp, then calls the method main_loop on it which ends when you click the close button.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walktrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77930</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77930"/>
		<updated>2013-09-18T17:19:18Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* wxRuby */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver.&amp;lt;ref&amp;gt;[http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules]&amp;lt;/ref&amp;gt; Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&amp;lt;ref&amp;gt;[http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)]&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 200, :height =&amp;gt; 140 do&lt;br /&gt;
   para &amp;quot;Hello World!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: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. It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries:&lt;br /&gt;
**	Cairo – for drawing&lt;br /&gt;
**	Pango – for text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
==Advantages==&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&amp;lt;ref&amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules/Tk&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &amp;lt;ref&amp;gt;http://www.tutorialspoint.com/ruby/ruby_tk_guide.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk you create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In our program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we pack the root frame and enter the main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Qt_%28framework%29&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture.&amp;lt;ref&amp;gt;http://lists.qt.nokia.com/public/qt5-feedback/2011-October/001622.html&amp;lt;/ref&amp;gt; Qt5 brings significant improvements to the speed and ease of developing user interfaces.&amp;lt;ref&amp;gt;http://blog.qt.digia.com/blog/2011/05/09/thoughts-about-qt-5/&amp;lt;/ref&amp;gt; Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing.&amp;lt;ref&amp;gt;http://ruby.about.com/od/gui/a/wxwidgets.htm&amp;lt;/ref&amp;gt; There are several benefits of using WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator.&amp;lt;ref&amp;gt;http://ruby.about.com/od/gui/a/wxwidgets.htm&amp;lt;/ref&amp;gt; It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. the third parameter of the Wx::Frame constructor is the text to display in the title :bar. The string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the task bar.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, after creating a widget, you must call show on it or it won't be shown. Though you may want to wait to do this for some things (such as popup windows), since this is a simple single-widget application, doing this in the on_init :method is appropriate.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walktrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77926</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77926"/>
		<updated>2013-09-18T17:18:16Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* wxRuby */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver.&amp;lt;ref&amp;gt;[http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules]&amp;lt;/ref&amp;gt; Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&amp;lt;ref&amp;gt;[http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)]&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 200, :height =&amp;gt; 140 do&lt;br /&gt;
   para &amp;quot;Hello World!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: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. It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries:&lt;br /&gt;
**	Cairo – for drawing&lt;br /&gt;
**	Pango – for text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
==Advantages==&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&amp;lt;ref&amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules/Tk&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &amp;lt;ref&amp;gt;http://www.tutorialspoint.com/ruby/ruby_tk_guide.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk you create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In our program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we pack the root frame and enter the main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Qt_%28framework%29&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture.&amp;lt;ref&amp;gt;http://lists.qt.nokia.com/public/qt5-feedback/2011-October/001622.html&amp;lt;/ref&amp;gt; Qt5 brings significant improvements to the speed and ease of developing user interfaces.&amp;lt;ref&amp;gt;http://blog.qt.digia.com/blog/2011/05/09/thoughts-about-qt-5/&amp;lt;/ref&amp;gt; Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing.&amp;lt;ref&amp;gt;http://ruby.about.com/od/gui/a/wxwidgets.htm&amp;lt;/ref&amp;gt; There are several benefits of using WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator.&amp;lt;ref&amp;gt;http://ruby.about.com/od/gui/a/wxwidgets.htm&amp;lt;/ref&amp;gt; It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. the third parameter of the Wx::Frame constructor is the text to display in the title :bar. The string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the task bar.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, after creating a widget, you must call show on it or it won't be shown. Though you may want to wait to do this :for some things (such as popup windows), since this is a simple single-widget application, doing this in the on_init :method is appropriate.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walktrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77924</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77924"/>
		<updated>2013-09-18T17:17:42Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* wxRuby */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver.&amp;lt;ref&amp;gt;[http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules]&amp;lt;/ref&amp;gt; Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&amp;lt;ref&amp;gt;[http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)]&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 200, :height =&amp;gt; 140 do&lt;br /&gt;
   para &amp;quot;Hello World!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: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. It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries:&lt;br /&gt;
**	Cairo – for drawing&lt;br /&gt;
**	Pango – for text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
==Advantages==&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&amp;lt;ref&amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules/Tk&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &amp;lt;ref&amp;gt;http://www.tutorialspoint.com/ruby/ruby_tk_guide.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk you create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In our program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we pack the root frame and enter the main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Qt_%28framework%29&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture.&amp;lt;ref&amp;gt;http://lists.qt.nokia.com/public/qt5-feedback/2011-October/001622.html&amp;lt;/ref&amp;gt; Qt5 brings significant improvements to the speed and ease of developing user interfaces.&amp;lt;ref&amp;gt;http://blog.qt.digia.com/blog/2011/05/09/thoughts-about-qt-5/&amp;lt;/ref&amp;gt; Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing.&amp;lt;ref&amp;gt;http://ruby.about.com/od/gui/a/wxwidgets.htm&amp;lt;/ref&amp;gt; There are several benefits of using WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator.&amp;lt;ref&amp;gt;http://ruby.about.com/od/gui/a/wxwidgets.htm&amp;lt;/ref&amp;gt; It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. &lt;br /&gt;
 the third parameter of the Wx::Frame constructor is the text to display in the title :bar. The string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the task bar.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, after creating a widget, you must call show on it or it won't be shown. Though you may want to wait to do this :for some things (such as popup windows), since this is a simple single-widget application, doing this in the on_init :method is appropriate.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walktrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77918</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77918"/>
		<updated>2013-09-18T17:15:43Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* wxRuby */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver.&amp;lt;ref&amp;gt;[http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules]&amp;lt;/ref&amp;gt; Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&amp;lt;ref&amp;gt;[http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)]&amp;lt;/ref&amp;gt;&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 200, :height =&amp;gt; 140 do&lt;br /&gt;
   para &amp;quot;Hello World!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: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. It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries:&lt;br /&gt;
**	Cairo – for drawing&lt;br /&gt;
**	Pango – for text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
==Advantages==&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&amp;lt;ref&amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules/Tk&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &amp;lt;ref&amp;gt;http://www.tutorialspoint.com/ruby/ruby_tk_guide.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk you create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In our program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we pack the root frame and enter the main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Qt_%28framework%29&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture.&amp;lt;ref&amp;gt;http://lists.qt.nokia.com/public/qt5-feedback/2011-October/001622.html&amp;lt;/ref&amp;gt; Qt5 brings significant improvements to the speed and ease of developing user interfaces.&amp;lt;ref&amp;gt;http://blog.qt.digia.com/blog/2011/05/09/thoughts-about-qt-5/&amp;lt;/ref&amp;gt; Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing.&amp;lt;ref&amp;gt;http://ruby.about.com/od/gui/a/wxwidgets.htm&amp;lt;/ref&amp;gt; There are several benefits of using WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator.&amp;lt;ref&amp;gt;http://ruby.about.com/od/gui/a/wxwidgets.htm&amp;lt;/ref&amp;gt; It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. Though since :we're not putting any other widgets in it, we're simply using it to display an empty window.&lt;br /&gt;
:the third parameter of the Wx::Frame constructor (not necessarily all constructors) is the text to display in the title :bar. Our rather non-descriptive string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the :task bar.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, after creating a widget, you must call show on it or it won't be shown. Though you may want to wait to do this :for some things (such as popup windows), since this is a simple single-widget application, doing this in the on_init :method is appropriate.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walktrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77909</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77909"/>
		<updated>2013-09-18T17:12:16Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* QtRuby */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver.&amp;lt;ref&amp;gt;[http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules GUI Toolkit Modules]&amp;lt;/ref&amp;gt; Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 200, :height =&amp;gt; 140 do&lt;br /&gt;
   para &amp;quot;Hello World!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: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. It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries:&lt;br /&gt;
**	Cairo – for drawing&lt;br /&gt;
**	Pango – for text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
==Advantages==&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&amp;lt;ref&amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules/Tk&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &amp;lt;ref&amp;gt;http://www.tutorialspoint.com/ruby/ruby_tk_guide.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk you create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In our program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we pack the root frame and enter the main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Qt_%28framework%29&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture.&amp;lt;ref&amp;gt;http://lists.qt.nokia.com/public/qt5-feedback/2011-October/001622.html&amp;lt;/ref&amp;gt; Qt5 brings significant improvements to the speed and ease of developing user interfaces.&amp;lt;ref&amp;gt;http://blog.qt.digia.com/blog/2011/05/09/thoughts-about-qt-5/&amp;lt;/ref&amp;gt; Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing. So what is the benefit of a GUI toolkit that needs yet another GUI toolkit to run? There are several.&lt;br /&gt;
Benefits of WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator. It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. Though since :we're not putting any other widgets in it, we're simply using it to display an empty window.&lt;br /&gt;
:the third parameter of the Wx::Frame constructor (not necessarily all constructors) is the text to display in the title :bar. Our rather non-descriptive string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the :task bar.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, after creating a widget, you must call show on it or it won't be shown. Though you may want to wait to do this :for some things (such as popup windows), since this is a simple single-widget application, doing this in the on_init :method is appropriate.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walktrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77904</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77904"/>
		<updated>2013-09-18T17:10:23Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* QtRuby */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver.&amp;lt;ref&amp;gt;[http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules GUI Toolkit Modules]&amp;lt;/ref&amp;gt; Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 200, :height =&amp;gt; 140 do&lt;br /&gt;
   para &amp;quot;Hello World!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: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. It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries:&lt;br /&gt;
**	Cairo – for drawing&lt;br /&gt;
**	Pango – for text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
==Advantages==&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&amp;lt;ref&amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules/Tk&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &amp;lt;ref&amp;gt;http://www.tutorialspoint.com/ruby/ruby_tk_guide.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk you create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In our program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we pack the root frame and enter the main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&amp;lt;ref&amp;gt;http://en.wikipedia.org/wiki/Qt_%28framework%29&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture. Qt5 brings significant improvements to the speed and ease of developing user interfaces. Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing. So what is the benefit of a GUI toolkit that needs yet another GUI toolkit to run? There are several.&lt;br /&gt;
Benefits of WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator. It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. Though since :we're not putting any other widgets in it, we're simply using it to display an empty window.&lt;br /&gt;
:the third parameter of the Wx::Frame constructor (not necessarily all constructors) is the text to display in the title :bar. Our rather non-descriptive string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the :task bar.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, after creating a widget, you must call show on it or it won't be shown. Though you may want to wait to do this :for some things (such as popup windows), since this is a simple single-widget application, doing this in the on_init :method is appropriate.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walktrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77898</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77898"/>
		<updated>2013-09-18T17:08:03Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* ffi-tk */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver.&amp;lt;ref&amp;gt;[http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules GUI Toolkit Modules]&amp;lt;/ref&amp;gt; Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 200, :height =&amp;gt; 140 do&lt;br /&gt;
   para &amp;quot;Hello World!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: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. It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries:&lt;br /&gt;
**	Cairo – for drawing&lt;br /&gt;
**	Pango – for text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
==Advantages==&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&amp;lt;ref&amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules/Tk&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &amp;lt;ref&amp;gt;http://www.tutorialspoint.com/ruby/ruby_tk_guide.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk you create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In our program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we pack the root frame and enter the main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture. Qt5 brings significant improvements to the speed and ease of developing user interfaces. Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing. So what is the benefit of a GUI toolkit that needs yet another GUI toolkit to run? There are several.&lt;br /&gt;
Benefits of WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator. It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. Though since :we're not putting any other widgets in it, we're simply using it to display an empty window.&lt;br /&gt;
:the third parameter of the Wx::Frame constructor (not necessarily all constructors) is the text to display in the title :bar. Our rather non-descriptive string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the :task bar.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, after creating a widget, you must call show on it or it won't be shown. Though you may want to wait to do this :for some things (such as popup windows), since this is a simple single-widget application, doing this in the on_init :method is appropriate.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walktrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77893</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77893"/>
		<updated>2013-09-18T17:06:47Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* ffi-tk */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver. Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&amp;lt;ref&amp;gt;[http://en.wikipedia.org/wiki/Ruby Ruby]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 200, :height =&amp;gt; 140 do&lt;br /&gt;
   para &amp;quot;Hello World!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: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. It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries:&lt;br /&gt;
**	Cairo – for drawing&lt;br /&gt;
**	Pango – for text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
==Advantages==&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&amp;lt;ref&amp;gt;http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules/Tk&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &amp;lt;ref&amp;gt;http://www.tutorialspoint.com/ruby/ruby_tk_guide.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk you create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In our program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we pack the root frame and enter the main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture. Qt5 brings significant improvements to the speed and ease of developing user interfaces. Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing. So what is the benefit of a GUI toolkit that needs yet another GUI toolkit to run? There are several.&lt;br /&gt;
Benefits of WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator. It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. Though since :we're not putting any other widgets in it, we're simply using it to display an empty window.&lt;br /&gt;
:the third parameter of the Wx::Frame constructor (not necessarily all constructors) is the text to display in the title :bar. Our rather non-descriptive string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the :task bar.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, after creating a widget, you must call show on it or it won't be shown. Though you may want to wait to do this :for some things (such as popup windows), since this is a simple single-widget application, doing this in the on_init :method is appropriate.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walktrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77890</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77890"/>
		<updated>2013-09-18T17:05:31Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* ffi-tk */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver. Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&amp;lt;ref&amp;gt;[http://en.wikipedia.org/wiki/Ruby Ruby]&amp;lt;/ref&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 200, :height =&amp;gt; 140 do&lt;br /&gt;
   para &amp;quot;Hello World!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: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. It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries:&lt;br /&gt;
**	Cairo – for drawing&lt;br /&gt;
**	Pango – for text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
==Advantages==&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &amp;lt;ref&amp;gt;http://www.tutorialspoint.com/ruby/ruby_tk_guide.htm&amp;lt;/ref&amp;gt;&lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk you create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In our program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we pack the root frame and enter the main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture. Qt5 brings significant improvements to the speed and ease of developing user interfaces. Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing. So what is the benefit of a GUI toolkit that needs yet another GUI toolkit to run? There are several.&lt;br /&gt;
Benefits of WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator. It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. Though since :we're not putting any other widgets in it, we're simply using it to display an empty window.&lt;br /&gt;
:the third parameter of the Wx::Frame constructor (not necessarily all constructors) is the text to display in the title :bar. Our rather non-descriptive string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the :task bar.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, after creating a widget, you must call show on it or it won't be shown. Though you may want to wait to do this :for some things (such as popup windows), since this is a simple single-widget application, doing this in the on_init :method is appropriate.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walktrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
&amp;lt;references /&amp;gt;&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77181</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77181"/>
		<updated>2013-09-17T22:35:56Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* GTK+ */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver. Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 200, :height =&amp;gt; 140 do&lt;br /&gt;
   para &amp;quot;Hello World!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: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. It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries:&lt;br /&gt;
**	Cairo – for drawing&lt;br /&gt;
**	Pango – for text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
==Advantages==&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk you create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In our program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we pack the root frame and enter the main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture. Qt5 brings significant improvements to the speed and ease of developing user interfaces. Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing. So what is the benefit of a GUI toolkit that needs yet another GUI toolkit to run? There are several.&lt;br /&gt;
Benefits of WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator. It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. Though since :we're not putting any other widgets in it, we're simply using it to display an empty window.&lt;br /&gt;
:the third parameter of the Wx::Frame constructor (not necessarily all constructors) is the text to display in the title :bar. Our rather non-descriptive string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the :task bar.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, after creating a widget, you must call show on it or it won't be shown. Though you may want to wait to do this :for some things (such as popup windows), since this is a simple single-widget application, doing this in the on_init :method is appropriate.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walktrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&lt;br /&gt;
# http://wonko.com/post/a_brief_comparison_of_cross-platform_gui_toolkits_from_rubys_per&lt;br /&gt;
# http://en.wikipedia.org/wiki/QtRuby&lt;br /&gt;
# http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&lt;br /&gt;
# http://rubydoc.info/gems/shoes/frames&lt;br /&gt;
# http://www.fxruby.org/&lt;br /&gt;
# http://www.darshancomputing.com/qt4-qtruby-tutorial/chapter_01&lt;br /&gt;
# http://ruby.about.com/od/gui/qt/wxrubyworld.htm&lt;br /&gt;
# http://rubylearning.com/satishtalim/ruby_tk_tutorial.html&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77180</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77180"/>
		<updated>2013-09-17T22:35:41Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* wxRuby */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver. Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 200, :height =&amp;gt; 140 do&lt;br /&gt;
   para &amp;quot;Hello World!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: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. It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries:&lt;br /&gt;
**	Cairo – for drawing&lt;br /&gt;
**	Pango – for text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
==Advantages==&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk you create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In our program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we pack the root frame and enter the main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture. Qt5 brings significant improvements to the speed and ease of developing user interfaces. Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing. So what is the benefit of a GUI toolkit that needs yet another GUI toolkit to run? There are several.&lt;br /&gt;
Benefits of WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator. It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. Though since :we're not putting any other widgets in it, we're simply using it to display an empty window.&lt;br /&gt;
:the third parameter of the Wx::Frame constructor (not necessarily all constructors) is the text to display in the title :bar. Our rather non-descriptive string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the :task bar.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, after creating a widget, you must call show on it or it won't be shown. Though you may want to wait to do this :for some things (such as popup windows), since this is a simple single-widget application, doing this in the on_init :method is appropriate.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walktrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&lt;br /&gt;
# http://wonko.com/post/a_brief_comparison_of_cross-platform_gui_toolkits_from_rubys_per&lt;br /&gt;
# http://en.wikipedia.org/wiki/QtRuby&lt;br /&gt;
# http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&lt;br /&gt;
# http://rubydoc.info/gems/shoes/frames&lt;br /&gt;
# http://www.fxruby.org/&lt;br /&gt;
# http://www.darshancomputing.com/qt4-qtruby-tutorial/chapter_01&lt;br /&gt;
# http://ruby.about.com/od/gui/qt/wxrubyworld.htm&lt;br /&gt;
# http://rubylearning.com/satishtalim/ruby_tk_tutorial.html&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77179</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77179"/>
		<updated>2013-09-17T22:35:28Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* QtRuby */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver. Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 200, :height =&amp;gt; 140 do&lt;br /&gt;
   para &amp;quot;Hello World!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: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. It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries:&lt;br /&gt;
**	Cairo – for drawing&lt;br /&gt;
**	Pango – for text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
==Advantages==&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk you create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In our program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we pack the root frame and enter the main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture. Qt5 brings significant improvements to the speed and ease of developing user interfaces. Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing. So what is the benefit of a GUI toolkit that needs yet another GUI toolkit to run? There are several.&lt;br /&gt;
Benefits of WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator. It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. Though since :we're not putting any other widgets in it, we're simply using it to display an empty window.&lt;br /&gt;
:the third parameter of the Wx::Frame constructor (not necessarily all constructors) is the text to display in the title :bar. Our rather non-descriptive string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the :task bar.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, after creating a widget, you must call show on it or it won't be shown. Though you may want to wait to do this :for some things (such as popup windows), since this is a simple single-widget application, doing this in the on_init :method is appropriate.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walktrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&lt;br /&gt;
# http://wonko.com/post/a_brief_comparison_of_cross-platform_gui_toolkits_from_rubys_per&lt;br /&gt;
# http://en.wikipedia.org/wiki/QtRuby&lt;br /&gt;
# http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&lt;br /&gt;
# http://rubydoc.info/gems/shoes/frames&lt;br /&gt;
# http://www.fxruby.org/&lt;br /&gt;
# http://www.darshancomputing.com/qt4-qtruby-tutorial/chapter_01&lt;br /&gt;
# http://ruby.about.com/od/gui/qt/wxrubyworld.htm&lt;br /&gt;
# http://rubylearning.com/satishtalim/ruby_tk_tutorial.html&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77178</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77178"/>
		<updated>2013-09-17T22:35:13Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* ffi-tk */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver. Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 200, :height =&amp;gt; 140 do&lt;br /&gt;
   para &amp;quot;Hello World!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: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. It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries:&lt;br /&gt;
**	Cairo – for drawing&lt;br /&gt;
**	Pango – for text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
==Advantages==&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk you create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In our program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we pack the root frame and enter the main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture. Qt5 brings significant improvements to the speed and ease of developing user interfaces. Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing. So what is the benefit of a GUI toolkit that needs yet another GUI toolkit to run? There are several.&lt;br /&gt;
Benefits of WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator. It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. Though since :we're not putting any other widgets in it, we're simply using it to display an empty window.&lt;br /&gt;
:the third parameter of the Wx::Frame constructor (not necessarily all constructors) is the text to display in the title :bar. Our rather non-descriptive string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the :task bar.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, after creating a widget, you must call show on it or it won't be shown. Though you may want to wait to do this :for some things (such as popup windows), since this is a simple single-widget application, doing this in the on_init :method is appropriate.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walktrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&lt;br /&gt;
# http://wonko.com/post/a_brief_comparison_of_cross-platform_gui_toolkits_from_rubys_per&lt;br /&gt;
# http://en.wikipedia.org/wiki/QtRuby&lt;br /&gt;
# http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&lt;br /&gt;
# http://rubydoc.info/gems/shoes/frames&lt;br /&gt;
# http://www.fxruby.org/&lt;br /&gt;
# http://www.darshancomputing.com/qt4-qtruby-tutorial/chapter_01&lt;br /&gt;
# http://ruby.about.com/od/gui/qt/wxrubyworld.htm&lt;br /&gt;
# http://rubylearning.com/satishtalim/ruby_tk_tutorial.html&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77177</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77177"/>
		<updated>2013-09-17T22:34:47Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* FxRuby */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver. Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 200, :height =&amp;gt; 140 do&lt;br /&gt;
   para &amp;quot;Hello World!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: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. It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries:&lt;br /&gt;
**	Cairo – for drawing&lt;br /&gt;
**	Pango – for text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
==Advantages==&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk you create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In our program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we pack the root frame and enter the main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture. Qt5 brings significant improvements to the speed and ease of developing user interfaces. Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing. So what is the benefit of a GUI toolkit that needs yet another GUI toolkit to run? There are several.&lt;br /&gt;
Benefits of WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator. It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. Though since :we're not putting any other widgets in it, we're simply using it to display an empty window.&lt;br /&gt;
:the third parameter of the Wx::Frame constructor (not necessarily all constructors) is the text to display in the title :bar. Our rather non-descriptive string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the :task bar.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, after creating a widget, you must call show on it or it won't be shown. Though you may want to wait to do this :for some things (such as popup windows), since this is a simple single-widget application, doing this in the on_init :method is appropriate.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walktrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&lt;br /&gt;
# http://wonko.com/post/a_brief_comparison_of_cross-platform_gui_toolkits_from_rubys_per&lt;br /&gt;
# http://en.wikipedia.org/wiki/QtRuby&lt;br /&gt;
# http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&lt;br /&gt;
# http://rubydoc.info/gems/shoes/frames&lt;br /&gt;
# http://www.fxruby.org/&lt;br /&gt;
# http://www.darshancomputing.com/qt4-qtruby-tutorial/chapter_01&lt;br /&gt;
# http://ruby.about.com/od/gui/qt/wxrubyworld.htm&lt;br /&gt;
# http://rubylearning.com/satishtalim/ruby_tk_tutorial.html&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77176</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77176"/>
		<updated>2013-09-17T22:34:13Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* GTK+ */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver. Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 200, :height =&amp;gt; 140 do&lt;br /&gt;
   para &amp;quot;Hello World!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: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. It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries:&lt;br /&gt;
**	Cairo – for drawing&lt;br /&gt;
**	Pango – for text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
==Advantages==&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk you create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In our program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we pack the root frame and enter the main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture. Qt5 brings significant improvements to the speed and ease of developing user interfaces. Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing. So what is the benefit of a GUI toolkit that needs yet another GUI toolkit to run? There are several.&lt;br /&gt;
Benefits of WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator. It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. Though since :we're not putting any other widgets in it, we're simply using it to display an empty window.&lt;br /&gt;
:the third parameter of the Wx::Frame constructor (not necessarily all constructors) is the text to display in the title :bar. Our rather non-descriptive string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the :task bar.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, after creating a widget, you must call show on it or it won't be shown. Though you may want to wait to do this :for some things (such as popup windows), since this is a simple single-widget application, doing this in the on_init :method is appropriate.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walktrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&lt;br /&gt;
# http://wonko.com/post/a_brief_comparison_of_cross-platform_gui_toolkits_from_rubys_per&lt;br /&gt;
# http://en.wikipedia.org/wiki/QtRuby&lt;br /&gt;
# http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&lt;br /&gt;
# http://rubydoc.info/gems/shoes/frames&lt;br /&gt;
# http://www.fxruby.org/&lt;br /&gt;
# http://www.darshancomputing.com/qt4-qtruby-tutorial/chapter_01&lt;br /&gt;
# http://ruby.about.com/od/gui/qt/wxrubyworld.htm&lt;br /&gt;
# http://rubylearning.com/satishtalim/ruby_tk_tutorial.html&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77175</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77175"/>
		<updated>2013-09-17T22:33:55Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* wxRuby */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver. Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 200, :height =&amp;gt; 140 do&lt;br /&gt;
   para &amp;quot;Hello World!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: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. It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries:&lt;br /&gt;
**	Cairo – for drawing&lt;br /&gt;
**	Pango – for text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
==Advantages==&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk you create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In our program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we pack the root frame and enter the main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture. Qt5 brings significant improvements to the speed and ease of developing user interfaces. Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing. So what is the benefit of a GUI toolkit that needs yet another GUI toolkit to run? There are several.&lt;br /&gt;
Benefits of WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator. It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. Though since :we're not putting any other widgets in it, we're simply using it to display an empty window.&lt;br /&gt;
:the third parameter of the Wx::Frame constructor (not necessarily all constructors) is the text to display in the title :bar. Our rather non-descriptive string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the :task bar.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, after creating a widget, you must call show on it or it won't be shown. Though you may want to wait to do this :for some things (such as popup windows), since this is a simple single-widget application, doing this in the on_init :method is appropriate.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walktrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&lt;br /&gt;
# http://wonko.com/post/a_brief_comparison_of_cross-platform_gui_toolkits_from_rubys_per&lt;br /&gt;
# http://en.wikipedia.org/wiki/QtRuby&lt;br /&gt;
# http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&lt;br /&gt;
# http://rubydoc.info/gems/shoes/frames&lt;br /&gt;
# http://www.fxruby.org/&lt;br /&gt;
# http://www.darshancomputing.com/qt4-qtruby-tutorial/chapter_01&lt;br /&gt;
# http://ruby.about.com/od/gui/qt/wxrubyworld.htm&lt;br /&gt;
# http://rubylearning.com/satishtalim/ruby_tk_tutorial.html&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77174</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77174"/>
		<updated>2013-09-17T22:33:43Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* QtRuby */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver. Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 200, :height =&amp;gt; 140 do&lt;br /&gt;
   para &amp;quot;Hello World!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: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. It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries:&lt;br /&gt;
**	Cairo – for drawing&lt;br /&gt;
**	Pango – for text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
==Advantages==&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk you create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In our program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we pack the root frame and enter the main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture. Qt5 brings significant improvements to the speed and ease of developing user interfaces. Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing. So what is the benefit of a GUI toolkit that needs yet another GUI toolkit to run? There are several.&lt;br /&gt;
Benefits of WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator. It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. Though since :we're not putting any other widgets in it, we're simply using it to display an empty window.&lt;br /&gt;
:the third parameter of the Wx::Frame constructor (not necessarily all constructors) is the text to display in the title :bar. Our rather non-descriptive string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the :task bar.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, after creating a widget, you must call show on it or it won't be shown. Though you may want to wait to do this :for some things (such as popup windows), since this is a simple single-widget application, doing this in the on_init :method is appropriate.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walktrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&lt;br /&gt;
# http://wonko.com/post/a_brief_comparison_of_cross-platform_gui_toolkits_from_rubys_per&lt;br /&gt;
# http://en.wikipedia.org/wiki/QtRuby&lt;br /&gt;
# http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&lt;br /&gt;
# http://rubydoc.info/gems/shoes/frames&lt;br /&gt;
# http://www.fxruby.org/&lt;br /&gt;
# http://www.darshancomputing.com/qt4-qtruby-tutorial/chapter_01&lt;br /&gt;
# http://ruby.about.com/od/gui/qt/wxrubyworld.htm&lt;br /&gt;
# http://rubylearning.com/satishtalim/ruby_tk_tutorial.html&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77173</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77173"/>
		<updated>2013-09-17T22:33:24Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* ffi-tk */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver. Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 200, :height =&amp;gt; 140 do&lt;br /&gt;
   para &amp;quot;Hello World!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: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. It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries:&lt;br /&gt;
**	Cairo – for drawing&lt;br /&gt;
**	Pango – for text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
==Advantages==&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk you create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In our program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we pack the root frame and enter the main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture. Qt5 brings significant improvements to the speed and ease of developing user interfaces. Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing. So what is the benefit of a GUI toolkit that needs yet another GUI toolkit to run? There are several.&lt;br /&gt;
Benefits of WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator. It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. Though since :we're not putting any other widgets in it, we're simply using it to display an empty window.&lt;br /&gt;
:the third parameter of the Wx::Frame constructor (not necessarily all constructors) is the text to display in the title :bar. Our rather non-descriptive string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the :task bar.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, after creating a widget, you must call show on it or it won't be shown. Though you may want to wait to do this :for some things (such as popup windows), since this is a simple single-widget application, doing this in the on_init :method is appropriate.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walktrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&lt;br /&gt;
# http://wonko.com/post/a_brief_comparison_of_cross-platform_gui_toolkits_from_rubys_per&lt;br /&gt;
# http://en.wikipedia.org/wiki/QtRuby&lt;br /&gt;
# http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&lt;br /&gt;
# http://rubydoc.info/gems/shoes/frames&lt;br /&gt;
# http://www.fxruby.org/&lt;br /&gt;
# http://www.darshancomputing.com/qt4-qtruby-tutorial/chapter_01&lt;br /&gt;
# http://ruby.about.com/od/gui/qt/wxrubyworld.htm&lt;br /&gt;
# http://rubylearning.com/satishtalim/ruby_tk_tutorial.html&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77171</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77171"/>
		<updated>2013-09-17T22:32:43Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver. Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 200, :height =&amp;gt; 140 do&lt;br /&gt;
   para &amp;quot;Hello World!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: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. It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries:&lt;br /&gt;
**	Cairo – for drawing&lt;br /&gt;
**	Pango – for text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
==Advantages==&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk you create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In our program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we pack the root frame and enter the main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture. Qt5 brings significant improvements to the speed and ease of developing user interfaces. Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing. So what is the benefit of a GUI toolkit that needs yet another GUI toolkit to run? There are several.&lt;br /&gt;
Benefits of WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator. It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. Though since :we're not putting any other widgets in it, we're simply using it to display an empty window.&lt;br /&gt;
:the third parameter of the Wx::Frame constructor (not necessarily all constructors) is the text to display in the title :bar. Our rather non-descriptive string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the :task bar.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, after creating a widget, you must call show on it or it won't be shown. Though you may want to wait to do this :for some things (such as popup windows), since this is a simple single-widget application, doing this in the on_init :method is appropriate.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walktrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&lt;br /&gt;
# http://wonko.com/post/a_brief_comparison_of_cross-platform_gui_toolkits_from_rubys_per&lt;br /&gt;
# http://en.wikipedia.org/wiki/QtRuby&lt;br /&gt;
# http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&lt;br /&gt;
# http://rubydoc.info/gems/shoes/frames&lt;br /&gt;
# http://www.fxruby.org/&lt;br /&gt;
# http://www.darshancomputing.com/qt4-qtruby-tutorial/chapter_01&lt;br /&gt;
# http://ruby.about.com/od/gui/qt/wxrubyworld.htm&lt;br /&gt;
# http://rubylearning.com/satishtalim/ruby_tk_tutorial.html&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77168</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77168"/>
		<updated>2013-09-17T22:30:51Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* GTK+ */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver. Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window. This is intended to be run from Shoes itself, as is common with Shoes programs.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 Shoes.app :width =&amp;gt; 200, :height =&amp;gt; 140 do&lt;br /&gt;
   para &amp;quot;Hello World!&amp;quot;&lt;br /&gt;
 end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: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. It contains all the things needed inside of the application window. In this case, a para (or &amp;quot;paragraph&amp;quot;) displays the text &amp;quot;Hello World.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries:&lt;br /&gt;
**	Cairo – for drawing&lt;br /&gt;
**	Pango – for text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as [http://en.wikipedia.org/wiki/OpenGL OpenGL] widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every FXRuby program begins by creating an FXApp instance.The FXApp instance has a lot of responsibilities in an FXRuby application. One of the most frequent ways you'll use it is to start the application's main event loop.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The next step is to create an FXMainWindow instance to serve as the application's main window.It similar to TkRoot window in tk. Here, we pass theApp as the first argument to FXMainWindow.new to associate the new FXMainWindow instance with this FXApp. The second argument to FXMainWindow.new is a string that will be used for the main window's title.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.create&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:So far, we have instantiated the client-side objects. Unlike most other toolkits, FOX makes a distinction between client-side data and server-side. In order to create the server-side objects associated with the already-constructed client-side objects, we call FXApp#create.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:By default, all windows in FXRuby programs are invisible, so we need to call our main window's show instance method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The last step is to start the program's main loop by calling theApp's run instance method.&lt;br /&gt;
==Advantages==&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk you create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In our program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we pack the root frame and enter the main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture. Qt5 brings significant improvements to the speed and ease of developing user interfaces. Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing. So what is the benefit of a GUI toolkit that needs yet another GUI toolkit to run? There are several.&lt;br /&gt;
Benefits of WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator. It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. Though since :we're not putting any other widgets in it, we're simply using it to display an empty window.&lt;br /&gt;
:the third parameter of the Wx::Frame constructor (not necessarily all constructors) is the text to display in the title :bar. Our rather non-descriptive string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the :task bar.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, after creating a widget, you must call show on it or it won't be shown. Though you may want to wait to do this :for some things (such as popup windows), since this is a simple single-widget application, doing this in the on_init :method is appropriate.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &lt;br /&gt;
Here is a sample program using Ruby/GTK -&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
window.add button&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walktrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'gtk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Mandatory line for all scripts which use ruby/gtk to include gtk.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window = Gtk::Window.new(Gtk::WINDOW_TOPLEVEL)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should beGtk::Window::TOPLEVEL. The new method creates the widget but it is not yet shown on the screen.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button = Gtk::Button.new('Hello World')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Creates a widget button labeled 'Hello World'.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.signal_connect('clicked') {&lt;br /&gt;
  print &amp;quot;Hello World\n&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk uses signals and callbacks mechanism. Some signals are peculiar to specific widgets .e.g. `clicked' to buttons and others are common among all kinds of widgets e.g. `destroy' . Here, when a button is clicked with the pointer, `clicked' signal is emitted. When a signal is emitted, callbacks (i.e. signal handlers) associated with the signal are called. &lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
window.add button&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Some widgets can contain other widgets. Such widgets are called `container widgets'. Above expression places the button on the toplevel window which is a kind of container widget.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
button.show&lt;br /&gt;
window.show&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Shows each widget. Widgets need to be shown explicitly by calling show method.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Gtk.main&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Gtk is an event-driven toolkit. Like all GUI toolkits, GTK+ uses an event-driven programming model. When the user is doing nothing, GTK+ waits in the main loop  for the input. When an action occurs, GTK calls appropriate event handler and processes the event. Once the event is processed, the control returns to the mail loop.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&lt;br /&gt;
# http://wonko.com/post/a_brief_comparison_of_cross-platform_gui_toolkits_from_rubys_per&lt;br /&gt;
# http://en.wikipedia.org/wiki/QtRuby&lt;br /&gt;
# http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&lt;br /&gt;
# http://rubydoc.info/gems/shoes/frames&lt;br /&gt;
# http://www.fxruby.org/&lt;br /&gt;
# http://www.darshancomputing.com/qt4-qtruby-tutorial/chapter_01&lt;br /&gt;
# http://ruby.about.com/od/gui/qt/wxrubyworld.htm&lt;br /&gt;
# http://rubylearning.com/satishtalim/ruby_tk_tutorial.html&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77163</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77163"/>
		<updated>2013-09-17T22:20:03Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* GTK+ */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver. Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries:&lt;br /&gt;
**	Cairo – for drawing&lt;br /&gt;
**	Pango – for text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp.&lt;br /&gt;
FOX is a C++ based Toolkit for developing Graphical User Interfaces easily and effectively. It offers a wide, and growing, collection of Controls, and provides state of the art facilities such as drag and drop, selection, as well as OpenGL widgets for 3D graphical manipulation.  FOX uses a number of techniques to speed up drawing and spatial layout of the GUI. Memory is conserved by allowing programmers to create and destroy GUI elements on the fly.&lt;br /&gt;
The example below is a simple &amp;quot;Hello World&amp;quot;  program. It will display the message &amp;quot;Hello World&amp;quot; in a window.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
include Fox&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
theMainWindow = FXMainWindow.new(theApp, &amp;quot;Hello&amp;quot;)&lt;br /&gt;
theApp.create&lt;br /&gt;
theMainWindow.show&lt;br /&gt;
theApp.run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by line walk through&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'fox16'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:All of the code associated with the FXRuby extension is provided by the fox16 gem.Hence, require ‘fox 16’is a mandatory statement.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
include Fox&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Since all of the FXRuby classes are defined under the Fox module,we add an include Foxstatement so that all of the names in the Fox module are &amp;quot;included&amp;quot; into the global namespace.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
theApp = FXApp.new&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk you create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In our program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we pack the root frame and enter the main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture. Qt5 brings significant improvements to the speed and ease of developing user interfaces. Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing. So what is the benefit of a GUI toolkit that needs yet another GUI toolkit to run? There are several.&lt;br /&gt;
Benefits of WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator. It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. Though since :we're not putting any other widgets in it, we're simply using it to display an empty window.&lt;br /&gt;
:the third parameter of the Wx::Frame constructor (not necessarily all constructors) is the text to display in the title :bar. Our rather non-descriptive string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the :task bar.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, after creating a widget, you must call show on it or it won't be shown. Though you may want to wait to do this :for some things (such as popup windows), since this is a simple single-widget application, doing this in the on_init :method is appropriate.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the [http://en.wikipedia.org/wiki/GIMP GIMP] (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&lt;br /&gt;
# http://wonko.com/post/a_brief_comparison_of_cross-platform_gui_toolkits_from_rubys_per&lt;br /&gt;
# http://en.wikipedia.org/wiki/QtRuby&lt;br /&gt;
# http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&lt;br /&gt;
# http://rubydoc.info/gems/shoes/frames&lt;br /&gt;
# http://www.fxruby.org/&lt;br /&gt;
# http://www.darshancomputing.com/qt4-qtruby-tutorial/chapter_01&lt;br /&gt;
# http://ruby.about.com/od/gui/qt/wxrubyworld.htm&lt;br /&gt;
# http://rubylearning.com/satishtalim/ruby_tk_tutorial.html&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77161</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77161"/>
		<updated>2013-09-17T22:18:00Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* QtRuby */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver. Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries:&lt;br /&gt;
**	Cairo – for drawing&lt;br /&gt;
**	Pango – for text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp. FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk you create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In our program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we pack the root frame and enter the main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture. Qt5 brings significant improvements to the speed and ease of developing user interfaces. Here is a code snippet to create a Hello world window using QtRuby.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing. So what is the benefit of a GUI toolkit that needs yet another GUI toolkit to run? There are several.&lt;br /&gt;
Benefits of WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator. It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. Though since :we're not putting any other widgets in it, we're simply using it to display an empty window.&lt;br /&gt;
:the third parameter of the Wx::Frame constructor (not necessarily all constructors) is the text to display in the title :bar. Our rather non-descriptive string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the :task bar.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, after creating a widget, you must call show on it or it won't be shown. Though you may want to wait to do this :for some things (such as popup windows), since this is a simple single-widget application, doing this in the on_init :method is appropriate.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the GIMP (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&lt;br /&gt;
# http://wonko.com/post/a_brief_comparison_of_cross-platform_gui_toolkits_from_rubys_per&lt;br /&gt;
# http://en.wikipedia.org/wiki/QtRuby&lt;br /&gt;
# http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&lt;br /&gt;
# http://rubydoc.info/gems/shoes/frames&lt;br /&gt;
# http://www.fxruby.org/&lt;br /&gt;
# http://www.darshancomputing.com/qt4-qtruby-tutorial/chapter_01&lt;br /&gt;
# http://ruby.about.com/od/gui/qt/wxrubyworld.htm&lt;br /&gt;
# http://rubylearning.com/satishtalim/ruby_tk_tutorial.html&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77160</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77160"/>
		<updated>2013-09-17T22:17:31Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* wxRuby */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver. Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries:&lt;br /&gt;
**	Cairo – for drawing&lt;br /&gt;
**	Pango – for text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp. FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk you create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In our program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we pack the root frame and enter the main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture. Qt5 brings significant improvements to the speed and ease of developing user interfaces. Here is a code snippet to create a Hello world window.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing. So what is the benefit of a GUI toolkit that needs yet another GUI toolkit to run? There are several.&lt;br /&gt;
Benefits of WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator. It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. &lt;br /&gt;
Here is sample Hello World program using wxRuby-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. Though since :we're not putting any other widgets in it, we're simply using it to display an empty window.&lt;br /&gt;
:the third parameter of the Wx::Frame constructor (not necessarily all constructors) is the text to display in the title :bar. Our rather non-descriptive string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the :task bar.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, after creating a widget, you must call show on it or it won't be shown. Though you may want to wait to do this :for some things (such as popup windows), since this is a simple single-widget application, doing this in the on_init :method is appropriate.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the GIMP (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&lt;br /&gt;
# http://wonko.com/post/a_brief_comparison_of_cross-platform_gui_toolkits_from_rubys_per&lt;br /&gt;
# http://en.wikipedia.org/wiki/QtRuby&lt;br /&gt;
# http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&lt;br /&gt;
# http://rubydoc.info/gems/shoes/frames&lt;br /&gt;
# http://www.fxruby.org/&lt;br /&gt;
# http://www.darshancomputing.com/qt4-qtruby-tutorial/chapter_01&lt;br /&gt;
# http://ruby.about.com/od/gui/qt/wxrubyworld.htm&lt;br /&gt;
# http://rubylearning.com/satishtalim/ruby_tk_tutorial.html&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77159</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77159"/>
		<updated>2013-09-17T22:16:25Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* wxRuby */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver. Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries:&lt;br /&gt;
**	Cairo – for drawing&lt;br /&gt;
**	Pango – for text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp. FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk you create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In our program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we pack the root frame and enter the main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture. Qt5 brings significant improvements to the speed and ease of developing user interfaces. Here is a code snippet to create a Hello world window.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing. So what is the benefit of a GUI toolkit that needs yet another GUI toolkit to run? There are several.&lt;br /&gt;
Benefits of WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and [http://en.wikipedia.org/wiki/Cocoa_%28API%29 Cocoa] on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator. It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. Here is sample Hello World program-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. Though since :we're not putting any other widgets in it, we're simply using it to display an empty window.&lt;br /&gt;
:the third parameter of the Wx::Frame constructor (not necessarily all constructors) is the text to display in the title :bar. Our rather non-descriptive string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the :task bar.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, after creating a widget, you must call show on it or it won't be shown. Though you may want to wait to do this :for some things (such as popup windows), since this is a simple single-widget application, doing this in the on_init :method is appropriate.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the GIMP (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&lt;br /&gt;
# http://wonko.com/post/a_brief_comparison_of_cross-platform_gui_toolkits_from_rubys_per&lt;br /&gt;
# http://en.wikipedia.org/wiki/QtRuby&lt;br /&gt;
# http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&lt;br /&gt;
# http://rubydoc.info/gems/shoes/frames&lt;br /&gt;
# http://www.fxruby.org/&lt;br /&gt;
# http://www.darshancomputing.com/qt4-qtruby-tutorial/chapter_01&lt;br /&gt;
# http://ruby.about.com/od/gui/qt/wxrubyworld.htm&lt;br /&gt;
# http://rubylearning.com/satishtalim/ruby_tk_tutorial.html&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77158</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77158"/>
		<updated>2013-09-17T22:11:00Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* QtRuby */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver. Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries:&lt;br /&gt;
**	Cairo – for drawing&lt;br /&gt;
**	Pango – for text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp. FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk you create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In our program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we pack the root frame and enter the main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, [http://en.wikipedia.org/wiki/QML QML] and [http://en.wikipedia.org/wiki/JavaScript JavaScript] playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture. Qt5 brings significant improvements to the speed and ease of developing user interfaces. Here is a code snippet to create a Hello world window.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing. So what is the benefit of a GUI toolkit that needs yet another GUI toolkit to run? There are several.&lt;br /&gt;
Benefits of WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and Cocoa on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator. It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. Here is sample Hello World program-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. Though since :we're not putting any other widgets in it, we're simply using it to display an empty window.&lt;br /&gt;
:the third parameter of the Wx::Frame constructor (not necessarily all constructors) is the text to display in the title :bar. Our rather non-descriptive string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the :task bar.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, after creating a widget, you must call show on it or it won't be shown. Though you may want to wait to do this :for some things (such as popup windows), since this is a simple single-widget application, doing this in the on_init :method is appropriate.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the GIMP (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&lt;br /&gt;
# http://wonko.com/post/a_brief_comparison_of_cross-platform_gui_toolkits_from_rubys_per&lt;br /&gt;
# http://en.wikipedia.org/wiki/QtRuby&lt;br /&gt;
# http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&lt;br /&gt;
# http://rubydoc.info/gems/shoes/frames&lt;br /&gt;
# http://www.fxruby.org/&lt;br /&gt;
# http://www.darshancomputing.com/qt4-qtruby-tutorial/chapter_01&lt;br /&gt;
# http://ruby.about.com/od/gui/qt/wxrubyworld.htm&lt;br /&gt;
# http://rubylearning.com/satishtalim/ruby_tk_tutorial.html&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77154</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77154"/>
		<updated>2013-09-17T22:08:21Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* ffi-tk */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver. Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries:&lt;br /&gt;
**	Cairo – for drawing&lt;br /&gt;
**	Pango – for text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp. FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is [http://en.wikipedia.org/wiki/Tk_%28framework%29 Tk]. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk you create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In our program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we pack the root frame and enter the main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, QML and JavaScript playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture. Qt5 brings significant improvements to the speed and ease of developing user interfaces. Here is a code snippet to create a Hello world window.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing. So what is the benefit of a GUI toolkit that needs yet another GUI toolkit to run? There are several.&lt;br /&gt;
Benefits of WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and Cocoa on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator. It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. Here is sample Hello World program-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. Though since :we're not putting any other widgets in it, we're simply using it to display an empty window.&lt;br /&gt;
:the third parameter of the Wx::Frame constructor (not necessarily all constructors) is the text to display in the title :bar. Our rather non-descriptive string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the :task bar.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, after creating a widget, you must call show on it or it won't be shown. Though you may want to wait to do this :for some things (such as popup windows), since this is a simple single-widget application, doing this in the on_init :method is appropriate.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the GIMP (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&lt;br /&gt;
# http://wonko.com/post/a_brief_comparison_of_cross-platform_gui_toolkits_from_rubys_per&lt;br /&gt;
# http://en.wikipedia.org/wiki/QtRuby&lt;br /&gt;
# http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&lt;br /&gt;
# http://rubydoc.info/gems/shoes/frames&lt;br /&gt;
# http://www.fxruby.org/&lt;br /&gt;
# http://www.darshancomputing.com/qt4-qtruby-tutorial/chapter_01&lt;br /&gt;
# http://ruby.about.com/od/gui/qt/wxrubyworld.htm&lt;br /&gt;
# http://rubylearning.com/satishtalim/ruby_tk_tutorial.html&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77153</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77153"/>
		<updated>2013-09-17T22:07:46Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* ffi-tk */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver. Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries:&lt;br /&gt;
**	Cairo – for drawing&lt;br /&gt;
**	Pango – for text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp. FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
The standard graphical user interface (GUI) for Ruby is Tk. Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk you create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In our program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we pack the root frame and enter the main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, QML and JavaScript playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture. Qt5 brings significant improvements to the speed and ease of developing user interfaces. Here is a code snippet to create a Hello world window.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing. So what is the benefit of a GUI toolkit that needs yet another GUI toolkit to run? There are several.&lt;br /&gt;
Benefits of WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and Cocoa on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator. It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. Here is sample Hello World program-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. Though since :we're not putting any other widgets in it, we're simply using it to display an empty window.&lt;br /&gt;
:the third parameter of the Wx::Frame constructor (not necessarily all constructors) is the text to display in the title :bar. Our rather non-descriptive string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the :task bar.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, after creating a widget, you must call show on it or it won't be shown. Though you may want to wait to do this :for some things (such as popup windows), since this is a simple single-widget application, doing this in the on_init :method is appropriate.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the GIMP (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&lt;br /&gt;
# http://wonko.com/post/a_brief_comparison_of_cross-platform_gui_toolkits_from_rubys_per&lt;br /&gt;
# http://en.wikipedia.org/wiki/QtRuby&lt;br /&gt;
# http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&lt;br /&gt;
# http://rubydoc.info/gems/shoes/frames&lt;br /&gt;
# http://www.fxruby.org/&lt;br /&gt;
# http://www.darshancomputing.com/qt4-qtruby-tutorial/chapter_01&lt;br /&gt;
# http://ruby.about.com/od/gui/qt/wxrubyworld.htm&lt;br /&gt;
# http://rubylearning.com/satishtalim/ruby_tk_tutorial.html&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77147</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77147"/>
		<updated>2013-09-17T22:05:13Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* ffi-tk */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver. Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries:&lt;br /&gt;
**	Cairo – for drawing&lt;br /&gt;
**	Pango – for text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp. FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk you create widgets and then bind code blocks to them. When something happens (like the user clicking a widget), Tk runs the appropriate code block. In our program, we use the title and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the label. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we pack the root frame and enter the main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, QML and JavaScript playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture. Qt5 brings significant improvements to the speed and ease of developing user interfaces. Here is a code snippet to create a Hello world window.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing. So what is the benefit of a GUI toolkit that needs yet another GUI toolkit to run? There are several.&lt;br /&gt;
Benefits of WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and Cocoa on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator. It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. Here is sample Hello World program-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. Though since :we're not putting any other widgets in it, we're simply using it to display an empty window.&lt;br /&gt;
:the third parameter of the Wx::Frame constructor (not necessarily all constructors) is the text to display in the title :bar. Our rather non-descriptive string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the :task bar.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, after creating a widget, you must call show on it or it won't be shown. Though you may want to wait to do this :for some things (such as popup windows), since this is a simple single-widget application, doing this in the on_init :method is appropriate.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the GIMP (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&lt;br /&gt;
# http://wonko.com/post/a_brief_comparison_of_cross-platform_gui_toolkits_from_rubys_per&lt;br /&gt;
# http://en.wikipedia.org/wiki/QtRuby&lt;br /&gt;
# http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&lt;br /&gt;
# http://rubydoc.info/gems/shoes/frames&lt;br /&gt;
# http://www.fxruby.org/&lt;br /&gt;
# http://www.darshancomputing.com/qt4-qtruby-tutorial/chapter_01&lt;br /&gt;
# http://ruby.about.com/od/gui/qt/wxrubyworld.htm&lt;br /&gt;
# http://rubylearning.com/satishtalim/ruby_tk_tutorial.html&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77143</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77143"/>
		<updated>2013-09-17T22:03:21Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: /* References */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver. Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries:&lt;br /&gt;
**	Cairo – for drawing&lt;br /&gt;
**	Pango – for text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp. FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk you create widgets and then bind code blocks to them. When :something happens (like the user clicking a widget), Tk runs the appropriate code block. In our program, we use the title :and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the :label. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we pack the root frame and enter the main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, QML and JavaScript playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture. Qt5 brings significant improvements to the speed and ease of developing user interfaces. Here is a code snippet to create a Hello world window.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing. So what is the benefit of a GUI toolkit that needs yet another GUI toolkit to run? There are several.&lt;br /&gt;
Benefits of WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and Cocoa on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator. It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. Here is sample Hello World program-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. Though since :we're not putting any other widgets in it, we're simply using it to display an empty window.&lt;br /&gt;
:the third parameter of the Wx::Frame constructor (not necessarily all constructors) is the text to display in the title :bar. Our rather non-descriptive string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the :task bar.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, after creating a widget, you must call show on it or it won't be shown. Though you may want to wait to do this :for some things (such as popup windows), since this is a simple single-widget application, doing this in the on_init :method is appropriate.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the GIMP (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&lt;br /&gt;
# http://wonko.com/post/a_brief_comparison_of_cross-platform_gui_toolkits_from_rubys_per&lt;br /&gt;
# http://en.wikipedia.org/wiki/QtRuby&lt;br /&gt;
# http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&lt;br /&gt;
# http://rubydoc.info/gems/shoes/frames&lt;br /&gt;
# http://www.fxruby.org/&lt;br /&gt;
# http://www.darshancomputing.com/qt4-qtruby-tutorial/chapter_01&lt;br /&gt;
# http://ruby.about.com/od/gui/qt/wxrubyworld.htm&lt;br /&gt;
# http://rubylearning.com/satishtalim/ruby_tk_tutorial.html&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
	<entry>
		<id>https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77142</id>
		<title>CSC/ECE 517 Fall 2013/ch1 1w17 pk</title>
		<link rel="alternate" type="text/html" href="https://wiki.expertiza.ncsu.edu/index.php?title=CSC/ECE_517_Fall_2013/ch1_1w17_pk&amp;diff=77142"/>
		<updated>2013-09-17T22:01:44Z</updated>

		<summary type="html">&lt;p&gt;Pyadav: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;GUI programming tools for [http://en.wikipedia.org/wiki/Ruby Ruby] are a set of widgets used for designing RUBY applications with [http://en.wikipedia.org/wiki/Graphical_user_interface graphical user interfaces] (GUIs). Each widget facilitates a specific user-computer interaction, and appears as a visible part of the computer's GUI. Widget toolkits can be either native or cross platform. Ruby GUI toolkits are typically 3rd party GUI platforms that are wrapped by a Ruby driver. Ruby bindings are available for several widget toolkits. Commonly used tools are described below.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=Shoes= &lt;br /&gt;
Shoes is the best little [http://en.wikipedia.org/wiki/Domain-specific_language DSL] for cross-platform GUI programming in RUBY. This GUI toolkit feels like real Ruby, rather than just another C++ library wrapper. It was originally written by a guy named [http://en.wikipedia.org/wiki/Why_the_lucky_stiff _why], and is now maintained by others. Currently, it is the most widely used GUI toolkit for RUBY.&lt;br /&gt;
&lt;br /&gt;
==Versions==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Version !! Name !! Release&lt;br /&gt;
|-&lt;br /&gt;
| Version1   || Curious || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version2   || Raisins || _why release&lt;br /&gt;
|-&lt;br /&gt;
| Version3   || Policeman ||Post_why release&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Version 3 is the current stable release. It was released on August 19, 2013; 3 years ago.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*	Simplicity- It is designed to make applications as easy as possible.&lt;br /&gt;
*	It has control at a lower level &lt;br /&gt;
*	Makes GUI development fun.&lt;br /&gt;
*	Simple Interface&lt;br /&gt;
*	Very good graphics&lt;br /&gt;
&lt;br /&gt;
==Cool Features==&lt;br /&gt;
&lt;br /&gt;
*	The unique thing about Shoes is that it gives very few controls, but one can build a wide range of different pages that are immediately accessible.&lt;br /&gt;
*	To save a bit of work, Shoes relies on a few libraries:&lt;br /&gt;
**	Cairo – for drawing&lt;br /&gt;
**	Pango – for text&lt;br /&gt;
**	Ruby – for programming&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	It tries to support many platforms. Hence, it is a bit rough at the edges.&lt;br /&gt;
*	Current version is a place holder until Shoes is properly gemified.&lt;br /&gt;
*	Many common robust widgets are not available&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Shoes 4==&lt;br /&gt;
The upcoming version of shoes is Shoes 4.&lt;br /&gt;
Due to various issues like compilation/release and stability with the current shoes implementation, development moved on to shoes4. Shoes4 is a complete all Ruby rewrite of shoes, using the Ruby bindings to the windowing libraries, rather than the C ones. It's goal is to be as close to 100% backwards compatible as it can get.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=FxRuby=&lt;br /&gt;
FxRuby is a toolkit for developing powerful and sophisticated cross-platform graphical user interfaces (GUIs) for RUBY applications. It is based on the [http://en.wikipedia.org/wiki/Fox_toolkit FOX Toolkit], a popular open source C++ library developed by Jeroen van der Zijp. FXRuby has the advantages of both Ruby and C++. An application developer can write the code in ruby programming language which is [http://en.wikipedia.org/wiki/Dynamic_programming_language dynamic], [http://en.wikipedia.org/wiki/Reflection_(computer_science) reflective] and [http://en.wikipedia.org/wiki/Object-oriented_programming_language object-oriented] while simultaneously take advantage of the performance and functionality of the highly optimized C++ toolkit.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*	FXRuby supports everything of FOX, that is useful in Ruby:&lt;br /&gt;
#	MDI/SDI application window layouts&lt;br /&gt;
#	Floating toolbars&lt;br /&gt;
#	Rich set of controls (tables, imagelists, menus, canvas, …)&lt;br /&gt;
#	Flexible layout management&lt;br /&gt;
#	Image read/write support in many formats&lt;br /&gt;
#	Embedded [http://en.wikipedia.org/wiki/OpenGL OpenGL] graphics&lt;br /&gt;
&lt;br /&gt;
*	Relatively flat learning curve- very consistent naming, widget creation parameters, and so on. &lt;br /&gt;
*	It is not a wrapper around some other toolkit. Hence, one can actually override the way a widget works by sub classing and re-implementing behavior and how it is drawn. &lt;br /&gt;
*	Consistent vision- It is written with a consistent vision of how things should fit together.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
&lt;br /&gt;
*	Missing support for some kind of  RichText (which [http://en.wikipedia.org/wiki/Qt_(framework) Qt] and [http://en.wikipedia.org/wiki/GTK%2B GTK+] today provide)&lt;br /&gt;
*	Internationalization and Localization are still being worked on. &lt;br /&gt;
*	Non-native look and feel. It looks like Windows XP even on a Mac or in Windows 7&lt;br /&gt;
*	Binary gems are available for Windows, OS X, and Ubuntu Linux but for other platforms, installing the gem requires you to compile native code.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=ffi-tk=&lt;br /&gt;
Of Ruby GUI bindings, the Tk binding is the oldest; it is widely available and still more or less the default toolkit for GUI programming with Ruby.Tk provides a number of (GUI) widgets commonly needed to develop desktop applications such as button, menu, canvas, text, frame, label, etc. Tk has been ported to run on most flavors of Linux, Mac OS, Unix, and Microsoft Windows. Tk was designed to be extended, and a wide range of extensions are available that offer new widgets or other capabilities.&lt;br /&gt;
The &amp;quot;look and feel&amp;quot; of the Tk application depends on the version of the Tk library Ruby interpreter is linked against:&lt;br /&gt;
*Tk 8.4 and below is notorious for its “ugly” look. The widgets have the outdated Motif look and feel, and, on Unix-based systems, bitmap fonts are used.&lt;br /&gt;
*Tk 8.5 and above look more modern. It is shipped with the Tile theming engine, and widgets now look native to the hosting platform. On Unix-based systems outline fonts are now used.&lt;br /&gt;
&lt;br /&gt;
Tk applications follow a widget hierarchy where any number of widgets may be placed within another widget, and those widgets within another widget, ad infinitum. The main widget in a Tk program is referred to as the root widget and can be created by making a new instance of the TkRoot class.&lt;br /&gt;
*Most Tk-based applications follow the same cycle: create the widgets, place them in the interface, and finally, bind the events associated with each widget to a method.&lt;br /&gt;
*There are three geometry managers place, grid and pack that are responsible for controlling the size and location of each of the widgets in the interface. &lt;br /&gt;
Here is a sample Hello World program-&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'tk'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:In the program, we load the tk extension module.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root = TkRoot.new { title &amp;quot;Hello, World!&amp;quot; }&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:we create a root-level frame using TkRoot.new. With Tk you create widgets and then bind code blocks to them. When :something happens (like the user clicking a widget), Tk runs the appropriate code block. In our program, we use the title :and minsize instance methods (of module Tk::Wm) in the code block to TkRoot.new.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
TkLabel.new(root) do&lt;br /&gt;
   text 'Hello, World!'&lt;br /&gt;
   pack { padx 15 ; pady 15; side 'left' }&lt;br /&gt;
end&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, we make a TkLabel widget (representing a label) as a child of the root frame, setting several options for the :label. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Tk.mainloop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, we pack the root frame and enter the main GUI event loop.&lt;br /&gt;
&lt;br /&gt;
=QtRuby=&lt;br /&gt;
QtRuby is a binding of the application framework [http://en.wikipedia.org/wiki/Qt_(framework) Qt] for the programming language Ruby. Qt  is a cross-platform application framework that is widely used for developing application software with a graphical user interface (GUI) and also used for developing non-GUI programs such as command-line tools and consoles for servers.&lt;br /&gt;
&lt;br /&gt;
Qt uses standard C++ but makes extensive use of a special [http://en.wikipedia.org/wiki/Code_generator code generator] (called the Meta Object Compiler, or moc) together with several macros to enrich the language. Qt can also be used in several other programming languages via language bindings. It runs on the major desktop platforms and some of the mobile platforms. It has extensive internationalization support. Non-GUI features include [http://en.wikipedia.org/wiki/SQL SQL] database access, [http://en.wikipedia.org/wiki/XML XML] parsing, thread management, network support, and a unified cross-platform [http://en.wikipedia.org/wiki/Application_programming_interface application programming interface] (API) for file handling.&lt;br /&gt;
&lt;br /&gt;
Qt5 is the new version which marks a major change in the platform, with hardware-accelerated graphics, QML and JavaScript playing a major role. The traditional C++-only QWidgets continue to be supported, but do not benefit from the performance improvements available through the new architecture. Qt5 brings significant improvements to the speed and ease of developing user interfaces. Here is a code snippet to create a Hello world window.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
hello.show()&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
:Line by Line Walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'Qt4'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:This line loads the QtRuby extension. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app = Qt::Application.new(ARGV)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:app is this program's Qt::Application instance. It is created here. We pass ARGV to the Qt::Application constructor so that it can process certain standard command-line arguments &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello = Qt::PushButton.new('Hello World!')&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Here, after the Qt::Application, comes the first window-system code: A push button is created. &lt;br /&gt;
:The button is set up to display the text &amp;quot;Hello world!&amp;quot;. Because we don't specify a parent window (as second argument to :the Qt::PushButton constructor), the button will be a window of its own, with its own window frame and title bar. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.resize(100, 30)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:The button is set up to be 100 pixels wide and 30 pixels high (excluding the window frame, which is provided by the :windowing system).&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hello.show()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:A widget is never visible when you create it. You must call Qt::Widget::show() to make it visible. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
app.exec()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is where our program passes control to Qt. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
*It supports Linux and other flavors of Unix, as well as Mac OS X and Microsoft Windows.&lt;br /&gt;
*The main advantage to Qt is that it has exactly the same look on Windows and OSX. This is not true for FXRuby nor Gtk2.&lt;br /&gt;
 &lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*While a gem is available for the Windows installation, only source code is available for other platforms.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=wxRuby=&lt;br /&gt;
wxRuby is a binding for the cross-platform [http://en.wikipedia.org/wiki/Wxwidgets wxWidgets] C++ GUI toolkit, which lets you create native-looking desktop applications. It is available for installation as a gem.&lt;br /&gt;
&lt;br /&gt;
WxWidgets is a C++ GUI toolkit that can be used to write GUI (graphical user interface) applications. In this way, it's not unlike GTK, Qt or TK. However, it does differ from these toolkits in one major way: WxWidgets doesn't actually implement the toolkit at all, it uses another toolkit to do the actual drawing. So what is the benefit of a GUI toolkit that needs yet another GUI toolkit to run? There are several.&lt;br /&gt;
Benefits of WxWidgets &lt;br /&gt;
*WxWidgets is cross platform. applications can be ported to different operating systems with as little as a recompile.&lt;br /&gt;
*WxWidgets is consistent and gives a native look and feel. WxWidgets uses the native toolkits on each OS (GTK on Linux, Win32 controls on Windows and Cocoa on OS X), so the application blends in everywhere.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So WxWidgets is kind of a middleman or a translator. It will sit between the program and the native GUI toolkit and allow us to create widgets, as well as passing any messages received (mouse clicks, etc) up to the program. It can also be thought of as a simplifier. Some GUI toolkits are very cumbersome and difficult to work with. Even if we don't need the cross-platform features, or care about the consistency, look and feel, writing programs with WxWidgets can be easier than using the native GUI toolkit directly. Here is sample Hello World program-&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 require 'rubygems'&lt;br /&gt;
 require 'wx'&lt;br /&gt;
 &lt;br /&gt;
 class MyApp &amp;lt; Wx::App&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
 end&lt;br /&gt;
 &lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
: line by line walkthrough&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
require 'wx'&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:To load the WxRuby library, require the 'wx' module. From this point on, all the WxRuby classes will be available in the :Wx module. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
class MyApp &amp;lt; Wx::App&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Every WxRuby application is contained in a class inherited from the Wx::App class. this test class uses the name MyApp&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
   def on_init&lt;br /&gt;
     @frame = Wx::Frame.new( nil, -1, &amp;quot;Application&amp;quot; )&lt;br /&gt;
     @frame.show&lt;br /&gt;
   end&lt;br /&gt;
&amp;lt;/pre&amp;gt; &lt;br /&gt;
:In this example, we're creating a single widget, a Wx::Frame. A Frame is a widget that holds other widgets. Though since :we're not putting any other widgets in it, we're simply using it to display an empty window.&lt;br /&gt;
:the third parameter of the Wx::Frame constructor (not necessarily all constructors) is the text to display in the title :bar. Our rather non-descriptive string &amp;quot;Application&amp;quot; will be displayed in the title bar of our window, as well as in the :task bar.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
 app = MyApp.new&lt;br /&gt;
 app.main_loop&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
:Finally, after creating a widget, you must call show on it or it won't be shown. Though you may want to wait to do this :for some things (such as popup windows), since this is a simple single-widget application, doing this in the on_init :method is appropriate.&lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
&lt;br /&gt;
*Cross platform&lt;br /&gt;
*Large support community&lt;br /&gt;
*Excellent support for all major platforms&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*The API is very C++-oriented&lt;br /&gt;
*It has no documentation aside from auto-generated class and function list.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=GTK+=&lt;br /&gt;
The GTK is a library for creating graphical user interfaces in C programming language. The GTK library is also called the GIMP (GNU Image Manipulation Program) Toolkit. GIMP  is an image retouching and editing tool. Originally, the library was created while developing the GIMP image manipulation program. Since then, the GTK became one of the most popular toolkits under Linux and BSD Unix. Today, most of the GUI software in the open source world is created in Qt or in GTK. Language bindings exist for Ruby, C++, Python, Perl, Java, and other programming languages.&lt;br /&gt;
Ruby/GTK is an extension library to use [http://en.wikipedia.org/wiki/GTK%2B GTK+] in Ruby. There are many applications using GTK+. Especially, Desktop Environment [http://en.wikipedia.org/wiki/GNOME GNOME] adopt GTK+ as interface. &lt;br /&gt;
&lt;br /&gt;
==Advantages==&lt;br /&gt;
The API bindings provided by Ruby-GNOME2 are excellent as well, and mostly do things in the Ruby Way. &lt;br /&gt;
The Ruby-GNOME2 project also provides excellent documentation and tutorials.&lt;br /&gt;
&lt;br /&gt;
==Disadvantages==&lt;br /&gt;
*Windows support isn’t bad, and even uses native widgets in many places under Windows XP, but it requires a hefty set of runtime libraries.&lt;br /&gt;
*Unix support is excellent with the sad exception of Mac OS X. It’s possible to run GTK+ apps in OS X using the X Windowing System, but this means the app looks inconsistent and ugly compared to the rest of the OS X interface.&lt;br /&gt;
&lt;br /&gt;
=References=&lt;br /&gt;
# http://en.wikibooks.org/wiki/Ruby_Programming/GUI_Toolkit_Modules&lt;br /&gt;
# http://wonko.com/post/a_brief_comparison_of_cross-platform_gui_toolkits_from_rubys_per&lt;br /&gt;
# http://en.wikipedia.org/wiki/QtRuby&lt;br /&gt;
# http://en.wikipedia.org/wiki/Shoes_(GUI_toolkit)&lt;br /&gt;
# http://rubydoc.info/gems/shoes/frames&lt;br /&gt;
# http://www.fxruby.org/&lt;br /&gt;
# http://www.darshancomputing.com/qt4-qtruby-tutorial/chapter_01&lt;br /&gt;
# http://ruby.about.com/od/gui/qt/wxrubyworld.htm&lt;/div&gt;</summary>
		<author><name>Pyadav</name></author>
	</entry>
</feed>