Make it possible for an event handler to remove itself.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5527 4a71c877-e1ca-e34f-864e-861f7616d084
master
Freddie Witherden 2008-07-13 15:40:58 +00:00
parent 96f1ad47af
commit d4168f712c
2 changed files with 3 additions and 2 deletions

View File

@ -449,7 +449,7 @@ bool widgetFireCallbacksImpl(widget *self, event *evt)
if (handler->type == evt->type) if (handler->type == evt->type)
{ {
// Fire the callback // Fire the callback
ret = handler->callback(self, evt, handler->userData); ret = handler->callback(self, evt, i, handler->userData);
// Break if the handler returned false // Break if the handler returned false
if (!ret) if (!ret)

View File

@ -31,7 +31,8 @@ typedef struct _eventKey eventKey;
typedef struct _eventText eventText; typedef struct _eventText eventText;
typedef struct _eventMisc eventMisc; typedef struct _eventMisc eventMisc;
typedef bool (*callback) (widget *widget, event *evt, void *userData); typedef bool (*callback) (widget *widget, event *evt, int handlerId,
void *userData);
typedef struct _eventTableEntry eventTableEntry; typedef struct _eventTableEntry eventTableEntry;