/* command to compile:
 * gcc `pkg-config --cflags --libs gtk+-3.0` infobar.c -o infobar 
 */

#include <gtk/gtk.h>


void
clicked (GtkWidget *button,
	 GtkWidget *infobar)
{
	gtk_widget_hide (infobar);
	gtk_widget_show (infobar);
}


int main (void) {
	GtkWidget *window;
	GtkWidget *box;
	GtkWidget *infobar = NULL;
	GtkWidget *label;
	GtkWidget *button;

	gtk_init (NULL, NULL);

	window = gtk_window_new (GTK_WINDOW_TOPLEVEL);

	box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
	gtk_widget_show (box);
	gtk_container_add (GTK_CONTAINER (window), box);

	infobar = gtk_info_bar_new ();
	label = gtk_label_new ("Hello !!");
	gtk_widget_show (label);
	gtk_container_add (GTK_CONTAINER (gtk_info_bar_get_content_area (GTK_INFO_BAR (infobar))), label);
	gtk_widget_show (infobar);
	gtk_box_pack_start (GTK_BOX (box), infobar, TRUE, TRUE, 0);

	button = gtk_button_new_with_label ("Cheers !!");
	g_signal_connect (button, "clicked", G_CALLBACK (clicked), infobar);
	gtk_widget_show (button);
	gtk_box_pack_start (GTK_BOX (box), button, TRUE, TRUE, 0);

	gtk_widget_show (window);
	gtk_main();

	return 0;
}
