tags:

views:

26

answers:

1

Hi,

I'm making custom Gtk+ widgets (in C) for work and one of the requirements is that those widgets have to be editable in Glade.

So far it works nicely, I have for example a widget made of a table with buttons in it and with a custom specific behaviour and some custom specific properties that can be edited in Glade correctly.

So this work but I need now to allow the user to change the properties of buttons (that are inside my custom widget) - and only those buttons - from Glade.

It seems to be possible as a lot of basic Gtk widgets (a lot of containers) are exposing some of their sub-widgets in glade, allowing for example to edit the label of a GtkFrame.

But I can't find any documentation on that. Can anyone please explain how to achieve this?

+1  A: 

Ok I think I've found the answer (after several day of searching and asking on the Gtk forum).

The main idea is that the code that make sub-widgets visible in glade, and in fact all the specific visual behaviour specific in glade, is written in a C pluggin loaded by glade.

First, you can see in the catalog file provided by Glade for Gtk+ that there are names of functions with glade_gtk_ prefixes. Those functions are provided in the C plugin where you can see that functions uses the glade API to add widget adaptors to Glade.

Those adaptors then allow the targetted widgets to be visible in glade.

In fact I've found some documentation that I didnt finished to read yet : http://library.gnome.org/devel/gladeui/stable/catalog.html

Someone confirmed : http://www.gtkforums.com/viewtopic.php?p=18030#18030

Klaim