From b8a6765874054e3f3966896a8763f7352d9ff8f1 Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Tue, 12 Dec 2000 21:49:14 +0000 Subject: progressbar for newt+stdio while loading ramdisk --- mdk-stage1/newt-frontend.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'mdk-stage1/newt-frontend.c') diff --git a/mdk-stage1/newt-frontend.c b/mdk-stage1/newt-frontend.c index 8a057f98e..f5bfae047 100644 --- a/mdk-stage1/newt-frontend.c +++ b/mdk-stage1/newt-frontend.c @@ -114,6 +114,36 @@ void remove_wait_message(void) } +static newtComponent form = NULL, scale = NULL; +static int size_progress; +static int actually_drawn; + +void init_progression(char *msg, int size) +{ + size_progress = size; + actually_drawn = 0; + newtCenteredWindow(70, 5, "Please wait..."); + form = newtForm(NULL, NULL, 0); + newtFormAddComponent(form, newtLabel(1, 1, msg)); + scale = newtScale(1, 3, 68, size); + newtFormAddComponent(form, scale); + newtDrawForm(form); + newtRefresh(); +} + +void update_progression(int current_size) +{ + newtScaleSet(scale, current_size); + newtRefresh(); +} + +void end_progression(void) +{ + newtPopWindow(); + newtFormDestroy(form); +} + + enum return_type ask_from_list_comments(char *msg, char ** elems, char ** elems_comments, char ** choice) { char * items[50]; -- cgit v1.2.1