Solved

Motif

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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

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. …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…

746 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now