Using Ruby for GTK desktop development under Linux

Source: Internet
Author: User
Tags command line gtk image processing library

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

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.