Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

HELP: How to used XtGetValues??

41 views
Skip to first unread message

Orbital Engine Company

unread,
Mar 15, 1993, 3:06:27 AM3/15/93
to

BACKGROUND: I am writing an application using motif V1.2 running under
X Window R4 on a Data General DG/UX5.4.1 with Motif window manager.

QUESTION: When using XtGetValues, do I need to deallocate the memory of the
resources that was obtained by XtGetValues.

For example: This procedure will scroll the given scroll_window down one page.
The question is whether I would need to deallocate the memory
for the variables: scroll_bar, top, slider_size, etc...

void scroll_down_one_page
(
Widget scroll_window
)
{
Widget scroll_bar;
int n, top, slider_size, increment, pageIncrement,
maximum, minimum;
Arg args[5];

n = 0;
XtSetArg(args[n], XmNverticalScrollBar, &scroll_bar); n++;
XtGetValues(scroll_window, args, n);

n = 0;
XtSetArg(args[n], XmNmaximum, &maximum); n++;
XtSetArg(args[n], XmNminimum, &minimum); n++;
XtGetValues(scroll_bar, args, n);
XmScrollBarGetValues(scroll_bar, &top, &slider_size, &increment,
&pageIncrement);

/* scroll down one page
*/
if (maximum != slider_size)
{
top += pageIncrement;
if (top > (maximum - slider_size))
top = maximum - slider_size;
XmScrollBarSetValues(scroll_bar, top, slider_size,
increment, pageIncrement, True);
}


/* do I need to deallocate any memory used here ??
*/
}

Thanks for any help in advance!!
Kristina

--
Orbital Engine Company (Australia) orb...@DIALix.oz.au
1 Whipple St Tel: (061-09) 441 2311
Balcatta WA 6021
Australia

0 new messages