summaryrefslogtreecommitdiff
path: root/src/widget
diff options
context:
space:
mode:
Diffstat (limited to 'src/widget')
-rw-r--r--src/widget/widget_catchkey.c4
-rw-r--r--src/widget/widget_catchkey.h7
2 files changed, 7 insertions, 4 deletions
diff --git a/src/widget/widget_catchkey.c b/src/widget/widget_catchkey.c
index afdac23..099a4e9 100644
--- a/src/widget/widget_catchkey.c
+++ b/src/widget/widget_catchkey.c
@@ -6,7 +6,7 @@
#include "font.h"
#include "widget_catchkey.h"
-widget_catchkey_t* newWidgetCatchkey(int key, int x, int y)
+widget_catchkey_t* newWidgetCatchkey(int key, int x, int y, void *event)
{
widget_catchkey_t *new;
@@ -15,6 +15,7 @@ widget_catchkey_t* newWidgetCatchkey(int key, int x, int y)
new->x = x;
new->y = y;
new->key = key;
+ new->fce_event = event;
return new;
}
@@ -94,6 +95,7 @@ void eventWidgetCatchkey(widget_catchkey_t *p)
if( key != WIDGET_CATCHKEY_NOKEY )
{
p->key = key;
+ p->fce_event(p);
}
}
}
diff --git a/src/widget/widget_catchkey.h b/src/widget/widget_catchkey.h
index 0b8b080..d5f9a36 100644
--- a/src/widget/widget_catchkey.h
+++ b/src/widget/widget_catchkey.h
@@ -5,8 +5,8 @@
#include "main.h"
-#define WIDGET_CATCHKEY_WIDTH 64
-#define WIDGET_CATCHKEY_HEIGHT 32
+#define WIDGET_CATCHKEY_WIDTH 110
+#define WIDGET_CATCHKEY_HEIGHT 12
#define WIDGET_CATCHKEY_NOKEY -1
@@ -16,9 +16,10 @@ typedef struct widget_catchkey_struct
int w, h;
int key;
bool_t active;
+ void (*fce_event)(void *p);
} widget_catchkey_t;
-extern widget_catchkey_t* newWidgetCatchkey(int key, int x, int y);
+extern widget_catchkey_t* newWidgetCatchkey(int key, int x, int y, void *event);
extern int getWidgetCatchKey(widget_catchkey_t *p);
extern void setWidgetCatchKey(widget_catchkey_t *p, int key);
extern void drawWidgetCatchkey(widget_catchkey_t *p);