4

I'm making a GTK 3 app (with Ruby), using Glade to make interfaces. I made an UI file with two composite templates, like this:

<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.2 -->
<interface>
  <requires lib="gtk+" version="3.20"/>
  <template class="BillyBonesApplicationWindow" parent="GtkApplicationWindow">
    <child>
      <object class="GtkGrid">
        <!-- More code here -->
      </object>
    </child>
  </template>
  <template class="BillyBonesPayDialog" parent="GtkDialog">
    <property name="modal">True</property>
    <property name="destroy_with_parent">True</property>
    <property name="type_hint">dialog</property>
    <signal name="response" handler="gtk_widget_destroy" after="yes" swapped="yes"/>
    <child type="titlebar">
      <placeholder/>
    </child>
    <child internal-child="vbox">
      <object class="GtkBox">
        <!-- More code here -->
      </object>
    </child>
    <action-widgets>
      <action-widget response="-10">savebutton</action-widget>
      <action-widget response="-6">cancelbutton</action-widget>
    </action-widgets>
  </template>
</interface>

But when I try to run my application, I get an error:

Gtk-CRITICAL **: 00:43:15.062: Error building template class 'BillyBonesApplicationWindow' for an instance of type 'BillyBonesApplicationWindow': .:3:2485 Parsed template definition for type 'BillyBonesPayDialog', expected type 'BillyBonesApplicationWindow'

The error disappeared when I split the two interface definitions into separate files.

Can you really have only one composite template definition per UI file in GTK 3?

art-solopov
  • 4,289
  • 3
  • 25
  • 44

0 Answers0