Add the ability to check if an id is a valid event handler or not.

git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@5844 4a71c877-e1ca-e34f-864e-861f7616d084
master
Freddie Witherden 2008-08-21 16:19:51 +00:00
parent 45ba680eb6
commit 30712505f1
2 changed files with 13 additions and 0 deletions

View File

@ -165,6 +165,11 @@ bool widgetIsA(const widget *self, const classInfo *instanceOf)
return false;
}
bool widgetIsEventHandler(const widget *self, int id)
{
return widgetGetEventHandlerById(self, id) ? true : false;
}
static bool widgetAnimationTimerCallback(widget *self, const event *evt,
int handlerId, void *userData)
{

View File

@ -726,6 +726,14 @@ int widgetAddTimerEventHandler(widget *self, eventType type, int interval,
*/
void widgetRemoveEventHandler(widget *self, int id);
/**
* Returns if id is that of a valid event handler.
*
* @param self The widget to check if id is a valid event handler for.
* @param id The id in question.
*/
bool widgetIsEventHandler(const widget *self, int id);
/**
* Returns the user-data for the event whose id is id.
*