aboutsummaryrefslogtreecommitdiffstats
path: root/demos/modules/gwin/frame/main.c
diff options
context:
space:
mode:
authorJoel Bodenmann <joel@unormal.org>2014-05-10 13:26:13 +0200
committerJoel Bodenmann <joel@unormal.org>2014-05-10 13:26:13 +0200
commit2364f2133330dc0e6702e453b47dcfbd3c44d9cc (patch)
tree101bb82edcbd641d56835acdae65abdd459085d2 /demos/modules/gwin/frame/main.c
parent0a83c21aa20f035911f4247c7c9eff2fa3cb9741 (diff)
downloaduGFX-2364f2133330dc0e6702e453b47dcfbd3c44d9cc.tar.gz
uGFX-2364f2133330dc0e6702e453b47dcfbd3c44d9cc.tar.bz2
uGFX-2364f2133330dc0e6702e453b47dcfbd3c44d9cc.zip
GWIN frame demo - compiling but crashing
Diffstat (limited to 'demos/modules/gwin/frame/main.c')
-rw-r--r--demos/modules/gwin/frame/main.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/demos/modules/gwin/frame/main.c b/demos/modules/gwin/frame/main.c
new file mode 100644
index 00000000..8299bfce
--- /dev/null
+++ b/demos/modules/gwin/frame/main.c
@@ -0,0 +1,47 @@
+#include "gfx.h"
+
+static GListener gl;
+static GHandle ghFrame1;
+
+static void createWidgets(void) {
+ GWidgetInit wi;
+
+ // Apply some default values for GWIN
+ gwinWidgetClearInit(&wi);
+ wi.g.show = TRUE;
+
+ // Apply the frame parameters
+ wi.g.width = 400;
+ wi.g.height = 300;
+ wi.g.y = 10;
+ wi.g.x = 10;
+ wi.text = "Frame 1";
+
+ ghFrame1 = gwinFrameCreate(0, &wi, GWIN_FRAME_BORDER | GWIN_FRAME_CLOSE_BTN | GWIN_FRAME_MINMAX_BTN);
+}
+
+int main(void) {
+ // Initialize the display
+ gfxInit();
+
+ // Set the widget defaults
+ gwinSetDefaultFont(gdispOpenFont("*"));
+ gwinSetDefaultStyle(&WhiteWidgetStyle, FALSE);
+ gdispClear(White);
+
+ // Attach the mouse input
+ gwinAttachMouse(0);
+
+ // create the widget
+ createWidgets();
+
+ // We want to listen for widget events
+ geventListenerInit(&gl);
+ gwinAttachListener(&gl);
+
+ while(1) {
+
+ }
+
+ return 0;
+}