#84 Escape cancels all dialogs

development
closed-accepted
Eddy De Greef
Program (79)
5
2003-07-18
2003-07-15
Oliver Schmidt
No

Hi,

using the keyboard with Nedit I got used to
pressing the Escape key just to get rid of any
dialog box. This works consistently with nearly
all boxes but one exception: Boxes with only one
button (e.g. "String was not found").

The following very simple patch handles this case
for modal dialog boxes and for the shell output
box. Now you can e.g. simply press Escape when
the "String was not found" box appears and both,
this box and the search box are closed.

It would be great if this behaviour could be
established in future Nedit versions. IMHO it
doesn't break existing behaviour and increases
consistency.

Regards,
Oliver

Discussion

  • Oliver Schmidt
    Oliver Schmidt
    2003-07-15

    Escape cancels all dialogs

     
    Attachments
  • Logged In: NO

    Notice that with Motif the Escape key works.
    This patch then seems to address another LessTif problem.
    (Maybe the folks there would be glad to hear about it, too.)

    Please make sure that such patches don't affect the
    behaviour of Motif built NEdit binaries.

    --Joerg

     
  • Oliver Schmidt
    Oliver Schmidt
    2003-07-16

    Logged In: YES
    user_id=823333

    E.g. the escape key doesn't work for the following Nedit
    version (build with Motif) in the "String was not found"
    dialog box and in the "Output from command" box.

    ============================================
    NEdit 5.3
    Jun 1, 2002

    Built on: Linux, x86, GNU C
    Built at: Jun 7 2002, 11:41:04
    With Motif: 2001 [@(#)Motif Version 2.1.30]
    Running Motif: 2001
    Server: Hummingbird Communications Ltd. 6100
    ============================================

    Oliver

     
  • Oliver Schmidt
    Oliver Schmidt
    2003-07-16

     
    Attachments
  • Oliver Schmidt
    Oliver Schmidt
    2003-07-16

    Logged In: YES
    user_id=823333

    Hi,

    I examined the escape key problem further and now I
    detected another problem that is indeed a LessTif problem:

    The dialog boxes that are invoked by the macro language
    ("dialog" and "string_dialog") can be closed with the
    escape key under Open Motif version 2.1.30 but they can't
    under LessTif version 2.1 release 0.93.18 (and other
    versions).

    I supplied a new patch to solve this problem. So now there
    are two patches:

    1.) nedit-escape-01.diff:

    This patch solves the problem that the escape key doesn't
    close the "String was not found" box that is displayed by
    the Find-Dialog and the "Output from command" boxes that
    displays output from a shell command.

    This problem occurs under Motif 2.1.30 and LessTif 0.93.18
    (and other versions).

    2.) nedit-escape-02.diff:

    This patch solves the problem that the macro dialogs cannot
    be closed with the escape key.

    This problems occurs under LessTif 0.93.18 (and other
    versions).

    I tested both patches under Motif and under LessTif and
    there was no difference. Existing behaviour of Nedit is not
    changed.

    Regards,
    Oliver

     
  • Logged In: YES
    user_id=241391

    Just for completeness, the original problem doesn't seem to
    be attributed to Lesstif. On my HP-UX 10.20 box equipped
    with Motif 1.2 the Esc key also doesn't work for one-line
    shell command outputs and one-button dialogs:

    ====================================================
    NEdit release of Mar 14, 2003

    Built on: HP/UX, PA-RISC, GNU C
    Built at: Jul 4 2003, 18:45:24
    With Motif: 1.2.4 [@(#)OSF/Motif Version 1.2.5]
    Running Motif: 1.2 [@(#)OSF/Motif Version 1.2.6]
    Server: Hewlett-Packard Company 600000
    Visual: 8-bit PseudoColor (ID 0x20, Default)
    Locale: C
    ====================================================
    --
    Regards,
    Yury Burkatovsky

     
  • Eddy De Greef
    Eddy De Greef
    2003-07-18

    • milestone: --> development
    • assigned_to: nobody --> edg
    • status: open --> closed-accepted
     
  • Eddy De Greef
    Eddy De Greef
    2003-07-18

    Logged In: YES
    user_id=73597

    These problems have annoyed me too.
    The first patch is a no-brainer and I've applied it to cvs
    (HEAD) unmodified.
    The second one looks ok too, but since it is a lesstif-only
    problem, I've put the workarounds between #ifdefs before I
    applied it.
    Thanks.

    [The Lesstif problem is probably due to the default cancel
    button being unmanaged. Motif still redirects Escape key
    presses to the that button, but Lesstif seems to think that
    an unmanaged button should not respond to events. I don't
    know who is right, but Lesstif's behaviour seems logical to me.]