From b901918e7616dd346bfeb3e3c22be608a27f8da4 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Tue, 21 Mar 2017 11:59:14 +0100 Subject: 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. --- lib/wx/examples/demo/demo.erl | 3 +++ 1 file changed, 3 insertions(+) (limited to 'lib/wx/examples/demo') 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}]), -- cgit v1.2.3