#include <gtk/gtk.h>

char *ui_str = 
"<ui>"
"<toolbar name=\"Toolbar\">"
"        <toolitem name=\"Back\" action=\"Back\"/>"
"        <toolitem name=\"Home\" action=\"Home\"/>"
"</toolbar>"
"</ui>";



static const GtkActionEntry entries[] = {
  { "Back", GTK_STOCK_GO_BACK,
     "_Back", NULL,
     "Go back in history",
     NULL },
  { "Home", "user-home",
     "_Home Folder", "<alt>Home",
     "Open your personal folder",
     NULL }
};

static void
add_widget (GtkUIManager *ui_manager,
            GtkWidget    *widget,
            GtkContainer *container)
{
  gtk_container_add (GTK_CONTAINER (container), widget);
  gtk_widget_show (widget);
  g_message ("adding widget!");
}


int main (int argc, char **argv)
{
	GtkActionGroup *group;
	GtkWidget *window, *box;
	GtkUIManager *ui_manager;

	gtk_init (&argc, &argv);

	group = gtk_action_group_new ("Actions");
        gtk_action_group_add_actions (group,
                                      entries, G_N_ELEMENTS (entries),
                                      NULL);
	ui_manager = gtk_ui_manager_new ();
	gtk_ui_manager_insert_action_group (ui_manager, group, 0);
	g_object_unref (group);

	window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
	g_signal_connect (ui_manager, "add_widget", G_CALLBACK (add_widget), window);

	gtk_ui_manager_add_ui_from_string (ui_manager, ui_str, -1, NULL);

	gtk_window_present (GTK_WINDOW (window));

	gtk_main ();
}
