Python-fu: add more user input dialogs? - Printable Version +- Gimp-Forum.net (https://www.gimp-forum.net) +-- Forum: GIMP (https://www.gimp-forum.net/Forum-GIMP) +--- Forum: Extending the GIMP (https://www.gimp-forum.net/Forum-Extending-the-GIMP) +---- Forum: Scripting questions (https://www.gimp-forum.net/Forum-Scripting-questions) +---- Thread: Python-fu: add more user input dialogs? (/Thread-Python-fu-add-more-user-input-dialogs) |
Python-fu: add more user input dialogs? - ChameleonScales - 02-09-2021 Apart from the dialog that you define in register() and the gimp.message command (which doesn't allow for any user input), I don't know if Gimp's api provides a way to pop a dialog to, say, ask for confirmation about something or provide other sliders, spinners, etc based on what you selected in the main plug'in's dialog. Do we have to revert to other python libraries like zenity or GTK? RE: Python-fu: add more user input dialogs? - Kevin - 02-09-2021 There are no other dialogs available. You would have to create whatever extra you require, probably with GTK as that's all that's available cross-platform. Also I'm currently unclear about whether the automatic dialog generation defined by the register() mechanism will continue to be available when GIMP 3.0 arrives - these may need to be built manually as well. RE: Python-fu: add more user input dialogs? - Ofnuts - 02-09-2021 (02-09-2021, 08:40 PM)ChameleonScales Wrote: Apart from the dialog that you define in register() and the gimp.message command (which doesn't allow for any user input), I don't know if Gimp's api provides a way to pop a dialog to, say, ask for confirmation about something or provide other sliders, spinners, etc based on what you selected in the main plug'in's dialog. You can build a whole dialog using PyGTK (recommended solution since it is available on all platforms that support Gimp with Python). Personally, I wrote over a hundred Gimp scripts and never had to request confirmation, I just ensure that Ctrl-Z will allow the user to express regrets about the result. Given you recent post history I think such confirmation should be done before even calling Gimp. Ergonomics-wise, using two successive dialogs is bad, if some initial choice leads to very different parameters, I use two menu entries leading to two different auto-generated dialogs. RE: Python-fu: add more user input dialogs? - ChameleonScales - 02-09-2021 ok thanks. I'll use PyGTK. It would be a pity if that register dialog goes away in GIMP 3.0. It helps a lot to have an api that lets you make GUIS with ease and few lines of code. Quote:I use two menu entries leading to two different auto-generated dialogs. I was mostly thinking of a follow-up dialog for a confirmation like "File already exists, do you want to replace it?" Yes - No But for adding GUI settings the best for me would be a dynamic dialog where if you check a box, some elements related to it could appear or if you uncheck, some elements get greyed out. It doesn't seem like the register( dialog lets you do any of that. In any case I might make my python plug-in(s) from outside of Gimp so I should fiddle with GTK more, especially if the register( dialog will disappear. RE: Python-fu: add more user input dialogs? - tmanni - 02-10-2021 @Kevin, GIMP 3.0 will have the same feature of dialogs generation: https://www.gimp.org/news/2020/12/25/gimp-2-99-4-released/#dialog-generation-for-plug-ins RE: Python-fu: add more user input dialogs? - ChameleonScales - 02-10-2021 Glad to hear it (◠⊿◠) |