Introduction: Ruby is a flexible and dynamic programming language. GTK2 is an open source cross-platform image processing library. Fast Linux Desktop graphics application development through RUBY-GTK2.
Introduced
RUBY-GTK2 is a ruby binding of GTK +. The combination of Ruby and GTK2 brings a new way of GUI development.
GTK (GIMP Toolkit) is a set of graphics kits across multiple platforms, published under the LGPL license agreement. Although it was originally written for GIMP, it has now developed into a versatile graphics library with a powerful and flexible design. In particular, the GNOME selection makes GTK + widely available and becomes one of the mainstream development tools for developing desktop graphical applications under Linux, and GTK + has a successful version of Windows.
Ruby is a dynamic scripting language. There is a rich development library. The RubyForge website (http://rubyforge.org/) is the world's largest Ruby development library site.
With the combination of Ruby and GTK, you can develop desktop graphical applications more efficiently and quickly.
Installation and Testing
Before you develop Gtk2-ruby, you need to install Ruby and Gtk2 runtimes.
Based on the Debian Linux system, enter
$sudo apt-get–y Install Libgtk2-ruby
APT will automatically install Ruby and GTK2 runtime.
Windows system, first log on to Ruby's official website to download the latest stable version of 1.8.6 installer. Then log on to the RUBY-GNOME2 official website to download the Gtk2-ruby Runtime Library. After each installation.
After successfully configuring the system, you can try running the following program on the command line (cmd under Windows, Shell under Linux):
$ruby-rgtk2-e "gtk::window.new.show; Gtk.main "
If you successfully see the window jump out, the development environment has been built successfully.
Figure 1. Pop-up window