#include <stdio.h>
#include <gtk/gtk.h>

static GtkWidget *dialog = NULL;

static void
adj_changed (GtkAdjustment *adj,
             GtkWidget     *window)
{
  if (adj->value >= 75)
    {
      if (!dialog)
        dialog = gtk_dialog_new_with_buttons ("TEST", GTK_WINDOW (window),
                                              0, // GTK_DIALOG_MODAL,
                                              "Button", 0, NULL);
      gtk_widget_show (dialog);
    }
}

int
main (int   argc,
      char *argv[])
{
  gtk_init (&argc, &argv);
  GtkObject *adj = gtk_adjustment_new (0, 0, 100, 2, 10, 0);
  GtkWidget *hscroll = g_object_new (GTK_TYPE_HSCROLLBAR, "adjustment", adj, NULL);
  GtkWidget *window = g_object_new (GTK_TYPE_WINDOW, "child", hscroll, "default-width", 300, NULL);
  g_signal_connect_object (adj, "value-changed", G_CALLBACK (adj_changed), window, 0);
  gtk_widget_show_all (window);
  gtk_main();
  return 0;
}


// gcc -Wall `pkg-config --cflags --libs gtk+-2.0` rangefocus.c && ./a.out
