MODAL dialogs - Motif

This is a discussion on MODAL dialogs - Motif ; Hi, I have an application wherein we input some data into a form. On this form, we have a button which opens a new window, where we can allocate resources ( a resource allocation window) among the systems created through ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: MODAL dialogs

  1. MODAL dialogs

    Hi,

    I have an application wherein we input some data into a form.
    On this form, we have a button which opens a new window, where we can
    allocate resources ( a resource allocation window)
    among the systems created through the parent form.

    Now,
    1. We want to have this resource allocation window to be modal.
    2. We also perform some validations/ resource constraint violation checks on
    the input given in
    this resource allocation window.

    I have made the resource allocation window XmDIALOG_FULL_APPLICATION_MODAL.
    Whenever there is some constraint violation, we want to display an error
    message box which
    again should be modal. I want to display a modal window from a modal window.

    Here, the error message box is displayed, but the original resource
    allocation window vanishes.
    I want the resource allocation window to stay in background, and then show
    the error message.
    After the user acknowledges the error, he should be able to correct his
    inputs.
    Basically the modal resource allocation window should not close down.

    Can anyone please guide me about how this can be acheived.
    Any help or any pointing in appropriate direction will be appreciated.

    Thanks,
    Shashibhushan Gokhale



  2. Re: MODAL dialogs

    Nested modal dialogs are indeed possible. Set the "autoUnmanage"
    resource to false.

    You will have to arrange your code so that the nesting works, though.
    If your code mixes up creating/destroying the dialog with running the
    modal loop, you will need to decouple that.

  3. Re: MODAL dialogs

    Hi ST and All,

    I set the "autoUnmanage" to False, and I am able to show error messages that
    are truely modal, but now the resource allocation window from which the
    error messages were thrown is not modal.

    In the taskbar, I see a single tab for both of the parent form from which
    the
    resource allocation window is invoked, and resource allocation window.
    Although I cannot move the form on to the top of resource allocation window,
    I
    can move the resource allocation window away from the form.
    Then, I am able to perform operations on the main form, while the resource
    allocation window is still being displayed on top of it. Once I close the
    main
    form, the resource allocation window closes as well as expected.

    I expect that since the resource allocation dialog box is
    "XmDIALOG_FULL_APPLICATION_MODAL", any operations on the parent form should
    not be allowed.

    Can anyone suggest some way on this rather strange behavior?

    Also, can you please elaborate a bit more on:
    "
    > You will have to arrange your code so that the nesting works, though.
    > If your code mixes up creating/destroying the dialog with running the
    > modal loop, you will need to decouple that.

    "

    Thanks,
    Shashibhushan

    "ST" wrote in message
    news:y8g%e.990$kl3.796@trnddc08...
    > Nested modal dialogs are indeed possible. Set the "autoUnmanage"
    > resource to false.
    >
    > You will have to arrange your code so that the nesting works, though.
    > If your code mixes up creating/destroying the dialog with running the
    > modal loop, you will need to decouple that.






  4. Re: MODAL dialogs

    The window manager is the final arbiter which windows are active during
    a modal chain. Not only are there hundreds of them, many of them get it
    totally wrong. So, I'd try different window managers, starting with "mwm".

    Also note the modality is a resource on XmBulletinBoard, not the shell
    itself. Make sure you're setting it on the right widget. (The shell
    itself uses mwmInputMode - see VendorShell.)

    Otherwise, it sounds like you want a nested event loop - read the Motif
    programmer's guide on this. This way you can service only the events
    you want. Typically, you will want to service expose events on other
    windows so they don't go blank.

    There's another technique to impose modality when the window manager is
    not being helpful: set the entire window to be insensitive at certain
    points.

  5. Re: MODAL dialogs

    ST,

    After a review of the fix to set autoUnmanage to False, I found that I had
    inadvertently garbled the modality property while doing it.
    I corrected it and it worked as expected, without any problems whatsoever.
    i.e. perfectly modal.

    Thanks a lot for the help.

    - Shashibhushan


    "ST" wrote in message news:2bb0f.9$zM5.4@trnddc02...
    > The window manager is the final arbiter which windows are active during
    > a modal chain. Not only are there hundreds of them, many of them get it
    > totally wrong. So, I'd try different window managers, starting with

    "mwm".
    >
    > Also note the modality is a resource on XmBulletinBoard, not the shell
    > itself. Make sure you're setting it on the right widget. (The shell
    > itself uses mwmInputMode - see VendorShell.)
    >
    > Otherwise, it sounds like you want a nested event loop - read the Motif
    > programmer's guide on this. This way you can service only the events
    > you want. Typically, you will want to service expose events on other
    > windows so they don't go blank.
    >
    > There's another technique to impose modality when the window manager is
    > not being helpful: set the entire window to be insensitive at certain
    > points.




+ Reply to Thread