[erlang-questions] GUI development with Erlang

Alan Gingras alangingras@REDACTED
Fri Dec 29 18:34:49 CET 2017


I have now worked my way through all of your wxerlang-getting-started document.  Again, I think it is terrific.  I did have to add a "startGame" function to actually start the "chess clock" in both flavors (gen_server and wx_object).  And I modified the handle_info function for 'reset' to start tell player 1 to move.  The startGame/1 method was:

startGame( N ) ->
	?SERVER ! { reset, N }.

And the handle reset method is now:

handle_info({reset, N}, State) ->
	player1 ! {reset, N},
	player2 ! {reset, N},
	player1 ! move,
	{noreply, State};

And to get the clock going:

10> arbiter:start_link().
{ok, <0.207.0>}
11>arbiter:startGame( 10 ).
52> wo_arbiter:start_link ().
53> wo_arbiter: startGame( 10 ).

Thanks again for the tutorial.  I hope other find it as instructive as I did.

Sincerely yours,

More information about the erlang-questions mailing list