1 #ifndef __WIDGET_H_INCLUDED
2 #define __WIDGET_H_INCLUDED
6 typedef struct _TEventHandler
{
7 char event
[EVENT_LENGHT
];
9 int (*handler
)(struct _TWidget
*widget
, void *data
, void *userdata
);
10 struct _TEventHandler
*next
;
13 typedef struct _TWidget
{
14 TEventHandler
*handlers
; //linked list of TEventHandler terminated by ->next==0
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
);