diff options
author | Erlang/OTP <[email protected]> | 2009-11-20 14:54:40 +0000 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2009-11-20 14:54:40 +0000 |
commit | 84adefa331c4159d432d22840663c38f155cd4c1 (patch) | |
tree | bff9a9c66adda4df2106dfd0e5c053ab182a12bd /lib/gs/doc/src/examples/ex6.erl | |
download | otp-84adefa331c4159d432d22840663c38f155cd4c1.tar.gz otp-84adefa331c4159d432d22840663c38f155cd4c1.tar.bz2 otp-84adefa331c4159d432d22840663c38f155cd4c1.zip |
The R13B03 release.OTP_R13B03
Diffstat (limited to 'lib/gs/doc/src/examples/ex6.erl')
-rw-r--r-- | lib/gs/doc/src/examples/ex6.erl | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/gs/doc/src/examples/ex6.erl b/lib/gs/doc/src/examples/ex6.erl new file mode 100644 index 0000000000..ca73deb78e --- /dev/null +++ b/lib/gs/doc/src/examples/ex6.erl @@ -0,0 +1,23 @@ +-module(ex6). +-copyright('Copyright (c) 1991-97 Ericsson Telecom AB'). +-vsn('$Revision: /main/release/2 $ '). + +-export([start/0,init/0]). + +start() -> + spawn(ex6,init,[]). + +init() -> + S = gs:start(), + W = gs:create(window,S,[{map,true},{keypress,true}, + {buttonpress,true},{motion,true}]), + gs:create(button,W,[{label,{text,"PressMe"}},{enter,true}, + {leave,true}]), + event_loop(). + +event_loop() -> + receive + X -> + io:format("Got event: ~w~n",[X]), + event_loop() + end. |