[comp.windows.x.motif] XmATTACH_OPPOSITE_FORM

argv@Eng.Sun.COM (Dan Heller) (09/28/90)

I have yet to find a purpose for this value.  Can someone lend
a hand?

-- 
dan
----------------------------------------------------
O'Reilly && Associates   argv@sun.com / argv@ora.com
Opinions expressed reflect those of the author only.

krs0@GTE.COM (Rod Stephens) (09/28/90)

In article <9009280016.AA05259@turnpike.Eng.Sun.COM> <argv@Sun.COM> writes:
>I have yet to find a purpose for this value.  Can someone lend
>a hand?

I have used this to align 2 columns, one of labels and one of text. I
wanted the labels aligned on the left and the text aligned on the
right like:

      x = A		      x = B
	|			|
	V			V

	L1_____		T1_______
	L2________	  T2_____
	L3___	       T3________
	L4__________ T4__________

I got this by stuff like:

OBJECT label1 : XmLabel {
    ARGUMENTS {
	XmNleftAttachment	= XmATTACH_FORM;
	XmNleftOffset		= A;
    };
};
OBJECT text : XmText {
    ARGUMENTS {
	XmNrightAttachment	= XmATTACH_OPPOSITE_FORM;
	XmNrightOffset		= -B;
    };
};

Note the "-B". It took some stochastic programming (trial and error ;)
to figure this little feature out.

Of course there are undoubtably a zillion ways to get this to work but
I knew what "A" and "B" were so this was convenient.

+---------------------------------------------------------------+
| Rod Stephens           | "Haven't I told you not to play      |
| GTE Laboratories, Inc  |  with my super-weapons? You might    |
| (617)466-4182          |  devastate yourself!"                |
| krs0@gte.com           |                                      |
+---------------------------------------------------------------+

hammy@bagheera.ctt.bellcore.com (John G. Smith) (09/29/90)

In article <9009280016.AA05259@turnpike.Eng.Sun.COM>, argv@Eng.Sun.COM
(Dan Heller) writes:
|> I have yet to find a purpose for this value.  Can someone lend
|> a hand?

With a negative XmN...Offset value, it lets you attach a fixed size
widget to one edge
of a form.  Especially usefull if this is the bottom or right edge.  For
example, a message area (say) 50 pixels high attached to the bottom of
the form, that should remain 50 high no matter how the form is resized.

John.
_____

|> 
|> -- 
|> dan
|> ----------------------------------------------------
|> O'Reilly && Associates   argv@sun.com / argv@ora.com
|> Opinions expressed reflect those of the author only.

John G. Smith   	email : hammy@ctt.bellcore.com
RRC 1H-213       	phone : (201) 699-4530