XtGetValues on attachments and offsets - Motif

This is a discussion on XtGetValues on attachments and offsets - Motif ; 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 ...

+ Reply to Thread
Results 1 to 2 of 2

Thread: XtGetValues on attachments and offsets

  1. XtGetValues on attachments and offsets



    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

  2. Re: XtGetValues on attachments and offsets

    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

+ Reply to Thread