Re: [Gimp-developer] When writing a GIMP Plugin using Python, can the Plugin display a GIMP based Dialog box informing the user if they haven't provided an argument?

When you write a Gimp plugin in Python, either you do your whole
interactive UI with PyGTK, or you let Gimp auto-generate a dialog to
collect parameters from the user before calling you. Of course the
second solution is a bit less user-friendly(*) but in many scripts,
doing the whole UI would represent the larger and most complex part of
the code.

(*) though not as bad as it looks, you can normally expect passed
image/layers/files/colors to exist since they have been specified using
specific dialogs.

On 5/12/19 5:50 PM, Michal Vašut wrote:
You should IMHO prevent performing an operation when the input is
Yes, it's definitely easier to throw an exception, but those are IMHO
rather to deal with some unexpected errors.

On Sat, May 11, 2019, 23:44 Ofnuts <ofnuts gmx com
<mailto:ofnuts gmx com>> wrote:

    If the plugin is for public use, gimp.message() is a better solution
    because it will display in a dialog box or in the Gimp message
    depending on user preferences. You don't really need to drag in
    all the
    GTK support just to display an error message.

    On the other hand, I don't see how you pass a list of files to a
    plugin.. If this is a batch script, things are a bit different,
    but then
    there may be no UI at all, and the message would be better printed to
    the console.

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]