Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to display a message to the user from script-fu
#7
(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?

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 :-)

(12-05-2022, 11:00 PM)Ofnuts Wrote: With this code:

Code:
pdb.gimp_message_set_handler(MESSAGE_BOX)
pdb.gimp_message("Hello in status bar") # Single line, goes to status bar
pdb.gimp_message("Hello\nin dialog")    # Multi-line, goes to dialog
pdb.gimp_message("Hello in dialog again") # Single line, goes to dialog which is out
pdb.gimp_message_set_handler(ERROR_CONSOLE)
pdb.gimp_message("Hello in Gimp message console")
pdb.gimp_message_set_handler(CONSOLE)
pdb.gimp_message("Hello in stdout/stderr of Gimp process")

I get this:


That draws the following remarks for MESSAGE_BOX
  • If the message is a single line, and the message dialog is not out, the message goes to the status bar.
  • If the message is multi-line, a dialog is shown
  • If the multi-line dialog is out, other messages are added to it
Your problem is possibly that the dialog is either masked or off-screen.
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.
Reply


Messages In This Thread
RE: How to display a message to the user from script-fu - by flauapaua - 12-10-2022, 08:54 AM

Forum Jump: