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

GtkWidget *window;
GtkWidget *vbox;
GtkWidget *statusbar;
guint flash_context_id = -1;
guint flash_message_id = -1;

gboolean
timeout_cb (gpointer data)
{
  if (flash_context_id != -1 &&
      flash_message_id != -1)
    gtk_statusbar_remove (GTK_STATUSBAR (statusbar),
		  flash_context_id,
		  flash_message_id);


  return FALSE;
}

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

  window = gtk_window_new(GTK_WINDOW_TOPLEVEL);

  gtk_window_maximize (GTK_WINDOW (window));
  gtk_widget_show(window);

  statusbar = gtk_statusbar_new ();
  vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 5);  
  gtk_box_pack_start(GTK_BOX (vbox), statusbar, FALSE, FALSE, 5);
  gtk_container_add(GTK_CONTAINER(window), vbox);
  gtk_widget_show(vbox);
  gtk_widget_show(statusbar);

  flash_context_id = gtk_statusbar_get_context_id (GTK_STATUSBAR (statusbar),
		  "Loading");

  /* This will trigger the bug */
  flash_message_id = gtk_statusbar_push (GTK_STATUSBAR (statusbar),
		  flash_context_id, "loading file...");

  g_timeout_add_seconds (3, timeout_cb, NULL);

  gtk_main();

  return 0;
}

