#include <gtk/gtk.h>

static gboolean
on_window_draw (GtkWidget *widget, cairo_t *cr)
{
  cairo_translate (cr, 100, 0);
  return FALSE;
}


GtkWidget *
_glade_design_layout_dnd_icon_widget_new (const gchar *icon_name,
                                          const gchar *description)
{
  GtkWidget *window, *box, *label, *icon;
  GdkVisual *visual;

  visual = gdk_screen_get_rgba_visual (gdk_screen_get_default ());
  window = gtk_window_new (GTK_WINDOW_POPUP);
  
  gtk_window_set_type_hint (GTK_WINDOW (window), GDK_WINDOW_TYPE_HINT_DND);
  gtk_window_set_screen (GTK_WINDOW (window), gdk_screen_get_default ());
  gtk_widget_set_visual (window, visual);

  box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 4);
  gtk_container_set_border_width (GTK_CONTAINER (box), 12);

  icon = gtk_image_new_from_icon_name (icon_name, GTK_ICON_SIZE_BUTTON);
  gtk_widget_set_opacity (icon, .8);
  
  label = gtk_label_new (description);

  gtk_box_pack_start (GTK_BOX (box), icon, FALSE, TRUE, 0);
  gtk_box_pack_start (GTK_BOX (box), label, FALSE, TRUE, 0);

  gtk_widget_show_all (box);
  gtk_container_add (GTK_CONTAINER (window), box);

  gtk_widget_set_app_paintable (window, TRUE);
  g_signal_connect (window, "draw", G_CALLBACK (on_window_draw), NULL);

  return window;
}
void
aaa (GtkWidget *check)
{
  gtk_widget_set_sensitive (check, FALSE);
  gtk_widget_set_sensitive (check, TRUE);
}

int main (int argc, char **argv)
{
  GtkWidget *window, *check;

  gtk_init (&argc, &argv);

  //window = _glade_design_layout_dnd_icon_widget_new ("gtk-yes", "Test String");
  window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
  check = gtk_check_button_new ();
  g_signal_connect (check, "toggled", G_CALLBACK (aaa), NULL);
  
  gtk_container_add (GTK_CONTAINER (window), check);
  
  gtk_widget_show_all (window);
  
  gtk_main();
}
