aboutsummaryrefslogtreecommitdiffstats
path: root/lib/gs/doc/src/examples/ex1.erl
diff options
context:
space:
mode:
authorErlang/OTP <[email protected]>2009-11-20 14:54:40 +0000
committerErlang/OTP <[email protected]>2009-11-20 14:54:40 +0000
commit84adefa331c4159d432d22840663c38f155cd4c1 (patch)
treebff9a9c66adda4df2106dfd0e5c053ab182a12bd /lib/gs/doc/src/examples/ex1.erl
downloadotp-84adefa331c4159d432d22840663c38f155cd4c1.tar.gz
otp-84adefa331c4159d432d22840663c38f155cd4c1.tar.bz2
otp-84adefa331c4159d432d22840663c38f155cd4c1.zip
The R13B03 release.OTP_R13B03
Diffstat (limited to 'lib/gs/doc/src/examples/ex1.erl')
-rw-r--r--lib/gs/doc/src/examples/ex1.erl20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/gs/doc/src/examples/ex1.erl b/lib/gs/doc/src/examples/ex1.erl
new file mode 100644
index 0000000000..8ba353a1d7
--- /dev/null
+++ b/lib/gs/doc/src/examples/ex1.erl
@@ -0,0 +1,20 @@
+-module(ex1).
+-copyright('Copyright (c) 1991-97 Ericsson Telecom AB').
+-vsn('$Revision: /main/release/2 $ ').
+
+-export([init/0]).
+
+init() ->
+ S = gs:start(),
+ %% the parent of a top-level window is the gs server
+ Win = gs:create(window,S,[{width,200},{height,100}]),
+ Butt = gs:create(button,Win,[{label, {text,"Press Me"}}]),
+ gs:config(Win, {map,true}),
+ loop(Butt).
+
+loop(Butt) ->
+ receive
+ {gs, Butt, click, Data, Args} ->
+ io:format("Hello There~n",[]),
+ loop(Butt)
+ end.