Permalink
Browse files

fixed examples. v0.30

git-svn-id: https://gtknode.googlecode.com/svn/trunk@28 9999ab98-4a1b-0410-ba6a-d90168ca9a37
  • Loading branch information...
1 parent a9c14c5 commit 18b396ec4cae20195f45403e4d7e2994224d1e2c @massemanet committed Dec 6, 2006
View
@@ -1,4 +1,4 @@
-AC_INIT(GTK+ 2 wrapper library for Erlang, 0.20,
+AC_INIT(GTK+ 2 wrapper library for Erlang, 0.30,
mats.cronqvist@ericsson.com, gtknode)
dnl Require autoconf version >=2.59c. first one with erlang macros
AC_PREREQ(2.59c)
@@ -6,6 +6,9 @@ erl -sname foo -pa $GTKNODE/ebin $P
examples;
+hello - an extra simple hello
+ start with hello:start().
+
hello_world - hello world
start with hello_world:start().
@@ -7,11 +7,11 @@
%%%-------------------------------------------------------------------
-module(hello).
--export([go/0]).
+-export([start/0]).
-define(G(C,A),gtknode:cmd(hello,C,A)).
-go() ->
+start() ->
gtknode:start(hello),
Win = ?G('Gtk_window_new',['GTK_WINDOW_TOPLEVEL']),
But = ?G('Gtk_button_new_with_label',["butt"]),
@@ -45,12 +45,4 @@ new_text() ->
quit() -> gtknode:stop(?MODULE).
g(C,As) -> g([{C,As}]).
-g(CAs) ->
- case gtknode:cmd(?MODULE,CAs) of
- [{ok,Rep}] -> Rep;
- Reps ->
- case [R || {error,R} <- Reps] of
- [] -> ok;
- Es -> throw({errors,Es})
- end
- end.
+g(CAs) -> gtknode:cmd(?MODULE,CAs).
@@ -144,12 +144,4 @@ col_f(Val,{N,Store,O}) ->
{'Gtk_list_store_set_value',[Store,iter,N,val]}|O]}.
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
g(C,As) -> g([{C,As}]).
-g(CAs) ->
- case gtknode:cmd(?MODULE,CAs) of
- [{ok,Rep}] -> Rep;
- Reps ->
- case [R || {error,R} <- Reps] of
- [] -> ok;
- Es -> throw({errors,Es})
- end
- end.
+g(CAs) -> gtknode:cmd(?MODULE,CAs).
View
@@ -95,8 +95,7 @@ cmd(_GUI,[]) ->
cmd(GUI,CAs) ->
GUI ! {self(),CAs},
receive
- {GUI,{reply,Reps}} -> ?LOG([{l_ca,length(CAs)},{l_rep,length(Reps)}]),
- filter_reps(Reps,CAs)
+ {GUI,{reply,Reps}} -> filter_reps(Reps,CAs)
end.
filter_reps([{ok,Rep}],[_]) -> Rep;

0 comments on commit 18b396e

Please sign in to comment.