aboutsummaryrefslogtreecommitdiffstats
path: root/demos/modules/gwin/widgets/main.c
diff options
context:
space:
mode:
authorJoel Bodenmann <joel@unormal.org>2014-04-23 23:41:50 +0200
committerJoel Bodenmann <joel@unormal.org>2014-04-23 23:41:50 +0200
commit1fc155b6b09b19a8b62f50456cce5fc73e87dafa (patch)
treeda59ffe0c37dcbfbc7953ab859c0e53732dc8cc8 /demos/modules/gwin/widgets/main.c
parent5c3779cf79616539840baae000797a731ed43127 (diff)
downloaduGFX-1fc155b6b09b19a8b62f50456cce5fc73e87dafa.tar.gz
uGFX-1fc155b6b09b19a8b62f50456cce5fc73e87dafa.tar.bz2
uGFX-1fc155b6b09b19a8b62f50456cce5fc73e87dafa.zip
Fixed progressbar in widgets demo
Diffstat (limited to 'demos/modules/gwin/widgets/main.c')
-rw-r--r--demos/modules/gwin/widgets/main.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/demos/modules/gwin/widgets/main.c b/demos/modules/gwin/widgets/main.c
index ae533697..a9840174 100644
--- a/demos/modules/gwin/widgets/main.c
+++ b/demos/modules/gwin/widgets/main.c
@@ -267,7 +267,6 @@ static void createWidgets(void) {
wi.g.x = 20; wi.text = "Progressbar 1";
ghProgressbar1 = gwinProgressbarCreate(0, &wi);
gwinProgressbarSetResolution(ghProgressbar1, 10);
- gwinProgressbarStart(ghProgressbar1, 500);
// Console - we apply some special colors before making it visible
wi.g.width = ScrWidth/2-1; wi.g.height = ScrHeight/2-1;
@@ -306,6 +305,10 @@ static void setTab(GHandle tab) {
gwinSetVisible(ghImage1, FALSE);
gwinSetVisible(ghProgressbar1, FALSE);
+ // Stop the progress bar
+ gwinProgressbarStop(ghProgressbar1);
+ gwinProgressbarReset(ghProgressbar1);
+
/* Turn on widgets depending on the tab selected */
if (tab == ghTabButtons) {
gwinSetVisible(ghButton1, TRUE);
@@ -338,6 +341,9 @@ static void setTab(GHandle tab) {
gwinSetVisible(ghImage1, TRUE);
} else if (tab == ghTabProgressbar) {
gwinSetVisible(ghProgressbar1, TRUE);
+
+ // Start the progress bar
+ gwinProgressbarStart(ghProgressbar1, 500);
}
}