Skip to content

Commit

Permalink
Added backend option to webview example
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicletz committed Dec 7, 2023
1 parent 423eed2 commit 361e2e4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/wx/examples/demo/ex_webview.erl
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,11 @@ do_init(Config) ->
Sizer = wxBoxSizer:new(?wxHORIZONTAL),

os:type() == {win32,nt} andalso wx_misc:mSWSetEmulationLevel(?wxWEBVIEWIE_EMU_IE11),
try wxWebView:new(Parent, ?wxID_ANY, [{url, "https://www.erlang.org/"}]) of
Opts = case os:getenv("WX_WEBVIEW_BACKEND") of
false -> [{url, "https://www.erlang.org/"}];
Backend -> [{url, "https://www.erlang.org/"}, {backend, Backend}]
end,
try wxWebView:new(Parent, ?wxID_ANY, Opts) of
WebView ->
{ok, Timer} = timer:send_interval(100, update_passive_boxes),
Events = [webview_navigating, webview_navigated, webview_loaded, webview_error,
Expand Down

0 comments on commit 361e2e4

Please sign in to comment.