aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx/test/wx_obj_test.erl
diff options
context:
space:
mode:
authorZandra Norman <[email protected]>2017-01-24 16:13:48 +0100
committerZandra Norman <[email protected]>2017-04-21 15:02:49 +0200
commit9e396c8676e5a7eacbe5e7b2d93ee080298eb8fb (patch)
tree4710d60f70d832333c4979886d67368ebe1482dc /lib/wx/test/wx_obj_test.erl
parent215f61f223a07493d1147a04375d11f3c7819e42 (diff)
downloadotp-9e396c8676e5a7eacbe5e7b2d93ee080298eb8fb.tar.gz
otp-9e396c8676e5a7eacbe5e7b2d93ee080298eb8fb.tar.bz2
otp-9e396c8676e5a7eacbe5e7b2d93ee080298eb8fb.zip
wx: make wx_object callbacks optional
Diffstat (limited to 'lib/wx/test/wx_obj_test.erl')
-rw-r--r--lib/wx/test/wx_obj_test.erl5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/wx/test/wx_obj_test.erl b/lib/wx/test/wx_obj_test.erl
index 23142e28b2..1b0a9e9091 100644
--- a/lib/wx/test/wx_obj_test.erl
+++ b/lib/wx/test/wx_obj_test.erl
@@ -79,6 +79,9 @@ handle_cast(What, State = #state{parent=Pid}) ->
Pid ! {cast, What},
{noreply, State}.
+handle_info({call_undef_fun, {Mod, Fun}}, State) ->
+ Mod:Fun(),
+ {noreply, State};
handle_info(What, State = #state{parent=Pid}) ->
Pid ! {info, What},
{noreply, State}.
@@ -87,6 +90,8 @@ terminate(What, #state{parent=Pid, opts=Opts, user_state=US}) ->
case proplists:get_value(terminate, Opts) of
undefined ->
ok;
+ {Mod, Fun} ->
+ Mod:Fun();
Terminate ->
Terminate(US)
end,