#51 Focus policy of dialog macro routines


Suppose you open two files in Nedit, "file-1" and "file-2", and switch to window "file-1". You then run the following macro:


Window "file-2" gets focus and is raised as expected, but as soon as the dialog box comes up, window "file-1" is raised again, that is,
the window which was active when the macro was launched.

Apparently Nedit raises the parent window of the dialog box but focus_window() doesn't change the parent. This implies that focus_window() is is ineffective when calling dialog() or list_dialog() afterwards.


  • Thorsten Haude

    Thorsten Haude - 2004-07-15

    Logged In: YES

    Indeed. It's no accident but clearly described in
    dialogMS(). Someone knows a reason for this?

    Could someone refile this as Feature Request?

  • Tony Balinski

    Tony Balinski - 2004-07-15

    Logged In: YES

    A window owns a macro thread. Although the commands may
    execute in another window's file buffer, any dialogs the
    macro thread creates belong to the first window, and of
    couse there'll only be one such dialog box per thread-owning
    window at a time, because one window can never execute more
    than one macro concurrently. Now you can also have another
    macro running concurrently in the window raised by the
    first, and that second macro-thread could open a dialog:
    this one's parent is the second window.

    Now if a dialog is current it raises its owning window (or
    the display's window manager does) - that's what the user is
    seeing. If he dismisses the dialog, the window raised by the
    macro should "rise again".

    A workaround? I understand there is now a hidden master
    window - maybe this could be made parent of all macro dialogs?

  • Thorsten Haude

    Thorsten Haude - 2005-02-07

    Logged In: YES

    While I understand why you might want the behaviour you
    describe, this is currently not how NEdit's focus_window()
    works. Ownership of child windows is no part of this focus

    I'll refile this as a feature request.


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks