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

XtGetValues on attachments and offsets

2 views
Skip to first unread message

Matthew Buckley

unread,
Aug 2, 2008, 12:27:53 AM8/2/08
to

I am attempting to change the size and position of an arbitrary XmText
widget.
In order to do this, I am trying to get the left attachment and offset of
the widget,
and, depending on the attachment type, add a value and XtSetValues() the new
location.

Unfortunately, the XmNleftAttachment and XmNleftOffset attributes always
seem
to return 0, no matter how the widget is attached. I made seven textboxes,
using
all of the options, and called the following code on each one:

CODE ==================================================

ac = 0;
XtSetArg(args[ac], XmNleftOffset, &leftoffset); ac++;
XtSetArg(args[ac], XmNleftAttachment, &leftattach); ac++;
XtSetArg(args[ac], XmNx, &x); ac++;
XtSetArg(args[ac], XmNy, &y); ac++;
XtSetArg(args[ac], XmNwidth, &width); ac++;
XtSetArg(args[ac], XmNheight, &height); ac++;
XtGetValues( w, args, ac );


text = XmTextGetString(w);
printf("%-20s x: %3i y: %3i width: %3i height: %3i offset: %3i att:
%3i\n",
text,x,y,width,height, leftoffset, leftattach);
XtFree(text);


OUTPUT ===============================================
opposite form x: 41 y: 520 width: 198 height: 30 offset: 0 att:
0
self x: 39 y: 479 width: 198 height: 30 offset: 0 att:
0
position x: 39 y: 440 width: 198 height: 30 offset: 0 att:
0
widget x: 39 y: 396 width: 198 height: 30 offset: 0 att:
0
opposite widget x: 37 y: 349 width: 198 height: 30 offset: 0 att:
0
none x: 35 y: 82 width: 198 height: 30 offset: 0 att:
0
form x: 34 y: 40 width: 198 height: 30 offset: 0 att:
0

=====================================================

Also, when I attempted to change leftoffset, it didn't seem to do anything.

Am I doing this wrong? Are those values impossible to change at runtime?

Thanks a lot,
Matt

Matthew Buckley

unread,
Aug 2, 2008, 9:15:43 PM8/2/08
to
Never mind. My code was generated from UIL, and I somehow failed to notice
that all of the attachments were being made later than I expected.

Thanks,
Matt

0 new messages