# How to bind gtk-print-settings-to-key-file?

**URL:** <https://www.ruby-forum.com/t/how-to-bind-gtk-print-settings-to-key-file/148604>\
**Category:** Ruby-Gnome 2\
**Created:** [September 15, 2008, 3:20pm UTC](https://www.ruby-forum.com/t/how-to-bind-gtk-print-settings-to-key-file/148604 "2008-09-15T15:20:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![blueprint](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/cc9497/32.png) [@blueprint](https://www.ruby-forum.com/u/blueprint)\
**Post date:** [September 15, 2008, 3:20pm UTC](https://www.ruby-forum.com/t/how-to-bind-gtk-print-settings-to-key-file/148604/1 "2008-09-15T15:20:22Z")

</div>

[http://library.gnome.org/devel/gtk/2.11/GtkPrintSettings.html#gtk-print-settings-to-key-file](http://library.gnome.org/devel/gtk/2.11/GtkPrintSettings.html#gtk-print-settings-to-key-file)

needs a GKeyFile\* in parameter, but G\_TYPE\_KEY\_FILE or  
g\_key\_file\_get\_type() are not exposed by glib nor by ruby-glib2. I  
failed to find a solution to a similar problem, as for example  
GTK\_TYPE\_TREE\_PATH is defined and exposed by gtk (it is a boxed type,  
as GKeyFile is)…

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

---

<div class="post-metadata">

**Author:** ![blueprint](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/cc9497/32.png) [@blueprint](https://www.ruby-forum.com/u/blueprint)\
**Post date:** [September 15, 2008, 3:46pm UTC](https://www.ruby-forum.com/t/how-to-bind-gtk-print-settings-to-key-file/148604/2 "2008-09-15T15:46:20Z")

</div>

Hi,

In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
“[ruby-gnome2-devel-en] how to bind gtk-print-settings-to-key-file?”  
on Mon, 15 Sep 2008 15:19:51 +0200,  
“Guillaume C.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> [http://library.gnome.org/devel/gtk/2.11/GtkPrintSettings.html#gtk-print-settings-to-key-file](http://library.gnome.org/devel/gtk/2.11/GtkPrintSettings.html#gtk-print-settings-to-key-file)
> 
> needs a GKeyFile\* in parameter, but G\_TYPE\_KEY\_FILE or  
> g\_key\_file\_get\_type() are not exposed by glib nor by ruby-glib2. I  
> failed to find a solution to a similar problem, as for example  
> GTK\_TYPE\_TREE\_PATH is defined and exposed by gtk (it is a boxed type,  
> as GKeyFile is)…

You can change Ruby/GLib2 to export G\_TYPE\_KEY\_FILE.

## Thanks,

kou

---

<div class="post-metadata">

**Author:** ![blueprint](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/cc9497/32.png) [@blueprint](https://www.ruby-forum.com/u/blueprint)\
**Post date:** [September 16, 2008, 4:19pm UTC](https://www.ruby-forum.com/t/how-to-bind-gtk-print-settings-to-key-file/148604/3 "2008-09-16T16:19:22Z")

</div>

> You can change Ruby/GLib2 to export G\_TYPE\_KEY\_FILE.

Ok.

I am not sure about actual code, because I haven’t found a .h where it  
made sense to add it close to other equivalent things. I came up with  
that patch though in rbglib.h it looks a bit awkward next to the rest  
of the content. WDYT?

---

<div class="post-metadata">

**Author:** ![blueprint](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/cc9497/32.png) [@blueprint](https://www.ruby-forum.com/u/blueprint)\
**Post date:** [September 16, 2008, 4:46pm UTC](https://www.ruby-forum.com/t/how-to-bind-gtk-print-settings-to-key-file/148604/4 "2008-09-16T16:46:26Z")

</div>

Hi,

In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
“Re: [ruby-gnome2-devel-en] how to bind  
gtk-print-settings-to-key-file?” on Tue, 16 Sep 2008 16:18:56 +0200,  
“Guillaume C.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > You can change Ruby/GLib2 to export G\_TYPE\_KEY\_FILE.
> 
> Ok.
> 
> I am not sure about actual code, because I haven’t found a .h where it  
> made sense to add it close to other equivalent things. I came up with  
> that patch though in rbglib.h it looks a bit awkward next to the rest  
> of the content. WDYT?

It looks good except g\_key\_file\_get\_type is missing in  
glib2.def. Please commit the patch with glib2.def update.

## Thanks,

kou

---

<div class="post-metadata">

**Author:** ![blueprint](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/cc9497/32.png) [@blueprint](https://www.ruby-forum.com/u/blueprint)\
**Post date:** [September 17, 2008, 3:50pm UTC](https://www.ruby-forum.com/t/how-to-bind-gtk-print-settings-to-key-file/148604/5 "2008-09-17T15:50:27Z")

</div>

Hi,

In [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
“Re: [ruby-gnome2-devel-en] how to bind  
gtk-print-settings-to-key-file?” on Tue, 16 Sep 2008 17:13:15 +0200,  
“Guillaume C.” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > >
> 
> # objdump -T glib2.so | grep g\_key\_file\_get\_type
> 
> 00016f10 g DF .text 00000050 Base g\_key\_file\_get\_type

It’s my understanding that .def is needed when you use  
glib2.so with MSVC. .def is needed to generate glib2.lib and  
glib2.lib is needed to build bindings that uses Ruby/GLib.

# NOTE: I’m not Windows user.

## Thanks,

kou

---

<div class="post-metadata">

**Author:** ![blueprint](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/cc9497/32.png) [@blueprint](https://www.ruby-forum.com/u/blueprint)\
**Post date:** [September 16, 2008, 6:10pm UTC](https://www.ruby-forum.com/t/how-to-bind-gtk-print-settings-to-key-file/148604/6 "2008-09-16T18:10:10Z")

</div>

On Tue, Sep 16, 2008 at 4:45 PM, Kouhei S. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > I am not sure about actual code, because I haven’t found a .h where it  
> > made sense to add it close to other equivalent things. I came up with  
> > that patch though in rbglib.h it looks a bit awkward next to the rest  
> > of the content. WDYT?
> 
> It looks good except g\_key\_file\_get\_type is missing in  
> glib2.def. Please commit the patch with glib2.def update.

I missed it partially because I did test, and it was successful. Is it  
really needed? seems that the symbol is already exported:

# objdump -T glib2.so | grep g\_key\_file\_get\_type

00016f10 g DF .text 00000050 Base g\_key\_file\_get\_type

–  
Guillaume C. - [Guillaume Cottenceau](http://zarb.org/~gc/)
