1) When creating panels in a function, you have to use the function 'pan_create'. Panel* definitions can only be declared globally.

2) Like point 1, you have to use 'pan_create' function when building a panel at runtime. Also you can only pass constants to certain members of a panel definition.