Re: [Gimp-developer] Get currently active image in python

On 23 March 2012 15:06, Chris Mohler <cr33dog gmail com> wrote:
> On Fri, Mar 23, 2012 at 12:51 PM, Jon Decker <jondecker76 gmail com> wrote:
>> Thanks for the reply.  I do realize that the current image and drawable is
>> passed to the plugin when first opened.  Perhaps I should explain further.
>> I'm trying to build more of an extension that is opened just once, and
>> updates as you move from image to image. (Its a time tracking window which
>> stays open along side gimp).  I wanted to make it so that a new instance of
>> the plugin doesn't have to run for each image - just open it once, and it
>> "knows" which image is currently active so that it can populate my sqlite
>> database.
>> Is there a way to do this at in in gimp?

No, there is not - at least no clean ways that I can think of. There
is nothing on the GIMP's API that marks an image as the
currently active image.(The "unclean way" I can think of  would mean
to use GTK+ instrumentation for GUI debugging to be able to introspect
windows, and infere the active image from its title)

Another "unclean", but tidier, way would be to create a very simple
script, with no parameters but "image and drawable" that would just
signal your main plug-in when called - and you could bind it to a
shortcut key and press it everytime you switch the active image.

To notify your mainplug-in you could use some file-system signaling
mechanism, xmlrpc, or some gtk+ mechanism..

I'd use this second approach.

> I'm not sure (reposting to list - be sure to 'reply-all' vs just 'reply').
> Chris
> _______________________________________________
> gimp-developer-list mailing list
> gimp-developer-list gnome org

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]