aboutsummaryrefslogtreecommitdiffstats
path: root/lib/observer/src/observer_lib.erl
diff options
context:
space:
mode:
authorSiri Hansen <[email protected]>2016-12-20 09:42:01 +0100
committerSiri Hansen <[email protected]>2016-12-20 09:42:01 +0100
commita4350201d204d61ee67b7330200c8d7d6d4b38d5 (patch)
tree5c0e1f289438b3d2ff934d98add3d40979f6426d /lib/observer/src/observer_lib.erl
parentf8bc348d6a717e84709eaebf8ebd882f41052c24 (diff)
parentf0152387b96dc0c2ce5ecf7805fc435cb400356e (diff)
downloadotp-a4350201d204d61ee67b7330200c8d7d6d4b38d5.tar.gz
otp-a4350201d204d61ee67b7330200c8d7d6d4b38d5.tar.bz2
otp-a4350201d204d61ee67b7330200c8d7d6d4b38d5.zip
Merge branch 'maint'
Diffstat (limited to 'lib/observer/src/observer_lib.erl')
-rw-r--r--lib/observer/src/observer_lib.erl14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/observer/src/observer_lib.erl b/lib/observer/src/observer_lib.erl
index 59a2f9f205..1eaba31a3a 100644
--- a/lib/observer/src/observer_lib.erl
+++ b/lib/observer/src/observer_lib.erl
@@ -461,14 +461,16 @@ create_box(Parent, Data) ->
link_entry(Panel,Value);
_ ->
Value = to_str(Value0),
- case length(Value) > 100 of
- true ->
- Shown = lists:sublist(Value, 80),
+ case string:sub_word(lists:sublist(Value, 80),1,$\n) of
+ Value ->
+ %% Short string, no newlines - show all
+ wxStaticText:new(Panel, ?wxID_ANY, Value);
+ Shown ->
+ %% Long or with newlines,
+ %% use tooltip to show all
TCtrl = wxStaticText:new(Panel, ?wxID_ANY, [Shown,"..."]),
wxWindow:setToolTip(TCtrl,wxToolTip:new(Value)),
- TCtrl;
- false ->
- wxStaticText:new(Panel, ?wxID_ANY, Value)
+ TCtrl
end
end,
wxSizer:add(Line, 10, 0), % space of size 10 horisontally