?
Solved

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

Posted on 2003-02-19
4
Medium Priority
?
634 Views
Last Modified: 2007-12-19
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
Comment
Question by:jungle1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 11

Expert Comment

by:cup
ID: 7983895
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
 
LVL 11

Accepted Solution

by:
cup earned 200 total points
ID: 7985747
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
 
LVL 20

Expert Comment

by:jmcg
ID: 10006293
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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use while-loops in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
Suggested Courses

741 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question