
#include <gtk/gtk.h>

const gchar ui[] =
  "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"
  "<interface>\n"
  "  <!-- interface-requires gtk+ 3.0 -->\n"
  "  <object class=\"GtkMenu\" id=\"menu1\">\n"
  "    <property name=\"visible\">True</property>\n"
  "    <property name=\"can_focus\">False</property>\n"
  "    <child>\n"
  "      <object class=\"GtkMenuItem\" id=\"menuitem1\">\n"
  "        <property name=\"use_action_appearance\">False</property>\n"
  "        <property name=\"visible\">True</property>\n"
  "        <property name=\"can_focus\">False</property>\n"
  "        <property name=\"label\" translatable=\"yes\">menuitem1</property>\n"
  "        <property name=\"use_underline\">True</property>\n"
  "      </object>\n"
  "    </child>\n"
  "    <child>\n"
  "      <object class=\"GtkMenuItem\" id=\"menuitem2\">\n"
  "        <property name=\"use_action_appearance\">False</property>\n"
  "        <property name=\"visible\">True</property>\n"
  "        <property name=\"can_focus\">False</property>\n"
  "        <property name=\"label\" translatable=\"yes\">menuitem2</property>\n"
  "        <property name=\"use_underline\">True</property>\n"
  "      </object>\n"
  "    </child>\n"
  "    <child>\n"
  "      <object class=\"GtkSeparatorMenuItem\" id=\"menuitem3\">\n"
  "        <property name=\"use_action_appearance\">False</property>\n"
  "        <property name=\"visible\">True</property>\n"
  "        <property name=\"can_focus\">False</property>\n"
  "      </object>\n"
  "    </child>\n"
  "    <child>\n"
  "      <object class=\"GtkMenuItem\" id=\"menuitem4\">\n"
  "        <property name=\"use_action_appearance\">False</property>\n"
  "        <property name=\"visible\">True</property>\n"
  "        <property name=\"can_focus\">False</property>\n"
  "        <property name=\"label\" translatable=\"yes\">menuitem4</property>\n"
  "        <property name=\"use_underline\">True</property>\n"
  "      </object>\n"
  "    </child>\n"
  "  </object>\n"
  "  <object class=\"GtkWindow\" id=\"window1\">\n"
  "    <property name=\"can_focus\">False</property>\n"
  "    <child>\n"
  "      <object class=\"GtkBox\" id=\"box1\">\n"
  "        <property name=\"visible\">True</property>\n"
  "        <property name=\"can_focus\">False</property>\n"
  "        <property name=\"orientation\">vertical</property>\n"
  "        <child>\n"
  "          <object class=\"GtkLabel\" id=\"label1\">\n"
  "            <property name=\"visible\">True</property>\n"
  "            <property name=\"can_focus\">False</property>\n"
  "            <property name=\"label\" translatable=\"yes\">foo</property>\n"
  "          </object>\n"
  "          <packing>\n"
  "            <property name=\"expand\">False</property>\n"
  "            <property name=\"fill\">True</property>\n"
  "            <property name=\"position\">0</property>\n"
  "          </packing>\n"
  "        </child>\n"
  "        <child>\n"
  "          <object class=\"GtkMenuButton\" id=\"button1\">\n"
  "            <property name=\"use_action_appearance\">False</property>\n"
  "            <property name=\"visible\">True</property>\n"
  "            <property name=\"can_focus\">True</property>\n"
  "            <property name=\"receives_default\">True</property>\n"
  "            <property name=\"use_action_appearance\">False</property>\n"
  "            <property name=\"menu\">menu1</property>\n"
  "            <child>\n"
  "              <object class=\"GtkImage\" id=\"image1\">\n"
  "                <property name=\"visible\">True</property>\n"
  "                <property name=\"can_focus\">False</property>\n"
  "                <property name=\"stock\">gtk-cdrom</property>\n"
  "              </object>\n"
  "            </child>\n"
  "          </object>\n"
  "          <packing>\n"
  "            <property name=\"expand\">False</property>\n"
  "            <property name=\"fill\">True</property>\n"
  "            <property name=\"position\">1</property>\n"
  "          </packing>\n"
  "        </child>\n"
  "        <child>\n"
  "          <placeholder/>\n"
  "        </child>\n"
  "      </object>\n"
  "    </child>\n"
  "  </object>\n"
  "</interface>\n";

int
main (int argc, char *argv[])
{
  GtkBuilder *b;
  GtkWidget *w;
  GError *error;

  gtk_init (&argc, &argv);

  b = gtk_builder_new ();

  error = NULL;
  if (gtk_builder_add_from_string (b, ui, -1, &error) == 0)
    {
      g_error ("Error parsing: %s (%s, %d)", error->message, g_quark_to_string (error->domain), error->code);
    }

  w = GTK_WIDGET (gtk_builder_get_object (b, "window1"));
  gtk_widget_show_all (w);
  gtk_window_present (GTK_WINDOW (w));

  gtk_main ();

 out:
  return 0;
}
