aboutsummaryrefslogtreecommitdiffstats
path: root/lib/observer/src/observer_sys_wx.erl
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2011-11-10 11:12:48 +0100
committerDan Gudmundsson <[email protected]>2011-11-11 14:59:18 +0100
commit3caa688c5522b8f0f039b9375cf6377b1bd88f0e (patch)
tree3a5fb27501f1a3e729683fc29b47df9aa14d9189 /lib/observer/src/observer_sys_wx.erl
parentb7b88933672591d7f7c2a71a4c1643b6ca486f23 (diff)
downloadotp-3caa688c5522b8f0f039b9375cf6377b1bd88f0e.tar.gz
otp-3caa688c5522b8f0f039b9375cf6377b1bd88f0e.tar.bz2
otp-3caa688c5522b8f0f039b9375cf6377b1bd88f0e.zip
[observer] Fix portability bugs
Turn on generic listctrl implementation on Mac, the native doesn't work in wx-2.8. Fix listctrl colours on mac Turn on wxSystemMenu for miniFrame to get a close box on Windows. Direct observer help to a browser. Cleanups
Diffstat (limited to 'lib/observer/src/observer_sys_wx.erl')
-rw-r--r--lib/observer/src/observer_sys_wx.erl25
1 files changed, 6 insertions, 19 deletions
diff --git a/lib/observer/src/observer_sys_wx.erl b/lib/observer/src/observer_sys_wx.erl
index 36aa226bd1..ddedcf3829 100644
--- a/lib/observer/src/observer_sys_wx.erl
+++ b/lib/observer/src/observer_sys_wx.erl
@@ -47,14 +47,7 @@ start_link(Notebook, Parent) ->
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-init(Args) ->
- try
- init2(Args)
- catch E:R ->
- io:format("~p:~p ~p~n",[E,R, erlang:get_stacktrace()])
- end.
-
-init2([Notebook, Parent]) ->
+init([Notebook, Parent]) ->
SysInfo = sys_info(),
{Info, Stat} = info_fields(),
Panel = wxPanel:new(Notebook),
@@ -80,16 +73,11 @@ create_sys_menu(Parent) ->
observer_wx:create_menus(Parent, [View]).
update_syspage(#sys_wx_state{node = Node, fields=Fields, sizer=Sizer}) ->
- try
SysInfo = observer_wx:try_rpc(Node, ?MODULE, sys_info, []),
{Info, Stat} = info_fields(),
observer_lib:update_info(Fields, observer_lib:fill_info(Info, SysInfo) ++
observer_lib:fill_info(Stat, SysInfo)),
- wxSizer:layout(Sizer)
- catch E:R ->
- io:format("~p:~p ~p~n",[E,R, erlang:get_stacktrace()])
- end,
- ok.
+ wxSizer:layout(Sizer).
info_fields() ->
Info = [{"System and Architecture",
@@ -165,18 +153,17 @@ handle_info(not_active, #sys_wx_state{timer = Timer} = State) ->
{noreply, State#sys_wx_state{timer = observer_lib:stop_timer(Timer)}};
handle_info(Info, State) ->
- io:format("~p, ~p, Handle info: ~p~n", [?MODULE, ?LINE, Info]),
+ io:format("~p:~p: Unhandled info: ~p~n", [?MODULE, ?LINE, Info]),
{noreply, State}.
-terminate(Reason, _State) ->
- io:format("~p terminating. Reason: ~p~n", [?MODULE, Reason]),
+terminate(_Reason, _State) ->
ok.
code_change(_, _, State) ->
{stop, not_yet_implemented, State}.
handle_call(Msg, _From, State) ->
- io:format("~p~p: Got Call ~p~n",[?MODULE, ?LINE, Msg]),
+ io:format("~p~p: Unhandled Call ~p~n",[?MODULE, ?LINE, Msg]),
{reply, ok, State}.
handle_cast(Msg, State) ->
@@ -199,7 +186,7 @@ handle_event(#wx{id = ?ID_REFRESH_INTERVAL,
{noreply, State#sys_wx_state{timer=Timer}};
handle_event(Event, State) ->
- io:format("handle event ~p\n", [Event]),
+ io:format("~p:~p: Unhandled event ~p\n", [?MODULE,?LINE,Event]),
{noreply, State}.