[comp.windows.x.motif] XmForm and overlapping widgets

morten@modulex.dk (Morten Hastrup) (01/18/91)

henigan@quando.quantum.de (Kevin Henigan) writes:

>Hi,

>I have a small problem, I'm using the XmForm widget to define a
>text Widget, in the text Widget I to set some standard text in one
>colour.

>To draw the attention of some of the values to the user, I need to
>change the background colour of part of the text in the text widget.

>As each line has 15+ values with some formatting text I thought I
>could set up a background text widget (back) this has all the
>headers and titles in it. I then could add other value text widgets
>to appear infront of the background titles, these value text would
>allow me to easily change the colour of some values.


>		   Form
>		     |
>	+------------------+-------+-------+
>	|                  |       |       |
>      back                value1  value2 val....

>so it looks like :-

>BACK

>    -------------------------------------------------   back titles & headers
>	 ----      ----      ----       ----             values in front.

>FRONT

>	 user looking from here.

>The problem is when I create the back & value widgets in the same
>position in the form, I have no control over which widget happens to
>display at the front, most of the time the values are never seen...

When you do as above, the widget created last is displayed at the top.
The reason for this is that the children of a composite-widget (or sub-
classes of composite-widgets like the XmForm) normaly is inserted into
the composite-widgets children list as first-in first-out. The
layout-procedure than, normally, runs this list from the top.

You can either insert the children "correctly" (the one to display at the
top last) or you can add a XmNinsertPosition-function (This function should
return the position to insert the child in - called by the widget-class
InsertChild-method)

I'll hope this could help. If I can help you another time, just mail me.

I nearly forgot. You can also use XRaiseWindow() of course. But I think
it's "dirty"-programming.

Morten

-----------------------------------------------------
Morten Hastrup		| Email:    morten@modulex.dk
A/S MODULEX		| Phone:    +45 44 53 30 11
Lyskaer 15		| Telefax:  +45 44 53 30 74
DK-2730 Herlev		|
Denmark			|