Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ruby bindings for GTK+ 3?

Tags:

ruby

gtk

gnome

I’ve spent some time learning Ruby, and I wanted to move over to some GUI programming. GNOME 3 is the environment most appealing to me at the moment, so I thought I would have a look at GTK+ 3. However, the GTK+ 3 documentation’s Getting Started examples in C were quite off-putting. Are there less scary Ruby bindings (and Hello World examples) available?

Edit: The GTK+ Language Bindings overview does not leave much room for hope.

like image 741
Daniel Avatar asked Jun 06 '11 23:06

Daniel


4 Answers

After a quick chat on #ruby on freenode I learned that there are bindings for GTK+ 3 that are actively developmented:

https://github.com/mvz/ruby-gir-ffi

The project is still young. I'm looking forward to diving in and seeing what I can do too. Here's an introduction by the author: http://www.matijs.net/blog/2011/05/10/girffi-an-introduction

like image 59
nixterrimus Avatar answered Sep 22 '22 02:09

nixterrimus


Right now there are gtk3 bindings. In fact there is a rubygem for gtk3. Just do:

$gem install gtk3

like image 31
user1182000 Avatar answered Sep 23 '22 02:09

user1182000


Ruby-GNOME2

Supports GTK+ 3 from version 1.2, released in January 2013.

like image 22
user Avatar answered Sep 25 '22 02:09

user


Currently the Ruby Gnome project is only on GTK 2 but work has begun on GTK3 bindings. Take a look at this post on the Ruby Gnome2 forum: http://www.ruby-forum.com/topic/2715042#new (5th one down).

The project website has plenty of tutorials: http://ruby-gnome2.sourceforge.jp/

Installing it is pretty simple on Ubuntu:

sudo apt-get install libgtk2.0-dev
gem install gtk2

I'd start with this and move to GTK3 when there are stable bindings.

Ruby GIR bindings is interesting and I'll be keeping an eye on this but I don't think it'll be as simple to use as Ruby Gnome 2.

like image 43
PhilT Avatar answered Sep 24 '22 02:09

PhilT