Elena Sebe
|
"Expression must be constant" error within custom widget resource table
|
Elena Sebe
05/12/2010 2:42 PM
post54404
|
"Expression must be constant" error within custom widget resource table
Hello,
I'm trying to add two new resources to a custom widget, but getting an "expression must be constant" error.
My resource table looks like this (and this is what the compiler is complaining about):
...
CQ_ARG_NORMAL_COLOR, Pt_CHANGE_INTERIOR, 0,
Pt_ARG_IS_NUMBER( CqNumberWidget_t, my_normal_color[0] ), 0,
CQ_ARG_NORMAL_FILL_COLOR, Pt_CHANGE_INTERIOR, 0,
Pt_ARG_IS_NUMBER(CqNumberWidget_t, my_normal_color[1] ), 0,
...
In the defaults function I set the resource to
w->my_normal_color[0] = Pg_GREEN;
w->my_normal_color[1] = Pg_TRANSPARENT ;
And in the header file I define the resource:
#define CQ_ARG_NORMAL_COLOR Pt_RESOURCES( Pt_USER( 2 ), 14 )
#define CQ_ARG_NORMAL_FILL_COLOR Pt_RESOURCES( Pt_USER( 2 ), 15 )
/* Widget instance structure */
typedef struct
{
...
int my_normal_color[2];
...
} CqNumberWidget_t;
Any help would be appreciated.
Thanks,
Elena
|
|
|