Wx/examples/demo/ex_canvas.erl - looking for details about the Config parameter

wx:demo() and selected 'canvas from the menu. It works fine.
I just want to be able to run ex_canvas.erl as standalone program.
I would like to figure out what the Config parameter exactly is.
ex_canvas:start(…)

start(Config) ->   wx_object:start_link(?MODULE, Config, []).
2 Likes

ditto.

it is called in the last line of load_example in demo.erl:

load_example(Ex, #state{demo={DemoPanel,DemoSz}, log=EvCtrl, code=Code}) ->
    ModStr = "ex_" ++ Ex,
    Mod = list_to_atom(ModStr),
    ModFile = ModStr ++ ".erl",
    load_code(Code, file:read_file(ModFile)),
    find(Code),
    Mod:start([{parent, DemoPanel}, {demo_sz, DemoSz}, {log, EvCtrl}]).

does this help?

1 Like

Yes fizfaz, after years of reading this code in vain your response to RFaithi does help me. The image in my mind is beginning to become a little more visible. Thank you.
Unfortunately, it remains unclear to me how the Config variable in ex_canvas.erl also mentioned on line 51 of demo.erl finds its definition on line 304 of the load_example function? I am guessing it relates to the #state record which holds the Config variables.
I pray someone with your knowledge of this application and access to the manual and demo.erl github code might add a suitable comment for the benefit of future newbies like me.

1 Like