Hi Mike - Thanks a lot for your reply!
I really don't want to have to deal with a separate preview window. The images that I deal with are huge, and that would just consume even more memory and desktop space, and make the application that I envision seem to be even less "integrated". An "ugly hack" similar to what you suggested could work for my needs. A similar solution might be to provide the coordinates of the mouse click directly through the standard API calls to the plug-in. I don't know if that would require any substantial changes to the API, but obviously that would be undesirable if so. In any case, the hack that you mentioned would work. One possible selection of which mouse coordinates to use would be easy in my mind: It would be the coordinates where the mouse was located when the user right-clicked to get the menu that started the plug-in. If some other mechanism was used to start the plug-in that did not require a mouse click within the displayed image boundaries, then the mouse coordinates could be either undefined, or preferably a special value like maybe (-1,-1). However, if there were some way for the plug-in to communicate with the gimp to request that a selection/mouse click be made, that would probably be even better. In any event, at least I know now that my emails are getting through to the list ok. Thanks again for your reply. Regards, s/KAM ----- Original Message ----- From: "Michael J. Hammel" <[EMAIL PROTECTED]> To: "Kevin Myers" <[EMAIL PROTECTED]> Cc: "Gimp Developer List" <[EMAIL PROTECTED]> Sent: Tuesday, October 15, 2002 9:02 PM Subject: Re: [Gimp-developer] Mouse Coordinates for gimp Script or Plug-in > Thus spoke Kevin Myers > > The other day I sent the following message to both the gimp users and gimp > > developers lists, hoping to determine whether there is any way to obtain > > image coordinates from a mouse click in a gimp plug-in. So far I haven't > > received a single reply. Are there really any of you out there??? :-) Even > > if you don't know or can't answer my question, it might be nice to receive a > > few replies anyway so I can at least confirm that my message actually got > > through ok. > > The developers are here. Probably just busy. :-) > I saw you're message the other day but didn't have time to look into it. > > > If there is presently no way for a gimp plug-in to obtain mouse click image > > coordinates (either at point of menu invocation or later), then I would like > > to submit this as a suggestion to be considered for a future release. > > I'm not aware of a way to get the mouse coordinates from a mouse click in a > canvas window over to the plug-in. Normally, plug-ins will copy the drawable > (layer, selection, or whatever) into their own space to work on it, and > translate their (possibly) scaled version's coordinates into those on the > canvas. While not optimal, it should work for you. > > The problem, as I see it, is that the communications channel between the GIMP > and plug-ins is not event driven but rather function driven - you must invoke > an API call to communicate with the GIMP. Actually, I don't think of that as a > problem. It's just the way things work. At least from what I know. > > One way around this - which would probably be an ugly hack - would be to have > the GIMP save the click location for a canvas and let the plug-in query for > that location. It might be similar to a one-pixel selection. Might be a > problem in knowing when a click is supposed to set that location and when it's > supposed to be applied to the currently active tool. > > Anyway, it's just a thought. For now, you need to copy the drawable into your > space to get coordinates via a preview window. > > BTW, if anyone is interested, I've updated Shawn Amundson's preview widget and > put it into a Glade-based template plug-in. That might be helpful as a start > for you. Or maybe not. It's still a work in progress to make it a very useful > template. Needs documentation, etc. But you can use Glade to edit the > interface. > > http://www.graphics-muse.org/source/gfxmuse.tar.gz > > It's imake based 'cuz I know imake, not autoconf. > -- > Michael J. Hammel | Knowledge comes, > The Graphics Muse | but wisdom lingers. > [EMAIL PROTECTED] | Tennyson, "Locksley Hall" > http://www.graphics-muse.com _______________________________________________ Gimp-developer mailing list [EMAIL PROTECTED] http://lists.xcf.berkeley.edu/mailman/listinfo/gimp-developer