[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.platform.swt] Re: How to make a popup shell close when mouse clicked anywhere outside the shell

Try putting a focus listener on the shell; close it when you lose focus.
I believe that this should have the effect you're looking for.

HTH,

Wayne

On Mon, 2008-06-09 at 09:43 -0500, Hongying Zhang wrote:
> Hello,
> I need create a Popup Shell that will be popuped up when mouse click a 
> control, and this popup shell has to be resizable with some other 
> feature; this popup shell also need have a behavior that when the mouse 
> clicked outside popup Shell, this popup shell will close (just like menu 
> behavior ). Since I cannot subclass SWT Menu widget, so I created my own 
> Popup shell class.
> 
> Now, I have problem to close it when mouse clicked somewhere outside the 
> popup shell. I tried to let the shell listen to mouse up event, but that 
> won'y work. Can someone please let me know what should I do to make this 
> popup shell close when mouse clicked outside the Shell.
> 
> Thanks,
> Hongying