From e07a7b3d0541b152e3d5d1d269b6fcc7e44ff1a7 Mon Sep 17 00:00:00 2001 From: emersion Date: Wed, 15 Jun 2016 18:51:12 +0200 Subject: [PATCH] Adds uiProgressBarValue() in unix --- ui.h | 4 +++- unix/progressbar.c | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ui.h b/ui.h index 85c2d302..0131fe0d 100644 --- a/ui.h +++ b/ui.h @@ -187,8 +187,10 @@ _UI_EXTERN uiSlider *uiNewSlider(int min, int max); typedef struct uiProgressBar uiProgressBar; #define uiProgressBar(this) ((uiProgressBar *) (this)) -// TODO uiProgressBarValue() +_UI_EXTERN int uiProgressBarValue(uiProgressBar *p); _UI_EXTERN void uiProgressBarSetValue(uiProgressBar *p, int n); +_UI_EXTERN int uiProgressBarIndeterminate(uiProgressBar *p); +_UI_EXTERN void uiProgressBarSetindeterminate(uiProgressBar *p, int indeterminate); _UI_EXTERN uiProgressBar *uiNewProgressBar(void); typedef struct uiSeparator uiSeparator; diff --git a/unix/progressbar.c b/unix/progressbar.c index 40306e6c..725a6f5f 100644 --- a/unix/progressbar.c +++ b/unix/progressbar.c @@ -9,6 +9,11 @@ struct uiProgressBar { uiUnixControlAllDefaults(uiProgressBar) +int uiProgressBarValue(uiProgressBar *p) +{ + return (int) (gtk_progress_bar_get_fraction(p->pbar) * 100); +} + void uiProgressBarSetValue(uiProgressBar *p, int value) { if (value < 0 || value > 100)