Menu

Anybody using PythonScript to create dialogs?

2022-09-30
2024-06-09
  • Michael Warwick

    Michael Warwick - 2022-09-30

    I'm liking having Python in Npp and have a couple of working scripts that
    are helping with my work, one of them would be even better if I could get a
    few inputs, (about 5 yes/no inputs and a couple of text items) so I'd like
    to pop up a dialog. The message box and inputs are not quite enough, I'm
    looking for an example script that puts up a dialog with a few inputs and
    then uses those values.

     
    • Sasumner

      Sasumner - 2022-09-30

      You could use Tk that comes with a full install of PythonScript. (I never liked Tk)
      I suppose you could use Windows low-level API for creating/managing windows, but that sounds, well, exhausting.
      I make do with the "prompt" function; here's an example: https://community.notepad-plus-plus.org/post/28702

       
  • Karel A

    Karel A - 2024-06-07

    The problem with Pythonscript is that you cannot make application modal windows in Notepad++ with Tcl/Tk (or any other GUI framework, as far as I know...), i.e. a window that stays on top within Notepad++, until the user closes it.
    You can make a system modal window, but not an application modal window.
    This is a rather severe limitation for Python scripts, as you mostly want the user to be able to interact with the script through a graphical user interface (a listbox or whatever).
    If I am wrong, please correct me and show how!

     
    • Sasumner

      Sasumner - 2024-06-09

      "you cannot make application modal windows in Notepad++" --> This is NOT true.

      "please correct me and show how" --> I'm not going to show you how with Tcl/Tk, because I don't like and don't use it.

      The capability can be easily demonstrated with this little UI toolkit that a PythonScript user created: https://community.notepad-plus-plus.org/topic/24389
      Suggest you check that out and if you have further questions, post to the community site and someone there will help you out.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.