Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-swt-dev] Context menu for Image

I suggest you draw the image within a Canvas (which you're probably doing anyway) and listen for the MenuDetect event.  Then you open a popup menu parented against the shell.  This is kind of the standard way of doing something like this.

If the canvas contains multiple GC artifacts (i.e. is bigger than just the image), then you will have to test for mouse pixel location, which really isn't all that bad.  (e.x, e.y on the MouseEvent instance)

Daniel

On 3/1/07, R R <linumax@xxxxxxxxx> wrote:
Hi,

How can I have a pop up menu for an image?
what I can think of is to assign the menu to shell and use event coordinates to see if user right clicked on the image, but there are a number of problems with this approach.
Is there a better way to do this?

Thanx
Ray

_______________________________________________
platform-swt-dev mailing list
platform-swt-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-swt-dev



Back to the top