<div><div dir="auto">Joe, why not:</div><div dir="auto"><br></div><div dir="auto"><span style="color:rgb(49,49,49);word-spacing:1px;background-color:rgb(255,255,255)">start() -></span><br style="color:rgb(49,49,49);word-spacing:1px"><span style="color:rgb(49,49,49);word-spacing:1px;background-color:rgb(255,255,255)">    Panel = wx:new(</span><span style="color:rgb(49,49,49);word-spacing:1px;background-color:rgb(255,255,255)">"Hello"),</span><br style="color:rgb(49,49,49);word-spacing:1px"><span style="color:rgb(49,49,49);word-spacing:1px;background-color:rgb(255,255,255)">    Vbox = wxBoxSizer:new(?wxVERTICAL),</span><br style="color:rgb(49,49,49);word-spacing:1px"><span style="color:rgb(49,49,49);word-spacing:1px;background-color:rgb(255,255,255)">    wxWindow:setSizer(Panel, Vbox),</span><br style="color:rgb(49,49,49);word-spacing:1px"><span style="color:rgb(49,49,49);word-spacing:1px;background-color:rgb(255,255,255)">    Button = wxButton:new(Panel, 10, [{label,"Click"}]),</span><br style="color:rgb(49,49,49);word-spacing:1px"><span style="color:rgb(49,49,49);word-spacing:1px;background-color:rgb(255,255,255)">    wxSizer:add(Vbox, Button, [{flag, ?wxALL}]),</span><br style="color:rgb(49,49,49);word-spacing:1px"><span style="color:rgb(49,49,49);word-spacing:1px;background-color:rgb(255,255,255)">    wx:show(Panel).</span><br></div><div dir="auto"><span style="color:rgb(49,49,49);word-spacing:1px;background-color:rgb(255,255,255)"><br></span></div><div dir="auto"><span style="color:rgb(49,49,49);word-spacing:1px;background-color:rgb(255,255,255)"><br></span></div><div dir="auto"><span style="color:rgb(49,49,49);word-spacing:1px;background-color:rgb(255,255,255)">Where you hide the W and Frame inside the Panel.</span></div><div dir="auto"><span style="color:rgb(49,49,49);word-spacing:1px;background-color:rgb(255,255,255)">They're used only once/twice in your code!!! </span></div><div dir="auto"><span style="color:rgb(49,49,49);word-spacing:1px;background-color:rgb(255,255,255)"><br></span></div><div dir="auto"><span style="color:rgb(49,49,49);word-spacing:1px;background-color:rgb(255,255,255)">/Frank</span></div><div dir="auto"><span style="color:rgb(49,49,49);word-spacing:1px;background-color:rgb(255,255,255)"><br></span></div><br><div class="gmail_quote"><div>Le sam. 8 juil. 2017 à 11:01, Joe Armstrong <<a href="mailto:erlang@gmail.com">erlang@gmail.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">This is my attempt at a minimal program which creates a button<br>
<br>
start() -><br>
    W = wx:new(),<br>
    Frame = wxFrame:new(W, -1, "Hello"),<br>
    Panel = wxScrolledWindow:new(Frame),<br>
    Vbox = wxBoxSizer:new(?wxVERTICAL),<br>
    wxWindow:setSizer(Panel, Vbox),<br>
    Button = wxButton:new(Panel, 10, [{label,"Click"}]),<br>
    wxSizer:add(Vbox, Button, [{flag, ?wxALL}]),<br>
    wxFrame:show(Frame).<br>
<br>
It<br>
   1) gets a reference to the wxWindows Server<br>
   2) creates a Frame (which wxWindows calls a window)<br>
   3) adds a Panel to the frame<br>
       a Panel is a thing you can add controls to<br>
   4) creates a Vbox (a box to whose children are arranged  vertically)<br>
   5) tells the panel to use the Vbox as it's top level sizer<br>
   6) makes a button<br>
   7) adds the button to the Vbox<br>
   8) displays the frame<br>
<br>
Questions<br>
<br>
1) Is my understanding of the steps you have to do be make a<br>
    minimal window with a button correct?<br>
<br>
    Could the code be clearer (how?)<br>
<br>
    (actually shorter code might be possible but I want something that is<br>
     extensible - so I've used a vbox to which I assume I can add more later)<br>
<br>
 2)  What are the alternatives to wxScrolledWindow and to wxBoxSizer?<br>
<br>
Cheers<br>
<br>
/Joe<br>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div></div>