Close If Clicked Outside Form

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Close If Clicked Outside Form

herberth guzman
Hi

Close If Clicked Outside Form

Is there any way to close a form if it is clicked outside the main form?

For example, just as applets on the network or audio volume or KDE menu.

Thanks


Herberth Guzman
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|

Re: Close If Clicked Outside Form

Tobias Boege-2
On Thu, 04 May 2017, herberth guzman wrote:
> Hi
>
> Close If Clicked Outside Form
>
> Is there any way to close a form if it is clicked outside the main form?
>
> For example, just as applets on the network or audio volume or KDE menu.
>

Try the Deactivate event. The documentation doesn't really state what it
means for a window to be "deactivated" but a quick test shows that this
event is raised when the window ceases to be... the active one, e.g. when
you click outside of it or select another window by Alt+Tab (on my desktop
at least).

Regards,
Tobi

--
"There's an old saying: Don't change anything... ever!" -- Mr. Monk

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user
Reply | Threaded
Open this post in threaded view
|

Re: Close If Clicked Outside Form

Fabien Bodard-4
use

MyForm.ShowPopup(...)

http://gambaswiki.org/wiki/comp/gb.qt4/window/showpopup?l=fr

It was made for that :-).

2017-05-04 19:30 GMT+02:00 Tobias Boege <[hidden email]>:

> On Thu, 04 May 2017, herberth guzman wrote:
>> Hi
>>
>> Close If Clicked Outside Form
>>
>> Is there any way to close a form if it is clicked outside the main form?
>>
>> For example, just as applets on the network or audio volume or KDE menu.
>>
>
> Try the Deactivate event. The documentation doesn't really state what it
> means for a window to be "deactivated" but a quick test shows that this
> event is raised when the window ceases to be... the active one, e.g. when
> you click outside of it or select another window by Alt+Tab (on my desktop
> at least).
>
> Regards,
> Tobi
>
> --
> "There's an old saying: Don't change anything... ever!" -- Mr. Monk
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, Slashdot.org! http://sdm.link/slashdot
> _______________________________________________
> Gambas-user mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gambas-user



--
Fabien Bodard

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Gambas-user mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gambas-user