diff options
author | Dan Gudmundsson <[email protected]> | 2011-12-07 10:46:01 +0100 |
---|---|---|
committer | Dan Gudmundsson <[email protected]> | 2011-12-07 10:46:01 +0100 |
commit | d043151de56130880165e83a85b3e8e2dce35193 (patch) | |
tree | 71340da472f627fb91cf4f35131f7e217d2987c0 /lib/wx/src/wx_object.erl | |
parent | 6b0ab16b86cad902e85b077a078b8f7a6b831205 (diff) | |
download | otp-d043151de56130880165e83a85b3e8e2dce35193.tar.gz otp-d043151de56130880165e83a85b3e8e2dce35193.tar.bz2 otp-d043151de56130880165e83a85b3e8e2dce35193.zip |
[wx] Add callback specs to wx_object
Diffstat (limited to 'lib/wx/src/wx_object.erl')
-rw-r--r-- | lib/wx/src/wx_object.erl | 51 |
1 files changed, 41 insertions, 10 deletions
diff --git a/lib/wx/src/wx_object.erl b/lib/wx/src/wx_object.erl index bc85cd93d4..80f8937656 100644 --- a/lib/wx/src/wx_object.erl +++ b/lib/wx/src/wx_object.erl @@ -108,7 +108,38 @@ get_pid/1 ]). --export([behaviour_info/1]). +%% -export([behaviour_info/1]). +-callback init(Args :: term()) -> + {#wx_ref{}, State :: term()} | {#wx_ref{}, State :: term(), timeout() | hibernate} | + {stop, Reason :: term()} | ignore. +-callback handle_event(Request :: #wx{}, State :: term()) -> + {noreply, NewState :: term()} | + {noreply, NewState :: term(), timeout() | hibernate} | + {stop, Reason :: term(), NewState :: term()}. +-callback handle_call(Request :: term(), From :: {pid(), Tag :: term()}, + State :: term()) -> + {reply, Reply :: term(), NewState :: term()} | + {reply, Reply :: term(), NewState :: term(), timeout() | hibernate} | + {noreply, NewState :: term()} | + {noreply, NewState :: term(), timeout() | hibernate} | + {stop, Reason :: term(), Reply :: term(), NewState :: term()} | + {stop, Reason :: term(), NewState :: term()}. +-callback handle_cast(Request :: term(), State :: term()) -> + {noreply, NewState :: term()} | + {noreply, NewState :: term(), timeout() | hibernate} | + {stop, Reason :: term(), NewState :: term()}. +-callback handle_info(Info :: timeout() | term(), State :: term()) -> + {noreply, NewState :: term()} | + {noreply, NewState :: term(), timeout() | hibernate} | + {stop, Reason :: term(), NewState :: term()}. +-callback terminate(Reason :: (normal | shutdown | {shutdown, term()} | + term()), + State :: term()) -> + term(). +-callback code_change(OldVsn :: (term() | {down, term()}), State :: term(), + Extra :: term()) -> + {ok, NewState :: term()} | {error, Reason :: term()}. + %% System exports -export([system_continue/3, @@ -125,15 +156,15 @@ %%% API %%%========================================================================= %% @hidden -behaviour_info(callbacks) -> - [{init,1}, - {handle_call,3}, - {handle_info,2}, - {handle_event,2}, - {terminate,2}, - {code_change,3}]; -behaviour_info(_Other) -> - undefined. +%% behaviour_info(callbacks) -> +%% [{init,1}, +%% {handle_call,3}, +%% {handle_info,2}, +%% {handle_event,2}, +%% {terminate,2}, +%% {code_change,3}]; +%% behaviour_info(_Other) -> +%% undefined. %% ----------------------------------------------------------------- |