WID comments
[Lilanci.git] / widget.h
blob2e137b70052cc89c550a287c8faf2cc2f5b2614e
1 #ifndef __WIDGET_H_INCLUDED
2 #define __WIDGET_H_INCLUDED
3 #define EVENT_LENGTH 8
6 typedef struct _TEventHandler{
7 char event[EVENT_LENGHT];
8 void *userdata;
9 int (*handler)(struct _TWidget *widget, void *data, void *userdata);
10 struct _TEventHandler *next;
11 }TEventHandler;
13 typedef struct _TWidget{
14 TEventHandler *handlers; //linked list of TEventHandler terminated by ->next==0
15 void *data;
16 }TWidget;
18 int HandleEvent(TWidget *widget, char event[EVENT_LENGHT], void *data);
19 void AddHandler(TWidget *widgetm char event[EVENT_LENGHT], int (*handler)(TWidget *widget, void *data, void *userdata), void *userdata);
20 #endif