ATTR_SET_OPAQUE_USER and attribute style

Sep 2, 2011 at 2:26pm

ATTR_SET_OPAQUE_USER and attribute style

I’m puzzling with attributes today

I try to to create a few attributes that the user can see in the inspector, but cannot change, I do that with ATTR_SET_OPAQUE_USER.
I would still like to control how to these attributes are displayed in the inspector. I tried to do to that with: CLASS_ATTR_STYLE_LABEL and another one with CLASS_ATTR_ENUMINDEX.

It seems that as soon I as I set the ATTR_SET_OPAQUE_USER the CLASS_ATTR_STYLE_LABEL and CLASS_ATTR_ENUMINDEX commands are ignored and the attribute is displayed as a number in the inspector.

Is this expected behaviour? if so: is there a workaround?

and related: what does the ATTR_SET_OPAQUE flag do? it seems that I can still set the value in the inspector and from max messages, is that correct?


Sep 2, 2011 at 3:43pm


for what you want to achieve that is perfect ;-)


Sep 2, 2011 at 3:59pm

Thanks, I am also using that, but for attributes that are not ‘active’ at the moment. So I think this has a different use. I also want to know where the other flags are for and how to use them properly..

Still I also have an issue with that and that is that I can still change the attribute with a max messages even though it is set to disabled


Sep 2, 2011 at 4:34pm


oops … indeed very interesting question ; i joined an example to illustrate the problem i have too.


Sep 3, 2011 at 5:17pm

Since it’s an opaque attribute is usually not meant to be seen. I can confirm the behavior although it is unlike to change in the foreseeable future.

However, if you set the attribute with the flags bellow it shouldn’t respond to a message:

CLASS_ATTR_LONG(c, "yourattr", flags, t_yourobject, somevariable);

Sep 5, 2011 at 6:04pm

Ok that part is now clear emmanuel, thanks

However… I've tried out different flags and attribute settings and I don't fully understand what they do. I included the c-file and a table with my findings, I hope it's clear, let me know if that's not the case

seems to do nothing, it is supposed to disable setting from max and from a c message, but I can still do that (with a message box, or in c with object_attr_setparse for example)

does what it should, disabling setting it from max (with message and inspector)

- object_attr_setdisabled
doesn't seem to do anything but greying out the name, the value is still settable with message, inspector and c method, is that correct?

this removes the message option to set the value, why?

- bonus question:
how can you query an attribute from an object?
is that done with with something like? class_attr_getvalueof? (I only found class_attr_attr_getvalueof)


  1. attrtestertimo.c
Sep 5, 2011 at 6:06pm

@vanille béchamel:
well-illustrated, btw, you might like the “onoff’ style: CLASS_ATTR_STYLE(c,”attrname”, 0, “onoff”);


You must be logged in to reply to this topic.