Advertisement
Guest User

wx_object

a guest
Jul 8th, 2019
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Erlang 0.80 KB | None | 0 0
  1. -module(simplewx).
  2. -behaviour(wx_object).
  3. -include_lib("wx/include/wx.hrl").
  4. -record(state, {}).
  5.  
  6. %% API
  7. -export([start_link/0]).
  8.  
  9. %% gen_server callbacks
  10. -export([init/1,
  11.   handle_call/3,
  12.   handle_cast/2,
  13.   handle_info/2,
  14.   terminate/2,
  15.   code_change/3,
  16.   handle_event/2]).
  17.  
  18. %% initialize junction server
  19. start_link() -> gen_server:start_link({local, ?MODULE}, ?MODULE, [], []).
  20.  
  21.  
  22. init([]) ->
  23.     wx:new(),
  24.     Frame = wxFrame:new(wx:null(), -1, "hello"),
  25.     State = #state{},
  26.     {Frame, State}.
  27.  
  28.    
  29. handle_info(_Info, State) -> {noreply, State}.
  30.  
  31. terminate(_Reason, _State) -> ok.
  32.  
  33. code_change(_OldVsn, State, _Extra) -> {ok, State}.
  34.  
  35. handle_call(_Request, _From, State) -> {reply, ok, State}.
  36.  
  37. handle_cast(_Msg, State) -> {noreply, State}.
  38.  
  39. handle_event(_Event, State) -> {noreply, State}.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement