Events are being fired WAY too much

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
Rayoom
Just popping in
Just popping in
Posts: 11
Joined: Sat Apr 30, 2005 03:27
Contact:

Events are being fired WAY too much

Postby Rayoom » Wed Jul 13, 2005 22:40

I have two pages/screens, and two buttons to flip back and forth between them (the two layouts).

I am using

Code: Select all

subscribeEvent(
      CEGUI::PushButton::EventClicked,CEGUI::Event::Subscriber(
      &CLoginState::handleSkipLogin,this));


Each time I go from the first page to the second, this event is being fired way too many times.

It goes some like this:
# of clicks vs. # of times handleSkipLogin() is called
1 | 1
4 | 20
5 | 50
6 | 130
7 | 330+

At this point it takes a few seconds until the second screen pops up. I've got no idea whats going on :shock: .

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

Re: Events are being fired WAY too much

Postby lindquist » Wed Jul 13, 2005 23:05

Sounds like you're calling subscribeEvent (like you posted) from somewhere within your event handler.
You can register the same callback twice and it will be called twice.

Otherwise you would have to be doing some pretty crazy ;) stuff with your mouse button event injections...

HTH

User avatar
Rayoom
Just popping in
Just popping in
Posts: 11
Joined: Sat Apr 30, 2005 03:27
Contact:

Re: Events are being fired WAY too much

Postby Rayoom » Thu Jul 14, 2005 01:19

Thanks, that's pretty much what I was doing.

Each layout has it's own state and each state has an enter and exit function, I was doing all my Subscribing in the Enter() function, whoops :).

Thank you for the help.


Return to “Modifications / Integrations / Customisations”

Who is online

Users browsing this forum: No registered users and 6 guests