Solved

Motif

Posted on 1997-05-22
1
263 Views
Last Modified: 2013-12-26
This should be an easy one, I am using rapidapp for the SGI to create an GUI.  Anyhow what I need to know is how to get the state of a checkbox?  I tried

Boolean bool;
bool=XmNset(_head);

where _head is the name of the checkbox (widget?)

and get the following error

error(3201): expression must have (pointer-to-)

Thanks
0
Comment
Question by:micah
1 Comment
 

Accepted Solution

by:
vpl earned 20 total points
ID: 1293057
micah,

Try this:

===================================
Boolean bool;          
Arg al[1];
int ac=0;

XtSetArg(al[ac],XmNset,&bool); ac++;
XtGetValues(_head,al,ac);
====================================

XtGetValues obtains resource values from a widget.
The first argument is the widget from which to get
values, the second argument is an array of resource-
value pairs, and the third argument is the number
of elements in this array. In the case of XtGetValues,
each resource-value pair consists of a resource name
and the address of a variable in which to place the
value of this resource. When the function returns,
the values of all of the named resources should have
been copied into the appropriate variables whose
addresses were provided.

The call to XtSetArg fills one element of the Arg
array with such a resource-value pair. The first
argument is an element of the Arg array, the second
argument is the resource name, and the third argument
is the address of a variable in which to hold the
value of the named resource.

So, in your particular case, we create an Arg array
with one resource-value pair: XmNset and &bool. We
then call XtGetValues for the widget _head with this
Arg array. This causes the value of _head's XmNset
resource to be placed in bool.

vpl
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

679 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question