wx:batch/1 on Windows 10

zxq9 zxq9@REDACTED
Sun Jan 26 02:59:23 CET 2020


On 2020/01/21 20:16, Dan Gudmundsson wrote:
>      > One thing that have changed is wxWidgets version, i.e. upgrade
>     from 2.8
>      > to 3.0.3 (soon to be 3.1 on windows),
>      > but I don't know what is causing this, nor how where is should be
>     fixed
>      > in the application code,
>      >   wx wrapper or wxwidgets library.

Hi, again.

After confirming the behavior (and also finding that freeze/1, [make 
stuff], thaw/1 doesn't work on Windows) someone in the SO Erlang channel 
found this bug that has been around forever and seems to apply only to 
wxMSW:

https://trac.wxwidgets.org/ticket/10748

The description is exactly the problem I see. Hopefully they'll get this 
cleared up. It is a very weird problem. I imagine I can create a 
workaround, but will need a few hours to mess with it to figure out a way.

If they fix freeze/thaw on all platforms then a non-hacky implementation 
of batch/1 could be:


   -spec batch(Window, Fun) -> Result
       when Window :: wx:wx_object(),
            Fun    :: fun(),
            Result :: term().

   batch(Window, Fun) ->
       ok = wxWindow:freeze(Window),
       Result = Fun(),
       ok = wxWindow:thaw(Window),
       Result.

Fingers crossed this is addressed in 3.1.

-Craig



More information about the erlang-questions mailing list