diff -ruN dialog-1.0-20051005/dialog.h dialog-1.0-20051005-gauge/dialog.h
--- dialog-1.0-20051005/dialog.h	2004-12-20 01:01:11.000000000 +0100
+++ dialog-1.0-20051005-gauge/dialog.h	2005-10-30 11:47:07.000000000 +0100
@@ -459,6 +459,12 @@
 extern int dialog_form(const char *title, const char *cprompt, int height, int width, int form_height, int item_no, char **items);
 extern int dialog_fselect(const char *title, const char *path, int height, int width);
 extern int dialog_gauge(const char *title, const char *cprompt, int height, int width, int percent);
+
+/* persistent gauge dialog updatable from C program */
+extern int dialog_gauge_create(const char *title, const char *prompt, int height, int width, int percent);
+extern int dialog_gauge_update(const char *title, const char *prompt, int percent);
+extern int dialog_gauge_destroy();
+
 extern int dialog_pause(const char *title, const char *cprompt, int height, int width, int seconds);
 extern int dialog_inputbox(const char *title, const char *cprompt, int height, int width, const char *init, const int password);
 extern int dialog_menu(const char *title, const char *cprompt, int height, int width, int menu_height, int item_no, char **items);
diff -ruN dialog-1.0-20051005/guage.c dialog-1.0-20051005-gauge/guage.c
--- dialog-1.0-20051005/guage.c	2005-09-12 01:48:26.000000000 +0200
+++ dialog-1.0-20051005-gauge/guage.c	2005-10-30 11:51:24.000000000 +0100
@@ -223,3 +223,147 @@
     dlg_del_window(dialog);
     return (DLG_EXIT_OK);
 }
+
+static int gauge_x, gauge_y;
+static WINDOW *gauge_dialog;
+static int gauge_h, gauge_w;
+
+int
+dialog_gauge_create(const char *title,
+	     const char *prompt,
+	     int height,
+	     int width,
+	     int percent)
+{
+    int i;
+
+    curs_set(0);
+
+    gauge_h = height;
+    gauge_w = width;
+
+    dlg_auto_size(title, prompt, &gauge_h, &gauge_w, MIN_HIGH, MIN_WIDE);
+    dlg_print_size(gauge_h, gauge_w);
+    dlg_ctl_size(gauge_h, gauge_w);
+
+    /* center gauge_dialog box on screen */
+    gauge_x = dlg_box_x_ordinate(gauge_w);
+    gauge_y = dlg_box_y_ordinate(gauge_h);
+
+    gauge_dialog = dlg_new_window(gauge_h, gauge_w, gauge_y, gauge_x);
+
+	(void) werase(gauge_dialog);
+	dlg_draw_box(gauge_dialog, 0, 0, gauge_h, gauge_w, dialog_attr, border_attr);
+
+	dlg_draw_title(gauge_dialog, title);
+
+	wattrset(gauge_dialog, dialog_attr);
+	dlg_print_autowrap(gauge_dialog, prompt, gauge_h, gauge_w);
+
+	dlg_draw_box(gauge_dialog,
+		     gauge_h - 4, 2 + MARGIN,
+		     2 + MARGIN, gauge_w - 2 * (2 + MARGIN),
+		     dialog_attr,
+		     border_attr);
+
+	/*
+	 * Clear the area for the progress bar by filling it with spaces
+	 * in the title-attribute, and write the percentage with that
+	 * attribute.
+	 */
+	(void) wmove(gauge_dialog, gauge_h - 3, 4);
+	wattrset(gauge_dialog, title_attr);
+
+	for (i = 0; i < (gauge_w - 2 * (3 + MARGIN)); i++)
+	    (void) waddch(gauge_dialog, ' ');
+
+	(void) wmove(gauge_dialog, gauge_h - 3, (gauge_w / 2) - 2);
+	(void) wprintw(gauge_dialog, "%3d%%", percent);
+
+	/*
+	 * Now draw a bar in reverse, relative to the background.
+	 * The window attribute was useful for painting the background,
+	 * but requires some tweaks to reverse it.
+	 */
+	gauge_x = (percent * (gauge_w - 2 * (3 + MARGIN))) / 100;
+	if ((title_attr & A_REVERSE) != 0) {
+	    wattroff(gauge_dialog, A_REVERSE);
+	} else {
+	    wattrset(gauge_dialog, A_REVERSE);
+	}
+	(void) wmove(gauge_dialog, gauge_h - 3, 4);
+	for (i = 0; i < gauge_x; i++) {
+	    chtype ch = winch(gauge_dialog);
+	    if (title_attr & A_REVERSE) {
+		ch &= ~A_REVERSE;
+	    }
+	    (void) waddch(gauge_dialog, ch);
+	}
+
+	(void) wrefresh(gauge_dialog);
+}
+
+int
+dialog_gauge_update(const char *title, const char *prompt, int percent)
+{
+    int i;
+
+	(void) werase(gauge_dialog);
+	dlg_draw_box(gauge_dialog, 0, 0, gauge_h, gauge_w, dialog_attr, border_attr);
+
+	dlg_draw_title(gauge_dialog, title);
+
+	wattrset(gauge_dialog, dialog_attr);
+	dlg_print_autowrap(gauge_dialog, prompt, gauge_h, gauge_w);
+
+	dlg_draw_box(gauge_dialog,
+		     gauge_h - 4, 2 + MARGIN,
+		     2 + MARGIN, gauge_w - 2 * (2 + MARGIN),
+		     dialog_attr,
+		     border_attr);
+
+	/*
+	 * Clear the area for the progress bar by filling it with spaces
+	 * in the title-attribute, and write the percentage with that
+	 * attribute.
+	 */
+	(void) wmove(gauge_dialog, gauge_h - 3, 4);
+	wattrset(gauge_dialog, title_attr);
+
+	for (i = 0; i < (gauge_w - 2 * (3 + MARGIN)); i++)
+	    (void) waddch(gauge_dialog, ' ');
+
+	(void) wmove(gauge_dialog, gauge_h - 3, (gauge_w / 2) - 2);
+	(void) wprintw(gauge_dialog, "%3d%%", percent);
+
+	/*
+	 * Now draw a bar in reverse, relative to the background.
+	 * The window attribute was useful for painting the background,
+	 * but requires some tweaks to reverse it.
+	 */
+	gauge_x = (percent * (gauge_w - 2 * (3 + MARGIN))) / 100;
+	if ((title_attr & A_REVERSE) != 0) {
+	    wattroff(gauge_dialog, A_REVERSE);
+	} else {
+	    wattrset(gauge_dialog, A_REVERSE);
+	}
+	(void) wmove(gauge_dialog, gauge_h - 3, 4);
+	for (i = 0; i < gauge_x; i++) {
+	    chtype ch = winch(gauge_dialog);
+	    if (title_attr & A_REVERSE) {
+		ch &= ~A_REVERSE;
+	    }
+	    (void) waddch(gauge_dialog, ch);
+	}
+
+	(void) wrefresh(gauge_dialog);
+}
+
+
+int
+dialog_gauge_destroy()
+{
+    curs_set(1);
+    dlg_del_window(gauge_dialog);
+    return (DLG_EXIT_OK);
+}

