Re: [Pipmak-Devel] mouseloc() crash: Bug in loadnode?
Status: Alpha
Brought to you by:
cwalther
From: Christian W. <cwa...@gm...> - 2007-07-25 14:45:59
|
Andrea Viarengo wrote: > 1.lua > panel { " image.png",....} > posx,posy=pipmak.mouseloc() > pipmak.print(posx," ",posy) > > Pipmak crash with access violation (this not happen with pipmak.clickloc() ) > > I'm investigated a little: > > The access violation is caused by member-method thisCNode->mouseXYtoHV > which it isn't initialized as all of the methods of CNode > at time of calling mouselocLua()! Good catch. You're right that there may be more bugs of that kind. The problem is that I can't initialize the methods before running node.lua because I don't know what kind of node it is yet. The only simple solution I can imagine is returning (0, 0) or something from pipmak.mouseloc() as long as thisCNode->complete == 0. Or perhaps undefining pipmak.mouseloc altogether in that context would be even better. Otherwise we'd have to redesign the whole node loading process. Do you have a better idea? Is there a real-life reason why you want to query the mouse location in node.lua, or are you just trying to break things? Could what you're doing be moved to onenternode? -Christian |