dear CE, how are you .
i found subscribeEvent a eventname and a function over 1 times. when the event happend to call fireEvent_impl. this will call the function over 1 times . In fact, we only hope the function call once when the event happens.
some code like this: i do it use lua.
local wmgr = CEGUI.WindowManagerBase_getSingleton()
local itemgrid = wmgr:getWindow("itempanel/iteminfo/grids")
itemgrid :regEvent("MouseClick","item_move_pickup") ---fist time regist event ,right
itemgrid :regEvent("MouseClick","item_move_pickup") ---in fact ,this regist event should be ignore
itemgrid :regEvent("MouseClick","item_move_pickup") ---in fact ,this regist event should be ignore
itemgrid :regEvent("MouseClick","item_move_pickup") ---in fact ,this regist event should be ignore
when MouseClick event happends, function named "item_move_pickup" in a lua file , will be called 4 times in one MouseClick eventargs.
On these occasions, "item_move_pickup" function must be call 1 times, not 4 times , or it will be a bug.
i am sorry for my poor english . i am chinese guys .
can you take a notice at this question ?
thanks a lot !!!
[BUG?]! subscribeEvent can ignore repeat event regist
Moderators: CEGUI MVP, CEGUI Team
- CrazyEddie
- CEGUI Project Lead
- Posts: 6760
- Joined: Wed Jan 12, 2005 12:06
- Location: England
- Contact:
Re: [BUG?]! subscribeEvent can ignore repeat event regist
Hi,
This is not a bug as such. It's just the way things are. Within CEGUI there is no way of testing that function 'x' has been subscribed to event 'y', so the app needs to deal with that, since the app has that information. This is also the reason for the use of a connection object, rather than an 'unsubscribe' function - such a thing is not easily achieved using the current events mechanism.
HTH
CE.
This is not a bug as such. It's just the way things are. Within CEGUI there is no way of testing that function 'x' has been subscribed to event 'y', so the app needs to deal with that, since the app has that information. This is also the reason for the use of a connection object, rather than an 'unsubscribe' function - such a thing is not easily achieved using the current events mechanism.
HTH
CE.
Useful Links: Forum Guidelines | Documentation | Tutorials | HOWTO | Videos | Donate to CEGUI | CEGUI Twitter
Re: [BUG?]! subscribeEvent can ignore repeat event regist
so we need to manager these infos what eventname and functionname in our app ?
yes .
now i got your mind
thanks a lot!
yes .
now i got your mind
thanks a lot!
Return to “Bug Reports, Suggestions, Feature Requests”
Who is online
Users browsing this forum: No registered users and 1 guest