[Glade-users] gtk builder, glade-3 and http://glade.gnome.org/docs/widgetclasses.html



On Tue, Apr 21, 2009 at 11:35 AM, Gerald Britton
<gerald.britton at gmail.com> wrote:
Basically, I'm trying to convert a libglade app to gtkbuilder. ?It has
some custom widgets that I need help figuring out what to do. ?They
mostly look like this:

? ? ? ? ? ? ? ? ?<child>
? ? ? ? ? ? ? ? ? ?<widget class="Custom" id="date_entry">
? ? ? ? ? ? ? ? ? ? ?<property name="height_request">27</property>
? ? ? ? ? ? ? ? ? ? ?<property name="visible">True</property>
? ? ? ? ? ? ? ? ? ? ?<property
name="creation_function">ValidatableMaskedEntry</property>
? ? ? ? ? ? ? ? ? ? ?<property name="int1">0</property>
? ? ? ? ? ? ? ? ? ? ?<property name="int2">0</property>
? ? ? ? ? ? ? ? ? ?</widget>

So, I'm looking for a little guide on how to do something similar in
gtk builder format. ?I'm hoping that I can leave the
ValidatableMaskedEntry code pretty much alone (can I?)

The answer is that your custom widget must indeed be a custom
widget (not a function that creates some hierarchy of stock widget
types), and then the resulting Glade file will contain entries such as:

  <object class="ValidatableMaskedEntry" id="maskedentry1">

in this case ValidatableMaskedEntry must be the type name which
was registered with g_type_register_static (when writing C).

So, to make a long story short, GTK+ supports loading of any
object in builder, with no funny exceptions like creation functions.
And Glade does the same, you can add catalogs of widget types
and they should integrate into the Glade file like any other widget.

Cheers,
           -Tristan




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]