5 #include "../progress.h" 17 GtkWidget *vbox = gtk_vbox_new(TRUE, 5);
18 GtkWidget *label = gtk_label_new(p->
title);
20 dialog = gtk_window_new(GTK_WINDOW_TOPLEVEL);
23 gtk_box_pack_start(GTK_BOX(vbox), label, TRUE, FALSE, 3);
24 gtk_box_pack_start(GTK_BOX(vbox),
progress, TRUE, TRUE, 3);
26 gtk_container_add(GTK_CONTAINER(
dialog), vbox);
28 gtk_window_set_title(GTK_WINDOW(
dialog),
"perf");
29 gtk_window_resize(GTK_WINDOW(
dialog), 300, 80);
30 gtk_window_set_position(GTK_WINDOW(
dialog), GTK_WIN_POS_CENTER);
32 gtk_widget_show_all(
dialog);
35 gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(
progress), fraction);
36 snprintf(buf,
sizeof(buf),
"%"PRIu64
" / %"PRIu64, p->
curr, p->
total);
37 gtk_progress_bar_set_text(GTK_PROGRESS_BAR(
progress), buf);
40 while (gtk_events_pending())
47 gtk_widget_destroy(
dialog);
static void gtk_ui_progress__finish(void)
static void gtk_ui_progress__update(struct ui_progress *p)
static GtkWidget * progress
void gtk_ui_progress__init(void)
struct ui_progress_ops * ui_progress__ops
void(* update)(struct ui_progress *p)
static struct ui_progress_ops gtk_ui_progress__ops
static GtkWidget * dialog