Events (un)subscriptions within other events processings

For help with anything that CEGUI doesn't offer straight out-of-the-box, e.g.:
- Implementation of new features, such as new Core classes, widgets, WindowRenderers, etc. ...
- Modification of any existing features for specific purposes
- Integration of CEGUI in new engines or frameworks and writing of new plugins (Renderer, Parser, ...) or modules

Moderators: CEGUI MVP, CEGUI Team

User avatar
vinnythetrue
Not too shy to talk
Not too shy to talk
Posts: 21
Joined: Wed Aug 10, 2005 10:29

Events (un)subscriptions within other events processings

Postby vinnythetrue » 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

User avatar
vinnythetrue
Not too shy to talk
Not too shy to talk
Posts: 21
Joined: Wed Aug 10, 2005 10:29

Re: Events (un)subscriptions within other events processings

Postby vinnythetrue » Thu Dec 15, 2005 17:04

Come'on guys ! No one here experienced such issues ? :cry:

User avatar
lindquist
CEGUI Team (Retired)
Posts: 770
Joined: Mon Jan 24, 2005 21:20
Location: Copenhagen, Denmark

Re: Events (un)subscriptions within other events processings

Postby lindquist » Fri Dec 16, 2005 00:59

do the un-subscription safely outside of the event handler.

thing is you've hit a spot where CEGUI could use improvement, and this takes time.

you're free to submit a patch with a workaround. CEGUI is after all open-source...


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 5 guests