• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 638
  • Last Modified:

How to get a xmotif widget to stay on top of another?

I would like to know how to get a widget to stay on top of another widget.  The code below shown the widget popup then if the mouse click on another widget it will hide behide the widget.  

Widget _UxCtransmit::_build()
{
        Widget          _UxParent;
        XmFontList      fontlist = UxConvertFontList("-*-courier-*-r-normal-*-12-*");
        XmFontList      warnfont = UxConvertFontList("-adobe-courier-bold-o-*--14-*");

        // Creation of transmit
        _UxParent = UxParent;
        if ( _UxParent == NULL )
        {
                _UxParent = UxTopLevel;
        }

        Transmit = XtVaCreatePopupShell( "Transmit",
                        xmDialogShellWidgetClass,
//                      topLevelShellWidgetClass,
                        _UxParent,
                        XmNallowShellResize, TRUE,
                        XmNdeleteResponse, XmDO_NOTHING,
                        XmNmwmDecorations, MWM_DECOR_BORDER,
                        XmNmwmFunctions, MWM_FUNC_ALL,
                        XmNgeometry, "+180+150",
                        XmNtitle, "Transmit Confirmation",
                        NULL );

        UxPutContext( Transmit, (char *) this );
        UxThis = Transmit;

Thanks.
0
jungle1
Asked:
jungle1
  • 2
1 Solution
 
cupCommented:
I haven't got my books with me so I can't give you the full details.  Have a look at the losing focus callback.  When activated, it means something else is coming on top so you need to XRaise the shell or something like that.  

This is best debugged on 2 terminals: just set the XDISPLAY somewhere else otherwise you will never be able to debug it.  This feature is also dammed annoying.
0
 
cupCommented:
Make sure you are on click focus.  The terminal tends to lock up on point focus.  Basically it is

XtAddCallback (Transmit,XmNlosingFocusCallback, yourcallback, yourdata);

Don't forget to remove it when you have finished.

yourcallback must be a static function.  Basically all you need to do is XRaiseWindow.  Whether it works or not depends on your window manager.  If you are running CDE and manage to switch to another pane, I don't really know what will happen.  If you are running a two headed system, it can go a bit pear shaped too.
0
 
jmcgOwnerCommented:
Nothing has happened on this question in over 7 months. It's time for cleanup!

My recommendation, which I will post in the Cleanup topic area, is to
accept answer by cup (with a few reservations, since I don't know that it works).

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jmcg
EE Cleanup Volunteer
0

Featured Post

Live webcast with Pinal Dave

Pinal Dave will teach you tricks to help identify the real root cause of database problems rather than red herrings. Attendees will learn scripts that they can use in their environment to immediately figure out their performance Blame Shifters and fix them quickly.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now