|Change Label Image when pressed [message #1494353]
||Mon, 01 December 2014 11:51
|| John Gymer
Registered: November 2012
This could be a general question for SWT too, and maybe I've missed something in the event API, but I cannot see it...|
I have a Label that acts like a Button - when pressed I capture it and perform some event logic. This is done with a MouseDown event, since Label does not support a Selection event.
OK, but now I want to give my Label an image, and change the image for a 'pressed' alternative image just while pressed, then revert to the original image when unpressed.
I can use the MouseDown event, and inside here change the image to my pressed image, but how do I reliably change it back when the press is released? MouseUp doesn't work reliably because the user might MouseDown on the control, then drag outside the Label and let go, in which case I never get the MouseUp.
I cannot use MouseEnter/MouseExit because these are not supported by RAP (and rightly so).
Is there an alternative where I can achieve this 'different image while pressed' effect?
Just because you can doesn't mean you should
Powered by FUDForum
. Page generated in 0.02501 seconds