Discussion:
Freezing top level windows
(too old to reply)
Paarvai Naai wxWidgets Users
2009-04-25 01:45:52 UTC
Permalink
Hi all,

I would like to switch the mouse cursor to an hourglass and freeze my
GUI from accepting events for about 1-2 seconds. I have found that
using wxEnableTopLevelWindows(FALSE) in MSW works nicely for this.
Keyboard and mouse events are thrown away and the window is otherwise
as-is. On GTK, this function grays all of the widgets as well, which
is redundant since the mouse cursor is already an hourglass. I would
prefer that all of the widgets not be grayed but just unclickable
(somewhat like when a modal dialog is displayed).

What is the quickest, cleanest, cross-platform way to do this with WX?

Please make sure to include wx-***@lists.wxwidgets.org in any reply
as I am not personally subscribed to the wx-dev list.

Thanks in advance!
Paarvai
Vadim Zeitlin
2009-04-25 12:04:31 UTC
Permalink
On Fri, 24 Apr 2009 18:45:52 -0700 Paarvai Naai <***@gmail.com> wrote:

PN> I would like to switch the mouse cursor to an hourglass and freeze my
PN> GUI from accepting events for about 1-2 seconds. I have found that
PN> using wxEnableTopLevelWindows(FALSE) in MSW works nicely for this.
PN> Keyboard and mouse events are thrown away and the window is otherwise
PN> as-is. On GTK, this function grays all of the widgets as well, which
PN> is redundant since the mouse cursor is already an hourglass.

Unfortunately there is no other way to prevent them from receiving input
under wxGTK right now. I guess we should be able to grab the mouse (which
is what modal dialogs do) and ignore events from it but there is no support
for this currently.

PN> Please make sure to include wx-***@lists.wxwidgets.org in any reply
PN> as I am not personally subscribed to the wx-dev list.

Please don't cross-post to both lists because many people are subscribed
to both of them and getting one copy of a message is quite enough.

Regards,
VZ
--
TT-Solutions: wxWidgets consultancy and technical support
http://www.tt-solutions.com/
Loading...