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.
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
"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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
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
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!
"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.