aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx/test/wx_basic_SUITE.erl
diff options
context:
space:
mode:
authorDan Gudmundsson <[email protected]>2016-03-30 09:48:30 +0200
committerDan Gudmundsson <[email protected]>2016-04-22 09:17:40 +0200
commita3a5bcab69695b7bfe8a77f4c1b245a1b58fb5fb (patch)
tree803fc2446613b3f32dbcd81ce4b65b42564fb685 /lib/wx/test/wx_basic_SUITE.erl
parente0a67398ad3d034e1afe59585a5f82af6981c1eb (diff)
downloadotp-a3a5bcab69695b7bfe8a77f4c1b245a1b58fb5fb.tar.gz
otp-a3a5bcab69695b7bfe8a77f4c1b245a1b58fb5fb.tar.bz2
otp-a3a5bcab69695b7bfe8a77f4c1b245a1b58fb5fb.zip
wx: add object set/check funcions
Needed functionality, to avoid abusing opauqe objects.
Diffstat (limited to 'lib/wx/test/wx_basic_SUITE.erl')
-rw-r--r--lib/wx/test/wx_basic_SUITE.erl9
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/wx/test/wx_basic_SUITE.erl b/lib/wx/test/wx_basic_SUITE.erl
index 5fe0de485c..f89f25274a 100644
--- a/lib/wx/test/wx_basic_SUITE.erl
+++ b/lib/wx/test/wx_basic_SUITE.erl
@@ -361,7 +361,8 @@ wx_object(Config) ->
wx:new(),
Me = self(),
Init = fun() ->
- Frame = wxFrame:new(wx:null(), ?wxID_ANY, "Test wx_object", [{size, {500, 400}}]),
+ Frame0 = wxFrame:new(wx:null(), ?wxID_ANY, "Test wx_object", [{size, {500, 400}}]),
+ Frame = wx_object:set_pid(Frame0, self()),
Sz = wxBoxSizer:new(?wxHORIZONTAL),
Panel = wxPanel:new(Frame),
wxSizer:add(Sz, Panel, [{flag, ?wxEXPAND}, {proportion, 1}]),
@@ -371,6 +372,7 @@ wx_object(Config) ->
{Frame, {Frame, Panel}}
end,
Frame = ?mt(wxFrame, wx_obj_test:start([{init, Init}])),
+
timer:sleep(500),
?m(ok, check_events(flush())),
@@ -378,6 +380,11 @@ wx_object(Config) ->
?m({call, foobar, {Me, _}}, wx_object:call(Frame, foobar)),
?m(ok, wx_object:cast(Frame, foobar2)),
?m([{cast, foobar2}|_], flush()),
+
+ ?m(Frame, wx_obj_test:who_are_you(Frame)),
+ {call, {Frame,Panel}, _} = wx_object:call(Frame, fun(US) -> US end),
+ ?m(false, wxWindow:getParent(Panel) =:= Frame),
+ ?m(true, wx:equal(wxWindow:getParent(Panel),Frame)),
FramePid = wx_object:get_pid(Frame),
io:format("wx_object pid ~p~n",[FramePid]),
FramePid ! foo3,