[comp.windows.x.motif] invisible/overlay windows?

connolly@convex.com (Dan Connolly) (01/16/91)

I'm trying to add primitive hypertext capability to a bitmap
browsing program. I've got a bulletin board widget with a pixmap
label in it.

I'd like to put a bunch of pushbuttons over the label, with the
underlying pixmap showing through.

Am I gonna have to resort to Xlib?

Dan

pasturel@sctc.com (Pierre Pasturel) (01/16/91)

connolly@convex.com (Dan Connolly) writes:
>I'd like to put a bunch of pushbuttons over the label, with the
>underlying pixmap showing through.

>Am I gonna have to resort to Xlib?

>Dan


I don't know the answer and acutally had a similar question about
overlaying widgets.

I have the following widget hierarchy:

   Application Shell, "shell"
        BulletinBoard, "backdrop"
                BulletinBoardDialog, "bb1"
                BulletinBoard, "bb2"

For reasons of my own, I need bb1 to be a BBDialog, not just a BB.

Now, the problem I am having is that bb2 is being animated by changing the
XmNx, XmNy resources and when bb2 overlaps bb1, then bb1 is on "top" and
bb2 is hidden underneath bb1. I suspect that bb1, because it is a
DialogShell, has some sort of precedence which makes it appear on top of
bb2.

So, how can I force bb2, as a BB, to be on top of bb1, a BBDialog???

Any and all suggestions please.

thanks
Pierre
pasturel@sctc.com

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

connolly@convex.com (Dan Connolly) writes:

>I've got a bulletin board widget with a pixmap label in it.

>I'd like to put a bunch of pushbuttons over the label, with the
>underlying pixmap showing through.

>Am I gonna have to resort to Xlib?

Yes, The following should work:

{
   XSetWindowAttributes att;
   XtValueMask mask; /* or unsigned long */
   Widget bp; /* push button widget */

   .....
   pb = XmCreatePushButton(....

   mask = 0;
   mask |= CWBackPixel;
   att.background_pixmap = ParentRelative; /* this is the solution */
   XChangeWindowAttributes(XtDisplay(pb), XtWindow(pb),
                           mask, &att);

   .....
}

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			|