You can change pos_x in a function, like this:

PANEL* panelname = { .... }

var x = 10;

...
panelname.pos_x = x;