#include "gtweakui.h"
#include "notice.h"

void notice(char *message, gpointer list) {
	GladeXML *no;
	GtkWidget *n, *vbox, *hbox, *image, *label;
	GSList *slist;

	if (list != NULL) {
		no = glade_xml_new(file("notice.glade"), NULL, NULL);
		xsc (no, "close_button", "clicked", gtk_main_quit, NULL);
		gsc(xmlg(no, "notice"), "delete_event", gtk_main_quit, NULL);
		vbox = xmlg(no, "information_vbox");
		gtk_label_set_text(GTK_LABEL(xmlg(no, "message")), message);
		for (slist = list; slist; slist = slist->next) {
			image = gtk_image_new_from_file (file("bullet.png")); 
			label = gtk_label_new(_(slist->data));
			gtk_misc_set_alignment(GTK_MISC(label), 0, .5);
			hbox = gtk_hbox_new(FALSE, 2);
			gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0);
			gtk_box_pack_start(GTK_BOX(hbox), label, TRUE, TRUE, 0);
			gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
		}
		gtk_widget_show_all(xmlg(no, "notice"));
	}
}
