Hello out there,

I throw some code together, to give xou an example. Here it comes:
Code:
BMAP *testPanel = "test.png";
BMAP *mousePointer = "arrow.pcx";

function popupbox_click_event(PANEL* pPanel);
PANEL* popupbox = 
{
	pos_x = 10;
	pos_y = 10;
	bmap = testPanel;
	event = popupbox_click_event;
	flags = VISIBLE;
}

function popupbox_click_event(PANEL* pPanel)
{
	while(mouse_left)
	{
		pPanel.pos_x = mouse_pos.x;
		pPanel.pos_y = mouse_pos.y;
		wait(1);
	}
}

function main() {
	mouse_mode = 2;
	mouse_map = mousePointer;
	while(mouse_mode > 0) {
		vec_set(mouse_pos, mouse_cursor);
		wait(1);
	}
}


This script is tested and works fine for me. I think the problem are this lines of your script:
Code:
popupbox.pos_x += mickey.x;
popupbox.pos_y += mickey.y;


I fairly don't know how to deal with the mickey var, but to set the panel position to the mouse position every frame, is a handy solution as well. Just try it.

Hope it helps in spite of my bad english wink
Gor Na Kosh