Skip to content

Commit

Permalink
Fix timer example code from faulty push
Browse files Browse the repository at this point in the history
  • Loading branch information
cody271 committed Aug 26, 2017
1 parent cccf2f7 commit 505d079
Showing 1 changed file with 0 additions and 31 deletions.
31 changes: 0 additions & 31 deletions examples/timer/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include "../../ui.h"

uiMultilineEntry *e;
int n = 0, n2 = 0;

int sayTime(void *data)
{
Expand All @@ -15,37 +14,8 @@ int sayTime(void *data)
s = ctime(&t);

uiMultilineEntryAppend(e, s);
n++;
return n < 5;
}

int sayTime42(void *data)
{
uiMultilineEntryAppend(e, "42!\n");
return 1;
}
/*
[] 0
+[1] 1
+[1, 2] 2
-[2] 1
+[2, 3] FAIL
*/
int sayTime5(void *data)
{
time_t t;
char *s;

t = time(NULL);
s = ctime(&t);

uiMultilineEntryAppend(e, s);
n2++;
if (n2 == 2)
uiTimer(1500, sayTime42, NULL);
return n2 < 3;
}

int onClosing(uiWindow *w, void *data)
{
Expand Down Expand Up @@ -86,7 +56,6 @@ int main(void)
uiBoxAppend(b, uiControl(e), 1);

uiTimer(1000, sayTime, NULL);
uiTimer(5000, sayTime5, NULL);

uiWindowOnClosing(w, onClosing, NULL);
uiControlShow(uiControl(w));
Expand Down

0 comments on commit 505d079

Please sign in to comment.