Solved

Motif

Posted on 1997-05-22
1
265 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

Independent Software Vendors: 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

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Come and listen to Percona CEO Peter Zaitsev discuss what’s new in Percona open source software, including Percona Server for MySQL (https://www.percona.com/software/mysql-database/percona-server) and MongoDB (https://www.percona.com/software/mongo-…

726 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