table of contents
other versions
- wheezy 1:15.b.1-dfsg-4+deb7u1
- wheezy-backports 1:17.3-dfsg-4~bpo70+1
- jessie 1:17.3-dfsg-4+deb8u1
- jessie-backports 1:19.2.1+dfsg-2~bpo8+1
- testing 1:19.2.1+dfsg-2
- unstable 1:19.2.1+dfsg-2
- experimental 1:19.3.1+dfsg-1
wx_object(3erl) | Erlang Module Definition | wx_object(3erl) |
NAME¶
wx_object - wx_object - Generic wx object behaviour.DESCRIPTION¶
wx_object - Generic wx object behaviour This is a behaviour module that can be used for "sub classing" wx objects. It works like a regular gen_server module and creates a server per object. NOTE: Currently no form of inheritance is implemented. The user module should export: init(Args) should return-module(myDialog). -export([new/2, show/1, destroy/1]). %% API -export([init/1, handle_call/3, handle_event/2, handle_info/2, code_change/3, terminate/2]). new/2, showModal/1, destroy/1]). %% Callbacks %% Client API new(Parent, Msg) -> wx_object:start(?MODULE, [Parent,Id], []). show(Dialog) -> wx_object:call(Dialog, show_modal). destroy(Dialog) -> wx_object:call(Dialog, destroy). %% Server Implementation ala gen_server init([Parent, Str]) -> Dialog = wxDialog:new(Parent, 42, "Testing", []), ... wxDialog:connect(Dialog, command_button_clicked), {Dialog, MyState}. handle_call(show, _From, State) -> wxDialog:show(State#state.win), {reply, ok, State}; ... handle_event(#wx{}, State) -> io:format("Users clicked button~n",[]), {noreply, State}; ...
EXPORTS¶
start(Name, Mod, Args, Options) -> wxWindow() (see module wxWindow)
Types:
Name = {local, atom()}
Mod = atom()
Args = term()
Options = [{timeout, Timeout} | {debug, [Flag]}]
Flag = trace | log | {logfile, File} | statistics | debug
Starts a generic wx_object server and invokes Mod:init(Args) in the new
process.
Types:
Mod = atom()
Args = term()
Options = [{timeout, Timeout} | {debug, [Flag]}]
Flag = trace | log | {logfile, File} | statistics | debug
Starts a generic wx_object server and invokes Mod:init(Args) in the new
process.
Types:
Name = {local, atom()}
Mod = atom()
Args = term()
Options = [{timeout, Timeout} | {debug, [Flag]}]
Flag = trace | log | {logfile, File} | statistics | debug
Starts a generic wx_object server and invokes Mod:init(Args) in the new
process.
Make a call to a wx_object server. The call waits until it gets a result.
Invokes handle_call(Request, From, State) in the server
Make a call to a wx_object server with a timeout. Invokes handle_call(Request,
From, State) in server
Make a cast to a wx_object server. Invokes handle_cast(Request, State) in the
server
Get the pid of the object handle.
Get the pid of the object handle.
AUTHORS¶
wx 0.99.2 |