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-861f7616d084master
parent
96f1ad47af
commit
d4168f712c
|
@ -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)
|
||||||
|
|
|
@ -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;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue