Another window opening problem - Motif

This is a discussion on Another window opening problem - Motif ; Hi My application opens popup windows at different positions on the screen. ie. when i click first button in my application, a new popup window should open at the top - left of the parent window and when i click ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: Another window opening problem

  1. Another window opening problem

    Hi

    My application opens popup windows at different positions on the
    screen.
    ie. when i click first button in my application, a new popup window
    should open at the top - left of the parent window and when i click
    first button a popup window should open at bottom left of the parent
    window.

    i set new window pos by
    ....
    sprintf( strNewWinPos, "+%hd+%hd", NewX, NewY);
    XtVaSetValues(shellw, XmNgeometry, strNewWinPos, NULL);
    ....
    ....
    wParent = XtCreatePopupShell(strFileName,
    topLevelShellWidgetClass,topLevelShell,args,ac);
    ....

    this works fine in Solaris 8. but when i load my application through
    Exceed from windows NT
    the window are opened in the top left corner of the screen.

    Can somebody help me to solve the issue

    thanks in advance

    Max

  2. Re: Another window opening problem

    In article max237@excite.com (Max) writes:
    >Hi
    >
    >My application opens popup windows at different positions on the
    >screen.


    [...]

    >this works fine in Solaris 8. but when i load my application through
    >Exceed from windows NT
    >the window are opened in the top left corner of the screen.
    >
    >Can somebody help me to solve the issue


    Note that window positions and sizes are "hints" that can be overridden by the
    the window manager.

    So you'll probably need to look for an Exceed setting that is overriding your
    specified positions.

    -Pete Zakel
    (phz@seeheader.nospam)

    "Many receive advice, few profit by it."

  3. Re: Another window opening problem

    pxhxz@cadence.com (Pete nospam Zakel) wrote in message news:<3f4a5610$1@news.cadence.com>...
    > In article max237@excite.com (Max) writes:
    > >Hi
    > >
    > >My application opens popup windows at different positions on the
    > >screen.

    >
    > [...]
    >
    > >this works fine in Solaris 8. but when i load my application through
    > >Exceed from windows NT
    > >the window are opened in the top left corner of the screen.
    > >
    > >Can somebody help me to solve the issue

    >
    > Note that window positions and sizes are "hints" that can be overridden by the
    > the window manager.
    >
    > So you'll probably need to look for an Exceed setting that is overriding your
    > specified positions.
    >
    > -Pete Zakel
    > (phz@seeheader.nospam)
    >
    > "Many receive advice, few profit by it."


    I tried that ... But i could not find any Exceed settings.
    is there any way so that i can disable window manager from overiding
    my positions. Or changing the hints after window manager displayed the
    window

  4. Re: Another window opening problem

    If you just set the x and y positions at the right time, Motif should set the
    right X window hints. One good time to do this is in a popup callback.

    To ensure your program is doing the right thing, run "xprop" and click on the
    window. You should see something like:

    WM_NORMAL_HINTS(WM_SIZE_HINTS):
    user specified location: 128, 166
    program specified location: 128, 166
    program specified size: 560 by 518

    I don't know what you're doing, but window positioning works fine with
    Exceed's native window manager, with various Motif apps.

    One thing you may need to do is should remove the PPosition hint with
    XSetWMNormalHints if it's unset. Otherwise you could up with windows at 0,0
    when you don't specify a position, when you really meant "let the window
    manager pick".

  5. Re: Another window opening problem

    "Scott J. Tringali" wrote in message news:<3F4B634A.C87D4974@etnus.com>...
    > If you just set the x and y positions at the right time, Motif should set the
    > right X window hints. One good time to do this is in a popup callback.
    >
    > To ensure your program is doing the right thing, run "xprop" and click on the
    > window. You should see something like:
    >
    > WM_NORMAL_HINTS(WM_SIZE_HINTS):
    > user specified location: 128, 166
    > program specified location: 128, 166
    > program specified size: 560 by 518
    >
    > I don't know what you're doing, but window positioning works fine with
    > Exceed's native window manager, with various Motif apps.
    >
    > One thing you may need to do is should remove the PPosition hint with
    > XSetWMNormalHints if it's unset. Otherwise you could up with windows at 0,0
    > when you don't specify a position, when you really meant "let the window
    > manager pick".


    Thanks for the suggestion

    this is what my application is doing

    .....
    XtSetArg(args[ac], XmNmappedWhenManaged, FALSE); ac++;
    XtSetArg(args[ac], XmNdeleteResponse, XmDO_NOTHING); ac++;
    wParent = XtCreatePopupShell(strFileName,
    topLevelShellWidgetClass,topLevelShell,args,ac);

    sprintf( strNewWinPos, "+%hd+%hd", MyX , MyY);
    XtVaSetValues(wParent, XmNgeometry, strNewWinPos, NULL);

    this i added the following after your suggestion

    hints = XAllocSizeHints();
    XGetNormalHints(XtDisplay(wParent), XtWindow(wParent), hints);
    hints->x = Myxc;
    hints->y = Myyc;
    hints->flags &= ~PPosition;
    hints->flags |= USPosition;
    XSetNormalHints(XtDisplay(wParent), XtWindow(wParent), hints);
    XFree(hints);
    .....

    Still it is not working thru Exceed

    the callback function
    XtAddCallback(wParent, XmNpopupCallback , NewCallBack, NULL);
    is not called

    pls help

  6. Re: Another window opening problem

    Remove the code that changes the XmNgeometry resource. Instead, just set XmNx
    and XmNy (remember their type is Position) passing them through when you
    create the widget. If you do that, you probably will not need to mess with
    the hints directly.

    I seem to recall that "geometry" is owned by the user, and it overrides
    everything, so it's best just to leave it alone.

    There is not enough context to see why your popupCallback is not being
    called. I have used it reliably when I need to place windows at certain
    position dynamically (e.g., centering a modal dialog over the mouse pointer).

    Are you usings Exceed's native window manager, or running a remote window
    mangger? Some WMs ignore PPosition completely, in which case you have to flip
    a switch to tell it to do so.



  7. Re: Another window opening problem

    "Scott J. Tringali" wrote in message news:<3F4CC85A.7E45049D@etnus.com>...
    > Remove the code that changes the XmNgeometry resource. Instead, just set XmNx
    > and XmNy (remember their type is Position) passing them through when you
    > create the widget. If you do that, you probably will not need to mess with
    > the hints directly.
    >
    > I seem to recall that "geometry" is owned by the user, and it overrides
    > everything, so it's best just to leave it alone.
    >
    > There is not enough context to see why your popupCallback is not being
    > called. I have used it reliably when I need to place windows at certain
    > position dynamically (e.g., centering a modal dialog over the mouse pointer).
    >
    > Are you usings Exceed's native window manager, or running a remote window
    > mangger? Some WMs ignore PPosition completely, in which case you have to flip
    > a switch to tell it to do so.


    thanks Scott .....
    i am using Exceed's native window manager ...
    now i found there is a setting "Cascade windows" is causing all the problems .
    i unchecked the setting evrything is working fine.
    Is there any way to uncheck the setting thru my application.

    mathew

+ Reply to Thread