#include <gtk/gtk.h>

static void
create_window (gboolean with_headerbar)
{
  GtkWidget *window = gtk_window_new (GTK_WINDOW_TOPLEVEL);

  if (with_headerbar)
    {
      GtkWidget *headerBar = gtk_header_bar_new ();
      gtk_header_bar_set_show_close_button ((GtkHeaderBar *)headerBar, TRUE);
      gtk_window_set_titlebar ((GtkWindow *)window, headerBar);
    }

  GtkWidget *entry = gtk_entry_new ();
  gtk_entry_set_icon_from_icon_name ((GtkEntry *)entry, GTK_ENTRY_ICON_PRIMARY, "dialog-warning-symbolic");
  gtk_entry_set_icon_tooltip_text ((GtkEntry *)entry, GTK_ENTRY_ICON_PRIMARY, "entry icon tooltip text");

  gtk_container_add ((GtkContainer *)window, entry);
  gtk_widget_show_all (window);
}

int
main (int argc, char **argv)
{
  gtk_init (&argc, &argv);

  create_window (FALSE);
  create_window (TRUE );

  gtk_main ();
}
