aboutsummaryrefslogtreecommitdiffstats
path: root/lib/observer/src/observer_wx.erl
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2017-05-09 11:22:26 +0200
committerDan Gudmundsson <[email protected]>2017-05-09 11:38:35 +0200
commit55dc2d3f1bc236de9b47aeeb2a38120fd16e8394 (patch)
treef2d29e60cf6bbf4eec116499da7b55cd4222c451 /lib/observer/src/observer_wx.erl
parent769d0e95bf09f1c55e5d176a5f261c4767995b2b (diff)
downloadotp-55dc2d3f1bc236de9b47aeeb2a38120fd16e8394.tar.gz
otp-55dc2d3f1bc236de9b47aeeb2a38120fd16e8394.tar.bz2
otp-55dc2d3f1bc236de9b47aeeb2a38120fd16e8394.zip
observer: listen on correct notebook change
Only listen to toplevel notebook changes, otherwise if another windows have a notebook and do not handle the event this process gets it and handles it wrongly.
Diffstat (limited to 'lib/observer/src/observer_wx.erl')
-rw-r--r--lib/observer/src/observer_wx.erl6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/observer/src/observer_wx.erl b/lib/observer/src/observer_wx.erl
index 739761e7fd..9b9e80f479 100644
--- a/lib/observer/src/observer_wx.erl
+++ b/lib/observer/src/observer_wx.erl
@@ -143,7 +143,8 @@ setup(#state{frame = Frame} = State) ->
wxFrame:setTitle(Frame, atom_to_list(node())),
wxStatusBar:setStatusText(StatusBar, atom_to_list(node())),
- wxNotebook:connect(Notebook, command_notebook_page_changed, [{skip, true}]),
+ wxNotebook:connect(Notebook, command_notebook_page_changed,
+ [{skip, true}, {id, ?ID_NOTEBOOK}]),
wxFrame:connect(Frame, close_window, []),
wxMenu:connect(Frame, command_menu_selected),
wxFrame:show(Frame),
@@ -230,12 +231,13 @@ setup(#state{frame = Frame} = State) ->
%%Callbacks
handle_event(#wx{event=#wxNotebook{type=command_notebook_page_changed, nSel=Next}},
- #state{active_tab=Previous, node=Node, panels=Panels} = State) ->
+ #state{active_tab=Previous, node=Node, panels=Panels, status_bar=SB} = State) ->
{_, Obj, _} = lists:nth(Next+1, Panels),
case wx_object:get_pid(Obj) of
Previous ->
{noreply, State};
Pid ->
+ wxStatusBar:setStatusText(SB, ""),
Previous ! not_active,
Pid ! {active, Node},
{noreply, State#state{active_tab=Pid}}