I'm working on a click-n-drag feature for a specific panel, and I wrote this code:
function popupbox_click_event();
PANEL* popupbox =
{
bmap = popupbox_map;
layer = 4;
event = popupbox_click_event;
}
function popupbox_click_event()
{
while(mouse_left)
{
popupbox.pos_x += mickey.x;
popupbox.pos_y += mickey.y;
wait(1);
}
}
It doesn't work. If I am dragging the mouse AS I click on it, it moves a few pixels in the direction the mouse was moving. That's evidence to me that the while() loop ran, but only once. I've tried proc_mode = PROC_GLOBAL; as well as changing the loop to while(1) just for experimentation's sake. It's also true that freeze_mode = 1 when this function runs, but using proc_mode = PROC_NOFREEZE didn't work either. Even worse, if I add a wait(1) to the beginning of the event function, nothing happens at all. So it looks like the engine only gets one frame into the function and then stops for an unknown reason. This looks like a bug to me.
The panel event sample in the manual only sets some values, which would only take one frame anyway, so I couldn't test it to see if it would work. If you need any more information ask away. I am using A8.10 Free.