Updating plugin dialog after click in main window

View: New views
4 Messages — Rating Filter:   Alert me  

Updating plugin dialog after click in main window

by fgingras :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hey all,

I believe this message's subject is quite explicit; basically, I have a plugin dialog in which the user can input three 0-255 numbers for color selection, or alternately use the current foreground color. What I'm looking for is a way for the plugin to know when it should update its own dialog, which would be the time when the user uses the color picker and clicks somewhere on the opened image. As it currently is, picking a color leaves the dialog's inputs unchanged, which is not very elegant.

Also, I was wondering if there is an easy way to add a "color selector thing" (this thing where all available colors are displayed in a rectangle space so you can just click on the one you want) to the dialog. I'm guessing this is more GTK related, but I can't seem to find information about it.

Thank you all and please have a nice day!

François Gingras

Re: Updating plugin dialog after click in main window

by Emil Brink :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Sep 9, 2009 at 3:05 PM, fgingras<francois.gingras.1@...> wrote:

[snip]
> Also, I was wondering if there is an easy way to add a "color selector
> thing" (this thing where all available colors are displayed in a rectangle
> space so you can just click on the one you want) to the dialog. I'm guessing
> this is more GTK related, but I can't seem to find information about it.

Sounds like a http://library.gnome.org/devel/gtk/stable/GtkColorSelection.html
to me.

/Emil
_______________________________________________
Gimp-developer mailing list
Gimp-developer@...
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer

Re: Updating plugin dialog after click in main window

by Liam R E Quin :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, 2009-09-09 at 06:05 -0700, fgingras wrote:
>  What I'm looking
> for is a way for the plugin to know when it should update its own dialog,
> which would be the time when the user uses the color picker and clicks
> somewhere on the opened image.

I'd say look at something like the colour-to-transparency code.

Liam


--
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org www.advogato.org

_______________________________________________
Gimp-developer mailing list
Gimp-developer@...
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer

Re: Updating plugin dialog after click in main window

by Bill Skaggs :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

What you want is probably either a GimpColorSelection
( http://developer.gimp.org/api/2.0/libgimpwidgets/GimpColorSelection.html )
or a GimpColorButton
( http://developer.gimp.org/api/2.0/libgimpwidgets/GimpColorButton.html ),
which pops up a GimpColorSelection when pressed.  I don't think there is any way
to get it to update automatically when the core changes.  Once upon a time this
happened without any programming needed, but in the current Gimp, each
plug-in has its own "context" for things like colors, and there is no way for
the core Gimp application to pass messages to a plug-in, except in response to a
request from the plug-in.  The only way to do it, as far as I know, is for the
plug-in to interrogate the core at regular intervals to see if anything has
changed, and that's a nasty solution.

  -- Bill


_______________________________________________
Gimp-developer mailing list
Gimp-developer@...
https://lists.XCF.Berkeley.EDU/mailman/listinfo/gimp-developer