aboutsummaryrefslogtreecommitdiffstats
path: root/lib/wx/src/wx_object.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/src/wx_object.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/src/wx_object.erl')
-rw-r--r--lib/wx/src/wx_object.erl8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/wx/src/wx_object.erl b/lib/wx/src/wx_object.erl
index a2acbb0a63..c22a083eb9 100644
--- a/lib/wx/src/wx_object.erl
+++ b/lib/wx/src/wx_object.erl
@@ -107,7 +107,8 @@
call/2, call/3,
cast/2,
reply/2,
- get_pid/1
+ get_pid/1,
+ set_pid/2
]).
%% -export([behaviour_info/1]).
@@ -306,6 +307,11 @@ cast(Name, Request) when is_atom(Name) orelse is_pid(Name) ->
get_pid(#wx_ref{state=Pid}) when is_pid(Pid) ->
Pid.
+%% @spec (Ref::wxObject(), pid()) -> wxObject()
+%% @doc Sets the controlling process of the object handle.
+set_pid(#wx_ref{}=R, Pid) when is_pid(Pid) ->
+ R#wx_ref{state=Pid}.
+
%% -----------------------------------------------------------------
%% Send a reply to the client.
%% -----------------------------------------------------------------