CLASS_ATTRIBUTE_STYLE with "file"

Mar 8, 2011 at 11:48am

CLASS_ATTRIBUTE_STYLE with "file"

Is there any sample code for using the CLASS_ATTRIBUTE_STYLE macros with the style “file”?

I’ve grepped & eyballed the sample code without any luck.

All I want to store in my object is a Symbol* that points to the file name. No information about path or file pointers (the file’s supposed to be in the search path). But it might be nifty if I could get the little “Choose…” button in my inspector.

#55394
Mar 14, 2011 at 12:16pm

Here is how it is done in the fpic object:

CLASS_ATTR_SYM(c,"pic",0,t_jfpic,j_sym);
	CLASS_ATTR_ACCESSORS(c,"pic",NULL,jfpic_setattr_pict);
	CLASS_ATTR_DEFAULT_SAVE_PAINT(c,"pic",0,"");
	CLASS_ATTR_STYLE_LABEL(c, "pic", 0, "imagefile", "Image File");

Cheers,
Tim

#199352
Mar 14, 2011 at 5:23pm

Thanks, that gets me started. So, basically, a custom setter is the key. Nice to know about the style “imagefile”.

I don’t suppose there is a way to specify only .PNG files to the file chooser dialog?

#199353

You must be logged in to reply to this topic.