Migrating GTK3 to GTK4 ui file conversion: how to handle internal-child="vbox"?

Hi,
I am trying to convert my application to GTK4 - I have a (large?) glade file that has needed some work. I’ve passed it through gtk-builder-tool simplify ---3to4. But I can’t understand what I need to do to convert

    <child internal-child="vbox">

Here’s an example of how that looks:

  <object class="GtkDialog" id="add_alt_conf_dialog">
    <property name="title" translatable="yes">Add Alternate Conformation</property>
    <child internal-child="vbox">
      <object class="GtkBox" id="dialog-vbox27">
        <property name="orientation">vertical</property>
         <child type="action">
              <object class="GtkBox" id="hbox60">
                <child>
                  <object class="GtkButton" id="add_alt_conf_cancel_button">
                    <property name="label" translatable="yes">  Cancel  </property>
                    <property name="can-focus">1</property>
                    <property name="use-underline">1</property>
                    <signal name="clicked" handler="on_add_alt_conf_cancel_button_clicked" swapped="no"/>
                  </object>
                </child>
              </object>
        </child>
.... {shall I paste the whole file?}

The error message from gtk_builder_add_from_file() is:

ERROR:: Unknown internal child: vbox

There are over 100 similar internal-child=vbox instances, so I’d rather not do it by a hand-edit (but if I must, I will).

The can be found at

Thanks,

Paul

Just encountered this yesterday in GNOME System Monitor. My solution was simply to drop the tag. I don’t really see the point of the attribute.

1 Like

Thanks - that was helpful. It lead me to find xmllint to check that the ui was valid and I found a bug in my conversion script.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.