Solved

Motif

Posted on 1997-05-22
1
262 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to monitor remote shell execution on linux 9 104
twoTwo  challenge 35 107
How to convert MFC::CString to UTF8 wchar_t* 10 281
Way to decrease size of apk file 9 87
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.

839 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