[erlang-questions] wxErlang question 1

Joe Armstrong erlang@REDACTED
Sat Jul 1 16:37:12 CEST 2017


I have some wxErlang questions:

I have created a wxFrame and I want to get some messages sent to me
when things happen.

Looking in the examples in the erlang distribution I can find lines of
code like (for example)

    wxFrame:connect(Frame, close_window),

and

    wxFrame:connect(Frame, command_menu_selected, [{callback, Add}, {id, 747}]),


Once these calls have been make the process creating the frame is
sent close_window and command_menu_selected messages.

My questions are "how can I find all the possible values of the 2'nd argument to
wxFrame:connect - and "what is the 3'rd argument" and what is the meaning of the
data in the messages.

I did find a method for answering the first question (which might be correct)

1) go to http://docs.wxwidgets.org/trunk/classwx_frame.html
   and look up section called "Event emitted by this class"
   this has events called

   EV_CLOSE(func)
   EV_ICONIZE(func)

and so on the erlang name of these events appears to be 'close' and 'iconize'

2) If the event you want is not in this list go to the top of the page
   Here we see that wxFrame inherits the properties of wxTopLevelWindow.
   Click on this leads to
   http://docs.wxwidgets.org/trunk/classwx_top_level_window.html
   and we can check which events it omits

Is this how to find the names of the events or is there a better way?

What about my questions 2 and 3?

Do I have to swallow a book on wxWidgets to learn how to program
wxErlang? - programming by reading the source and guessing what it
means is not my favorite occupation.

Cheers

/Joe



More information about the erlang-questions mailing list