[BUG?]! subscribeEvent can ignore repeat event regist

If you found a bug in our library or on our website, please report it in this section. In this forum you can also make concrete suggestions or feature requests.

Moderators: CEGUI MVP, CEGUI Team

koria
Just popping in
Just popping in
Posts: 17
Joined: Mon May 19, 2008 09:16

[BUG?]! subscribeEvent can ignore repeat event regist

Postby koria » Thu Jan 07, 2010 06:36

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 !!!

User avatar
CrazyEddie
CEGUI Project Lead
Posts: 6760
Joined: Wed Jan 12, 2005 12:06
Location: England
Contact:

Re: [BUG?]! subscribeEvent can ignore repeat event regist

Postby CrazyEddie » Thu Jan 07, 2010 10:06

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.

koria
Just popping in
Just popping in
Posts: 17
Joined: Mon May 19, 2008 09:16

Re: [BUG?]! subscribeEvent can ignore repeat event regist

Postby koria » Thu Jan 07, 2010 10:47

so we need to manager these infos what eventname and functionname in our app ?
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 9 guests