[BUG?]! subscribeEvent can ignore repeat event regist
Posted: 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 !!!
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 !!!