diff options
author | Dan Gudmundsson <[email protected]> | 2010-09-09 10:19:38 +0200 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2010-09-09 10:19:38 +0200 |
commit | 3608de28c0bb6367182d781797032ee05b516b21 (patch) | |
tree | e1a732ba7cb7f182178bec5d4c769e5d554c2e04 /lib/et/src/et_wx_viewer.erl | |
parent | 7cff751421608e1d65e76a74249d80f33ae287d2 (diff) | |
parent | 7890861fcf7a55bd8869dca004fa042715a05f0b (diff) | |
download | otp-3608de28c0bb6367182d781797032ee05b516b21.tar.gz otp-3608de28c0bb6367182d781797032ee05b516b21.tar.bz2 otp-3608de28c0bb6367182d781797032ee05b516b21.zip |
Merge branch 'dgud/et_fixes/OTP-8830' into dev
* dgud/et_fixes/OTP-8830:
Fix wx viewer so it works on windows/mac.
Diffstat (limited to 'lib/et/src/et_wx_viewer.erl')
-rw-r--r-- | lib/et/src/et_wx_viewer.erl | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lib/et/src/et_wx_viewer.erl b/lib/et/src/et_wx_viewer.erl index 5cd3563aed..d42f8c0c86 100644 --- a/lib/et/src/et_wx_viewer.erl +++ b/lib/et/src/et_wx_viewer.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2000-2009. All Rights Reserved. +%% Copyright Ericsson AB 2000-2010. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -1233,7 +1233,7 @@ create_main_window(S) -> [{flag, ?wxEXPAND}]), CanvasSizer = wxBoxSizer:new(?wxHORIZONTAL), - Canvas = wxPanel:new(Panel, []), + Canvas = wxPanel:new(Panel, [{style, ?wxFULL_REPAINT_ON_RESIZE}]), {CanvasW,CanvasH} = wxPanel:getSize(Canvas), ScrollBar = wxScrollBar:new(Panel, ?wxID_ANY, [{style, ?wxSB_VERTICAL}]), @@ -1244,7 +1244,13 @@ create_main_window(S) -> wxPanel:connect(Canvas, left_up), wxPanel:connect(Canvas, right_up), wxPanel:connect(Canvas, size), - wxPanel:connect(Canvas, paint), + Self = self(), + wxPanel:connect(Canvas, paint, [{callback, %% Needed on windows + fun(Ev, _) -> + DC = wxPaintDC:new(Canvas), + wxPaintDC:destroy(DC), + Self ! Ev + end}]), wxPanel:connect(Canvas, key_down), wxPanel:connect(Canvas, kill_focus), wxPanel:connect(Canvas, enter_window, [{skip, true}]), @@ -1437,6 +1443,7 @@ create_help_menu(Bar) -> clear_canvas(S) -> DC = wxClientDC:new(S#state.canvas), + wxDC:setBackground(DC, ?wxWHITE_BRUSH), %% Needed on mac wxDC:clear(DC), {CanvasW, CanvasH} = wxPanel:getSize(S#state.canvas), wxSizer:recalcSizes(S#state.canvas_sizer), |