aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx/examples/demo
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2017-03-21 11:59:14 +0100
committerDan Gudmundsson <[email protected]>2017-04-06 15:45:06 +0200
commitb901918e7616dd346bfeb3e3c22be608a27f8da4 (patch)
tree76f03bc8142886b8d2995fcbc4c63fe8521d6509 /lib/wx/examples/demo
parent7504aef08abb050d5c3d56f77704d21e15a85b62 (diff)
downloadotp-b901918e7616dd346bfeb3e3c22be608a27f8da4.tar.gz
otp-b901918e7616dd346bfeb3e3c22be608a27f8da4.tar.bz2
otp-b901918e7616dd346bfeb3e3c22be608a27f8da4.zip
Avoid livelock in driver when batching commands
With a bad timing in wx:batch() the driver could get stuck handling commands without ever checking for gui events. Avoid that by exiting loop after the driver have done cond_wait a couple of times.
Diffstat (limited to 'lib/wx/examples/demo')
-rw-r--r--lib/wx/examples/demo/demo.erl3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/wx/examples/demo/demo.erl b/lib/wx/examples/demo/demo.erl
index 8b7412017a..0258202a67 100644
--- a/lib/wx/examples/demo/demo.erl
+++ b/lib/wx/examples/demo/demo.erl
@@ -243,6 +243,9 @@ handle_event(#wx{id = Id,
%% If you are going to printout mainly text it is easier if
%% you generate HTML code and use a wxHtmlEasyPrint
%% instead of using DCs
+
+ %% Printpreview doesn't work in >2.9 without this
+ wxIdleEvent:setMode(?wxIDLE_PROCESS_ALL),
Module = "ex_" ++ wxListBox:getStringSelection(State#state.selector) ++ ".erl",
HEP = wxHtmlEasyPrinting:new([{name, "Print"},
{parentWindow, State#state.win}]),