Example #1
0
void alert(const char *fmt, ...) {
	va_list ap;
	va_start(ap, fmt);
	vsnprintf(internal_buf, BUF_LEN, fmt, ap);
	va_end(ap);

	MessageBox mb;
	mb.set_text(internal_buf);
	mb.add_button(_("&Close"));

	mb.set_icon_from_type(MSGBOX_ICON_TYPE_ALERT);
	mb.set_modal();
	mb.run();
}
Example #2
0
int ask(const char *fmt, ...) {
	char bufer[BUF_LEN];
	va_list ap;

	va_start(ap, fmt);
	vsnprintf(bufer, BUF_LEN - 1, fmt, ap);
	va_end(ap);

	MessageBox mb;
	mb.set_text(bufer);
	mb.add_button(_("&No"));
	mb.add_button(_("&Yes"));

	mb.set_icon_from_type(MSGBOX_ICON_TYPE_QUESTION);
	mb.set_modal();
	int ret = mb.run();
	return (ret > 0 ? ret : 0);
}