You have to do it in a function after the panel setup.
Panel define can not except variables because they are not set when the panel is created.. Use constants in define and modify with vars in functions after the define.
EDIT-> Also you can not use even simple math operations in a panel define.

Code:
PANEL* pan_this ={
....
pos_x = 1;
}

function main()
{
....
pan_this->pos_x =(sys_metrics(0) - bmap_width(background))/ 2;

....
}



EDIT -> JCL addressed this issue in one of the ask the dev or bug hunt threads and he explains better then me. I couldn't find it quickly to post a link. Hate looking for stuff on this forum, its a blackhole of good information.

Last edited by Malice; 11/08/13 17:47.