It is currently Wed Aug 12, 2026 3:00 am


All times are UTC - 5 hours [ DST ]



Post new topic Reply to topic  [ 11 posts ] 
Author Message
 Post subject: Unable to display message[Solved and Summarised]
PostPosted: Wed Dec 14, 2011 9:36 pm  (#1) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
I am trying to display a message that no selection was made and have tried using

(sel (car (gimp-selection-is-empty image))) in the (let* area,

then (if (= sel TRUE) (gimp-message "A Selection is needed to run script.")) in the script

But nothing displays :(

I am using 2-6-11

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Last edited by Graechan on Thu Dec 15, 2011 8:48 pm, edited 2 times in total.

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: unable to display message
PostPosted: Wed Dec 14, 2011 9:43 pm  (#2) 
Offline
GimpChat Member

Joined: Apr 12, 2010
Posts: 5870
Maybe in last 2.7 partha build only?

_________________
My 3D Gallery on Deviantart http://photocomix2.deviantart.com/
Main gallery http://www.flickriver.com/photos/photocomix-mandala/
Mandala and simmetry http://www.flickriver.com/photos/photocomix_mandala/

Image

Mrs Wilbress


Top
 Post subject: Re: unable to display message
PostPosted: Wed Dec 14, 2011 9:55 pm  (#3) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
Sorry I forgot to say I am using my 2.6.11 version

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: unable to display message
PostPosted: Wed Dec 14, 2011 10:01 pm  (#4) 
Offline
Script Coder
User avatar

Joined: Apr 23, 2010
Posts: 1553
Location: not from Guildford after all
Perhaps you have an Error Console open?

_________________
Any sufficiently primitive technology is indistinguishable from a rock.


Top
 Post subject: Re: unable to display message
PostPosted: Wed Dec 14, 2011 10:10 pm  (#5) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
I get messages to screen on other scripts but not mine

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: unable to display message
PostPosted: Wed Dec 14, 2011 10:18 pm  (#6) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
Just noticed that the message displays under the screen next to the 100% box for a few seconds as if it was a tool instruction

I cannot see that I have a error console open anywhere,

If I set this 'gimp-message-set-handler' to error console the error console opens on the screen and displays the message and if set to message box nothing displays.

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: unable to display message
PostPosted: Thu Dec 15, 2011 3:53 am  (#7) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
To me this sounds like a window management problem, so my questions are:
What operating system/window manager?
What settings do you have set for Edit>Preferences>Window Management

Also, I just tried my Xach blurry thing script, which does a similar to yours, but because the message is generated after the (gimp-image-undo-group-start image) I also get another error message about leaving the image undo in an inconsistent state.

I've just noticed that I don't use gimp-message, I use error instead:
(if (= (car (gimp-selection-is-empty image)) TRUE) (error "No selection found"))

because there's no point in my script continuing if there isn't a selection. And note that gimp-message isn't displayed immediately as GIMP tries to collect all the messages together to display in one dialog rather than lots.

Kevin


Top
 Post subject: Re: unable to display message
PostPosted: Thu Dec 15, 2011 5:24 am  (#8) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
I checked in preferences, all there seems normal, I ran your script without selection and message displayed, tried your line of script in same place on my script, and it displays. but no idea what fixed it, will check more.
Thankyou for that I am very releived. :yes :tyspin

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Last edited by Graechan on Thu Dec 15, 2011 5:41 am, edited 1 time in total.

Top
 Post subject: Re: unable to display message
PostPosted: Thu Dec 15, 2011 5:32 am  (#9) 
Offline
Script Coder
User avatar

Joined: Jun 22, 2010
Posts: 1171
Location: Here and there
Graechan wrote:
I checked in preferences, all there seems normal, I ran your script without selection and message displayed, tried your line of script in same place on my script, nothing displays. :gaah


Which to me says that it's somewhere in your code that doesn't get executed. If it were me, I'd start throwing in (error "got here") at various places to see what the execution path is!

Kevin


Top
 Post subject: Re: unable to display message
PostPosted: Thu Dec 15, 2011 5:48 am  (#10) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
Kevin I seemed to have found the right spot as you suggested :clap :hi5
but I must have done something wrong when refreshing so I restarted gimp, now works thankyou

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
 Post subject: Re: unable to display message
PostPosted: Thu Dec 15, 2011 8:33 pm  (#11) 
Offline
Script Coder
User avatar

Joined: Feb 18, 2011
Posts: 4826
Location: Bendigo Vic. Australia
Here is the best location Kevin and I found for "error message" "gimp-message" would not function, and becouse error stops the script it should not be inside any tasks such as the undo section, best used at start or finish of script, or maybe by closing undo first.
(let* (
            (image-layer (car (gimp-image-get-active-layer image)))
         (width (car (gimp-image-width image)))
         (height (car (gimp-image-height image)))
         (zoom-layer 0)         
        )
   (if (= (car (gimp-selection-is-empty image)) TRUE) (error "No Selection Found"))
   
   (gimp-context-push)
        (gimp-image-undo-group-start image)
   (gimp-context-set-foreground '(0 0 0))
   (gimp-context-set-background '(255 255 255))
   
   
   (if (= (car (gimp-selection-is-empty image)) FALSE)
   (begin
   (gimp-edit-copy image-layer)
   (gimp-edit-paste image-layer TRUE)
   (set! zoom-layer (car (gimp-image-get-floating-sel image)))   
   (gimp-floating-sel-to-layer zoom-layer)
   (gimp-drawable-set-name zoom-layer "Zoom")
   
   )
   )

_________________
Image
No matter how much you push the envelope, it'll still be stationery.


Top
Post new topic Reply to topic  [ 11 posts ] 

All times are UTC - 5 hours [ DST ]



* Login  



Powered by phpBB3 © phpBB Group