aboutsummaryrefslogtreecommitdiffstats
path: root/demos
diff options
context:
space:
mode:
Diffstat (limited to 'demos')
-rw-r--r--demos/modules/gwin/widgets/gfxconf.h1
-rw-r--r--demos/modules/gwin/widgets/main.c14
2 files changed, 15 insertions, 0 deletions
diff --git a/demos/modules/gwin/widgets/gfxconf.h b/demos/modules/gwin/widgets/gfxconf.h
index e7e2714e..4ba2c21d 100644
--- a/demos/modules/gwin/widgets/gfxconf.h
+++ b/demos/modules/gwin/widgets/gfxconf.h
@@ -51,6 +51,7 @@
#define GFX_USE_GWIN TRUE
#define GWIN_NEED_WINDOWMANAGER TRUE
+ #define GWIN_NEED_FLASHING TRUE
#define GWIN_NEED_CONSOLE TRUE
#define GWIN_CONSOLE_USE_HISTORY TRUE
diff --git a/demos/modules/gwin/widgets/main.c b/demos/modules/gwin/widgets/main.c
index 80cd6c02..d5bfb6d2 100644
--- a/demos/modules/gwin/widgets/main.c
+++ b/demos/modules/gwin/widgets/main.c
@@ -79,6 +79,8 @@ static const GWidgetStyle YellowWidgetStyle = {
static font_t font;
static GListener gl;
static GHandle ghConsole;
+static GTimer FlashTimer;
+
#if GWIN_NEED_TABSET
static GHandle ghTabset;
#else
@@ -485,6 +487,12 @@ static void setEnabled(bool_t ena) {
//gwinSetEnabled(ghCheckDisableAll, TRUE);
}
+static void FlashOffFn(void *param) {
+ (void) param;
+
+ gwinNoFlash(ghCheckbox3);
+}
+
int main(void) {
GEvent * pe;
@@ -517,6 +525,7 @@ int main(void) {
// We want to listen for widget events
geventListenerInit(&gl);
gwinAttachListener(&gl);
+ gtimerInit(&FlashTimer);
#if !GWIN_NEED_TABSET
// Press the Tab we want visible
@@ -543,6 +552,11 @@ int main(void) {
if (((GEventGWinCheckbox *)pe)->gwin == ghCheckDisableAll) {
gwinPrintf(ghConsole, "%s All\n", ((GEventGWinCheckbox *)pe)->isChecked ? "Disable" : "Enable");
setEnabled(!((GEventGWinCheckbox *)pe)->isChecked);
+
+ // If it is the toggle button checkbox start the flash.
+ } else if (((GEventGWinCheckbox *)pe)->gwin == ghCheckbox3) {
+ gwinFlash(ghCheckbox3);
+ gtimerStart(&FlashTimer, FlashOffFn, 0, FALSE, 3000);
}
break;