#include <gtk/gtk.h>

int main(int argc, char **argv)
{
  GtkWidget *shortcutsWindow;
  GtkWidget *shortcutsSection;
  GtkWidget *shortcutsGroup;
  GtkWidget *shortcut;

  gtk_init (&argc, &argv);

  /* ShortcutsShortcut */
  shortcut = g_object_new (GTK_TYPE_SHORTCUTS_SHORTCUT,
                           "accelerator", "<Ctrl>R",
                           "title", "ShortcutsShortcut",
                           "subtitle", "Do some stuff.",
                           NULL);

  /* ShortcutsGroup */
  shortcutsGroup = g_object_new (GTK_TYPE_SHORTCUTS_GROUP,
                                 "title", "ShortcutsGroup",
                                 NULL);
  gtk_container_add (GTK_CONTAINER (shortcutsGroup), shortcut);

  /* ShortcutsSection */
  shortcutsSection = g_object_new (GTK_TYPE_SHORTCUTS_SECTION,
                                   "title", "ShortcutsSection",
                                   "section-name", "the-section",
                                   NULL);
  /* !!
     Manually show()ing the Section is mandatory, BEFORE adding to the Window,
     otherwise the Window opens on Search Results with no way out.
     GtkShortcutsWindow's show_all() does not suffice, as it excludes Sections.
     N.B.: Tests with >1 Section indicated that only 1 must be manually show()n.
  */
  gtk_widget_show (shortcutsSection);
  gtk_container_add (GTK_CONTAINER (shortcutsSection), shortcutsGroup);

  /* ShortcutsWindow */
  shortcutsWindow = g_object_new (GTK_TYPE_SHORTCUTS_WINDOW,
                                  "title", "ShortcutsWindow",
                                  NULL);
  gtk_container_add (GTK_CONTAINER (shortcutsWindow), shortcutsSection);

  /* Run */
  g_signal_connect (G_OBJECT (shortcutsWindow), "delete-event",
                    G_CALLBACK (&gtk_main_quit), NULL);
  /* N.B. warning in !! comment above */
  gtk_widget_show_all (shortcutsWindow);
  gtk_main ();
}
