Skip to content

Instantly share code, notes, and snippets.

@bert
Created December 19, 2009 15:27
Show Gist options
  • Save bert/260120 to your computer and use it in GitHub Desktop.
Save bert/260120 to your computer and use it in GitHub Desktop.
GTK statusbar push and pop example
Use at your own risk.
Requires:
gtk+-2.0
/*!
* \file on_button_clicked.c
*
* \brief On button clicked callback function.
*/
void
on_button_clicked (GtkButton *button, gpointer user_data)
{
GtkWidget *stat;
guint cont;
stat = lookup_widget (window1, "statusbar1");
cont = gtk_statusbar_get_context_id (stat, "context");
gtk_statusbar_push (stat, cont, "statusbar one");
cont = gtk_statusbar_get_context_id (stat, "context");
gtk_statusbar_push (stat, cont, "statusbar two");
while (gtk_events_pending ())
{
gtk_main_iteration ();
}
gtk_statusbar_pop (stat, cont);
}
/* EOF */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment