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/ex12.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/ex12.erl')
-rw-r--r-- | lib/gs/doc/src/examples/ex12.erl | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/gs/doc/src/examples/ex12.erl b/lib/gs/doc/src/examples/ex12.erl new file mode 100644 index 0000000000..4af0205061 --- /dev/null +++ b/lib/gs/doc/src/examples/ex12.erl @@ -0,0 +1,33 @@ +-module(ex12). +-copyright('Copyright (c) 1991-97 Ericsson Telecom AB'). +-vsn('$Revision: /main/release/2 $ '). + +-export([start/0,init/0]). + +start() -> spawn(ex12, init, []). + +init() -> + R=[{window,[{width,200},{height,200},{title,"grid"},{map, true}], + {grid, [{x,10},{y,10},{height,180},{width,180},{columnwidths,[80,60]}, + {rows,{1, 20}}], + [{gridline,[{text,{1,"NAME"}},{text,{2,"PHONE"}}, + {font,{screen,bold,12}},{row,1},{click,false}]}, + {gridline,[{text,{1,"Adam"}},{text,{2,"1234"}},{row,2}]}, + {gridline,[{text,{1,"Beata"}},{text,{2,"4321"}},{row,3}]}, + {gridline,[{text,{1,"Thomas"}},{text,{2,"1432"}},{row,4}]}, + {gridline,[{text,{1,"Bond"}},{text,{2,"007"}},{row,5}]}, + {gridline,[{text,{1,"King"}},{text,{2,"112"}},{row,6}]}, + {gridline,[{text,{1,"Eva"}},{text,{2,"4123"}},{row,7}]}]}}], + gs:create_tree(gs:start(),R), + loop(). + +loop() -> + receive + {gs,_Win,destroy,_Data,_Args} -> bye; + {gs,_Gridline,click,_Data,[Col,Row,Text|_]} -> + io:format("Click at col:~p row:~p text:~p~n",[Col,Row,Text]), + loop(); + Msg -> + io:format("Got ~p~n",[Msg]), + loop() + end. |