How to display a message to the user from script-fu - 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: How to display a message to the user from script-fu (/Thread-How-to-display-a-message-to-the-user-from-script-fu) |
How to display a message to the user from script-fu - flauapaua - 12-03-2022 I have a very basic question. in the script-fu console writing Code: (gimp-message "Hello World") and pressing return gives me this Code: > (gimp-message "Hello World") in the output box of the console. And this is it. Shouldn't I get some dialog pop up or something? If not how else can one do this? RE: How to display a message to the user from script-fu - programmer_ceds - 12-04-2022 (12-03-2022, 08:33 PM)flauapaua Wrote: Shouldn't I get some dialog pop up or something? If not how else can one do this? I suspect that you are getting "Hello World" displayed in the status line at the bottom of the main GIMP window. If you type (gimp-message "Hello World\n more text") you should get a message box pop up (the \n causes a new line) At some point in the recent (I think) past GIMP changed so that only multi-line messages are shown in a pop-up dialog box; single lines are just shown in the status bar. I add a new line into all such messages so that they appear as pop-ups and are not overlooked by the user - as is seemingly demonstrated here :-) RE: How to display a message to the user from script-fu - Ofnuts - 12-04-2022 AFAIK the default is that if you have the console dialog, messages go to the console. But you can use (gimp-message-set-handler handler) to set the output to a dialog, the Gimp console, or what seems to be the StdErr of the Gimp process (useful is you started Gimp from a terminal). RE: How to display a message to the user from script-fu - flauapaua - 12-04-2022 (12-04-2022, 01:52 PM)programmer_ceds Wrote:(12-03-2022, 08:33 PM)flauapaua Wrote: Shouldn't I get some dialog pop up or something? If not how else can one do this? That's exactly how it is. Thanks. (12-04-2022, 08:34 PM)Ofnuts Wrote: AFAIK the default is that if you have the console dialog, messages go to the console. But you can use (gimp-message-set-handler handler) to set the output to a dialog, the Gimp console, or what seems to be the StdErr of the Gimp process (useful is you started Gimp from a terminal).I don't know how to do this Code: (gimp-message-set-handler 0) (gimp-message "Hello World") gives me Code: > (gimp-message-set-handler 0) (gimp-message "Hello World") RE: How to display a message to the user from script-fu - flauapaua - 12-05-2022 Today it ceased working for no reason I know off. If I copy Code: (gimp-message "Hello World\n more text") RE: How to display a message to the user from script-fu - Ofnuts - 12-05-2022 With this code: Code: pdb.gimp_message_set_handler(MESSAGE_BOX) I get this: [attachment=9124]
That draws the following remarks for MESSAGE_BOX
RE: How to display a message to the user from script-fu - flauapaua - 12-10-2022 (12-04-2022, 01:52 PM)programmer_ceds Wrote:(12-03-2022, 08:33 PM)flauapaua Wrote: Shouldn't I get some dialog pop up or something? If not how else can one do this? (12-05-2022, 11:00 PM)Ofnuts Wrote: With this code:That might possibly have been the problem. All I can say is, that it now works again exactly as you describe it. Thanks for the extensive research. |