It is currently Fri Mar 29, 2024 7:34 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 8 posts ] 
Author Message
 Post subject: Gimp-Fu: gimp-message was in text box, is now in gimp image window?
PostPosted: Sat Dec 03, 2016 11:50 pm  (#1) 
Offline
New Member

Joined: Dec 03, 2016
Posts: 3
GIMP Version: 2.8.14
Operating System: Windows
GIMP Experience: New User



I am scripting with Gimp-Fu.
Previously, when using (gimp-message "xxx") the message would come as a separate text box.
For some reason, the gimp-message is now shown in the normal gimp image window: in the bottom margin ("status line") area.

Is there a way to change that back?

Alternately, does anyone have a better method for displaying status messages, to help with debugging Gimp-Fu scripts?

Thanks.

PS Does it annoy anyone else that searching for "gimp-message" on the forums automatically translates to "+gimp -message" ?


Share on Facebook Share on Twitter Share on Orkut Share on Digg Share on MySpace Share on Delicious Share on Technorati
Top
 Post subject: Re: Gimp-Fu: gimp-message was in text box, is now in gimp image window
PostPosted: Sun Dec 04, 2016 12:04 am  (#2) 
Online
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14801
Location: roma, italy
Assuming you are using python (otherwise translate into the corresponding scheme statements), put these service routines on top of you script:
############################################################################
# include, then use: erro_msg or info_msg
#---------------------------------------------------------------------------
def erro_msg (msg):
    ###
    currenth = pdb.gimp_message_get_handler()
    pdb.gimp_message_set_handler(0) # box
    gimp.message ("ERROR: "+msg)
    pdb.gimp_message_set_handler(currenth) # current
    ###
def info_msg (msg):
    ###
    currenth = pdb.gimp_message_get_handler()
    pdb.gimp_message_set_handler(2) # error console
    gimp.message ("INFO: "+msg)
    pdb.gimp_message_set_handler(currenth) # current
    ###

_________________
"Where am I ?"


Top
 Post subject: Re: Gimp-Fu: gimp-message was in text box, is now in gimp image window
PostPosted: Sun Dec 04, 2016 6:03 am  (#3) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4726
When you debug, you have better use the Error Console to see messages (Windows>Dockable dialogs>Error console).

Otherwise, when the console is not active, it seems that the policy is to use the Image window for single-line messages, and to switch to an error dialog when it contains multiple lines.

PS: This is the 21st millenium. Do yourself a favor and use Python for your scripts.

_________________
Image


Top
 Post subject: Re: Gimp-Fu: gimp-message was in text box, is now in gimp image window
PostPosted: Sun Dec 04, 2016 6:05 am  (#4) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4726
dinasset wrote:
Assuming you are using python (otherwise translate into the corresponding scheme statements), put these service routines on top of you script:
############################################################################
# include, then use: erro_msg or info_msg
#---------------------------------------------------------------------------
def erro_msg (msg):
    ###
    currenth = pdb.gimp_message_get_handler()
    pdb.gimp_message_set_handler(0) # box
    gimp.message ("ERROR: "+msg)
    pdb.gimp_message_set_handler(currenth) # current
    ###
def info_msg (msg):
    ###
    currenth = pdb.gimp_message_get_handler()
    pdb.gimp_message_set_handler(2) # error console
    gimp.message ("INFO: "+msg)
    pdb.gimp_message_set_handler(currenth) # current
    ###


The kind of thing you can do only if you don't distribute the script to others. Otherwise, better use the user's preferred method.

_________________
Image


Top
 Post subject: Re: Gimp-Fu: gimp-message was in text box, is now in gimp image window
PostPosted: Sun Dec 04, 2016 6:34 am  (#5) 
Online
GimpChat Member
User avatar

Joined: Jan 20, 2013
Posts: 14801
Location: roma, italy
ofnuts wrote:
dinasset wrote:
Assuming you are using python (otherwise translate into the corresponding scheme statements), put these service routines on top of you script:
############################################################################
# include, then use: erro_msg or info_msg
#---------------------------------------------------------------------------
def erro_msg (msg):
    ###
    currenth = pdb.gimp_message_get_handler()
    pdb.gimp_message_set_handler(0) # box
    gimp.message ("ERROR: "+msg)
    pdb.gimp_message_set_handler(currenth) # current
    ###
def info_msg (msg):
    ###
    currenth = pdb.gimp_message_get_handler()
    pdb.gimp_message_set_handler(2) # error console
    gimp.message ("INFO: "+msg)
    pdb.gimp_message_set_handler(currenth) # current
    ###


The kind of thing you can do only if you don't distribute the script to others. Otherwise, better use the user's preferred method.

I hoped to get -at least once in a while- a positive comment from you.
(My trick distinguishes between important messages -errors- which are displayed in a box from info only messages which are displayed in the console).
Better if I never post an answer nor suggest anything...

_________________
"Where am I ?"


Top
 Post subject: Re: Gimp-Fu: gimp-message was in text box, is now in gimp image window
PostPosted: Sun Dec 04, 2016 8:49 am  (#6) 
Offline
New Member

Joined: Dec 03, 2016
Posts: 3
ofnuts wrote:
When you debug, you have better use the Error Console to see messages (Windows>Dockable dialogs>Error console).

Otherwise, when the console is not active, it seems that the policy is to use the Image window for single-line messages, and to switch to an error dialog when it contains multiple lines.

PS: This is the 21st millenium. Do yourself a favor and use Python for your scripts.


Thank You, Ofnuts. The error console will work very well for me.
I only found out that gimp could be scripted a few days ago, and began working with Gimp-fu. I am enjoying learning Scheme, but I might switch to Python soon.
F.Y.I. It's the 21st century, A.D. A millennium is a thousand years.
Thanks for the help!


Top
 Post subject: Re: Gimp-Fu: gimp-message was in text box, is now in gimp image window
PostPosted: Sun Dec 04, 2016 8:55 am  (#7) 
Offline
Script Coder
User avatar

Joined: Oct 25, 2010
Posts: 4726
FletcherV wrote:
ofnuts wrote:
When you debug, you have better use the Error Console to see messages (Windows>Dockable dialogs>Error console).

Otherwise, when the console is not active, it seems that the policy is to use the Image window for single-line messages, and to switch to an error dialog when it contains multiple lines.

PS: This is the 21st millenium. Do yourself a favor and use Python for your scripts.


Thank You, Ofnuts. The error console will work very well for me.
I only found out that gimp could be scripted a few days ago, and began working with Gimp-fu. I am enjoying learning Scheme, but I might switch to Python soon.
F.Y.I. It's the 21st century, A.D. A millennium is a thousand years.
Thanks for the help!


I meant the third millenium. I stand corrected :)

_________________
Image


Top
 Post subject: Re: Gimp-Fu: gimp-message was in text box, is now in gimp image window
PostPosted: Sun Dec 04, 2016 9:01 am  (#8) 
Offline
New Member

Joined: Dec 03, 2016
Posts: 3
dinasset wrote:
Assuming you are using python (otherwise translate into the corresponding scheme statements), put these service routines on top of you script:
############################################################################

[...]


Thank you Dinasset. I like your method. I use similar debugging techniques in other computer languages, and I might begin to do this in Scheme, or Python if I switch to that.
Thanks for the help. :bigthup


Top
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC - 5 hours [ DST ]


   Similar Topics   Replies 
No new posts Open Image window, Places column question

0

No new posts Attachment(s) Fooling around with free prompt text to image gen AI

42

No new posts Removing text from a poster imported as an image

3

No new posts How to delete a message?

6



* Login  



Powered by phpBB3 © phpBB Group