PtSetResources

This question is regarding the setting the resources of a widget from code.
After I do a PtSetArg on several resouces, I am having trouble with the
first argument in the PtSetResources function. If I am setting some resource
for some third widget, how do I refer to its widget pointer?

Hello,
If you have given your widget a name you can refer to it with the
ABW_wiget_name in your code.

If this isn’t what you are asking, post a sample of what you want to do.

Regards,
Dave B.

Biren Mehta wrote:

This question is regarding the setting the resources of a widget from code.
After I do a PtSetArg on several resouces, I am having trouble with the
first argument in the PtSetResources function. If I am setting some resource
for some third widget, how do I refer to its widget pointer?

Biren Mehta wrote:

This question is regarding the setting the resources of a widget from code.
After I do a PtSetArg on several resouces, I am having trouble with the
first argument in the PtSetResources function. If I am setting some resource
for some third widget, how do I refer to its widget pointer?

If I understand your question correctly, then the answer is: you don’t.

PtSetArg is simply a macro for setting up one vector of an array of
resource descriptors for a subsequent call to PtSetResources(). If you
want to refer to other widgets you must make multiple calls to
PtSetResources() (i.e. PtSetResources() only targets one widget -
although multiple resources may be modified with one call). I think
that perhaps you were expecting that resource vectors might target a
widget and a resource ? (they don’t)

If you are trying to set a single resource on multiple widgets (I often
do this for “graying out” a group of unselectable items for instance)
then, it is often more convenient to use PtSetResource() (note the lack
of an ‘s’ at the end).

eg (this “grays out” all button widgets in array “buttons”).

PtWidget_t *buttons[10]

… code that instantiates, and assigns buttons[0-10] …

for(i=0;i<10;i++) {
PtSetResource(buttons_, Pt_ARG_FLAGS, Pt_TRUE, Pt_GHOST);
}_