# Bindings generation tool?

**URL:** <https://www.ruby-forum.com/t/bindings-generation-tool/192181>\
**Category:** Ruby-Gnome 2\
**Created:** [July 25, 2010, 8:40pm UTC](https://www.ruby-forum.com/t/bindings-generation-tool/192181 "2010-07-25T20:40:26Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![arachnd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/278dde/32.png) [@arachnd](https://www.ruby-forum.com/u/arachnd)\
**Post date:** [July 25, 2010, 8:40pm UTC](https://www.ruby-forum.com/t/bindings-generation-tool/192181/1 "2010-07-25T20:40:26Z")

</div>

Hello.

I’ve been examining ruby-gtk2 C sources and it very looks like they  
were generated with some kind of code generation tool.  
True/False?

The reason why I’m asking about this is that I need Scintilla text  
editing widget, but I can’t find any existing bindings ☹

Also a bit off-topic question: I’ve got a program with embedded ruby  
interpreter and a some ruby classes/functions/etc…  
the question is: how do I pass C’s GtkWidget object to Ruby as  
instance one of the ruby-gtk2 wrapper classes?

Thank you.

---

<div class="post-metadata">

**Author:** ![arachnd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/278dde/32.png) [@arachnd](https://www.ruby-forum.com/u/arachnd)\
**Post date:** [August 9, 2010, 7:26pm UTC](https://www.ruby-forum.com/t/bindings-generation-tool/192181/2 "2010-08-09T19:26:15Z")

</div>

On Sun, Jul 25, 2010 at 20:39, naquad [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I’ve been examining ruby-gtk2 C sources and it very looks like they  
> were generated with some kind of code generation tool.  
> True/False?

False.

* * *

This [SF.net](http://SF.net) email is sponsored by

Make an app they can’t live without  
Enter the BlackBerry Developer Challenge

> **[Best Open Source Front-Ends 2026](https://sourceforge.net/directory/front-ends/)**
>
> Compare the best free open source Front-Ends at SourceForge. Free, secure and fast Front-Ends downloads from the largest Open Source applications and software directory

---

<div class="post-metadata">

**Author:** ![arachnd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/278dde/32.png) [@arachnd](https://www.ruby-forum.com/u/arachnd)\
**Post date:** [August 16, 2010, 2:56pm UTC](https://www.ruby-forum.com/t/bindings-generation-tool/192181/3 "2010-08-16T14:56:23Z")

</div>

On Mon, Aug 9, 2010 at 7:25 PM, Nikolai W. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> On Sun, Jul 25, 2010 at 20:39, naquad [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:
> 
> > I’ve been examining ruby-gtk2 C sources and it very looks like they  
> > were generated with some kind of code generation tool.  
> > True/False?
> 
> False.

It’s possible they’ve been partially generated with. I for myself  
remember I wrote a small script converting GTK+ C headers to a Ruby  
skeleton source. I used it to add some missing stuff for GTK+ 2.6 and  
later. Then I manually tweaked the generated if necessary. But that  
kind of thing produces probably source that looks like it was  
generated.

PS: the future of gobject-based bindings is dynamic bindings; too bad  
noone has enough time to do it for ruby 😕

> **[GObjectIntrospection – GNOME Wiki Archive](https://wiki.gnome.org/GObjectIntrospection)**

[http://wiki.github.com/mvz/ruby-gir-ffi/](http://wiki.github.com/mvz/ruby-gir-ffi/)

–  
Guillaume C. - [NVC Communication Obstacles Game](http://zarb.org/~gc/)

* * *

This [SF.net](http://SF.net) email is sponsored by

Make an app they can’t live without  
Enter the BlackBerry Developer Challenge

> **[Best Open Source Front-Ends 2026](https://sourceforge.net/directory/front-ends/)**
>
> Compare the best free open source Front-Ends at SourceForge. Free, secure and fast Front-Ends downloads from the largest Open Source applications and software directory

---

<div class="post-metadata">

**Author:** ![arachnd](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/278dde/32.png) [@arachnd](https://www.ruby-forum.com/u/arachnd)\
**Post date:** [December 30, 2010, 10:31am UTC](https://www.ruby-forum.com/t/bindings-generation-tool/192181/4 "2010-12-30T10:31:00Z")

</div>

Guillaume C. wrote in post #933331:

> PS: the future of gobject-based bindings is dynamic bindings; too bad  
> noone has enough time to do it for ruby 😕
> 
> [GObjectIntrospection – GNOME Wiki Archive](http://live.gnome.org/GObjectIntrospection)  
> [http://wiki.github.com/mvz/ruby-gir-ffi/](http://wiki.github.com/mvz/ruby-gir-ffi/)

Hello,

My little ruby-gir-ffi project is steadily progressing, nearing version  
0.0.5. The resulting bindings are a lot more like C than the existing  
ruby-gtk2, and you need to cast to and from GValues by hand a lot, but  
you can create simple working Gtk+ applications.

The gem is called gir\_ffi, by the way. It uses ffi to call the c  
libraries.

The source:  
[https://github.com/mvz/ruby-gir-ffi](https://github.com/mvz/ruby-gir-ffi)

Port of green shoes:  
[GitHub - mvz/green\_shoes at gir\_ffi · GitHub](https://github.com/mvz/green_shoes/tree/gir_ffi)

Port of a more classic Gtk+ application:  
[https://github.com/mvz/pinhole/tree/gir\_ffi](https://github.com/mvz/pinhole/tree/gir_ffi)

There may be crashes, there may be core dumps. Comments, questions and  
suggestions welcome.

Regards,  
Matijs.
