Events (un)subscriptions within other events processings
Posted: Tue Dec 13, 2005 13:24
Hello all !
I'm currenlty using CEGUI in some GUI. But I recently stumbled over a problem : how to do in the good way some events subscriptions and unsubcriptions resulting from an event subscribed by the same widget...
The very problem is the Event::connectionOrdering map that is being modified during its browsing in the () operator method.
In the first place, to "correct" the issue, I added some basic index test to avoid passing beyond the reality when some event is purelly deleted from the list (on disconnection).
But now, a new configuration proves the inefficiency of such a solution : one event (the only the widget has subscribed to) is fired. During its process, it is disconnected (let's assume my work around could work so far) BUT, then, always during the same process, the widget subscribes the same event again (in fact, just the concerned instance is not the same). So when we're back in the () operator method, the map seems unchanged.
But the end() method test obviously fails, guiding us in another dimension...
Has anyone ever experienced these issues ? Does anything exist (despite my searches) in the CEGUI code to handle those special (un)subscriptions ?
Any help will be appreciated, thanks
I'm currenlty using CEGUI in some GUI. But I recently stumbled over a problem : how to do in the good way some events subscriptions and unsubcriptions resulting from an event subscribed by the same widget...
The very problem is the Event::connectionOrdering map that is being modified during its browsing in the () operator method.
In the first place, to "correct" the issue, I added some basic index test to avoid passing beyond the reality when some event is purelly deleted from the list (on disconnection).
But now, a new configuration proves the inefficiency of such a solution : one event (the only the widget has subscribed to) is fired. During its process, it is disconnected (let's assume my work around could work so far) BUT, then, always during the same process, the widget subscribes the same event again (in fact, just the concerned instance is not the same). So when we're back in the () operator method, the map seems unchanged.
But the end() method test obviously fails, guiding us in another dimension...
Has anyone ever experienced these issues ? Does anything exist (despite my searches) in the CEGUI code to handle those special (un)subscriptions ?
Any help will be appreciated, thanks