X Windows programming is not so simple, and I'm not quite sure how you expect to draw a line with parameters such as [50, 50], which is the best point, and the line needs 2 points, and wxDC: drawLine should know where to draw a line because you can have many frames.
You can create such a frame, yes (-1 is used instead of a macro, because I use the shell here):
Wx = wx:new().
Frame = wxFrame:new(wx:null(), -1, "Hello").
, , REdrawing. , , , .. REdraw , .
, , , ANY paint, , , , :
wxFrame:connect(Frame, paint, [{callback,
fun(_Evt, _Obj) ->
io:format("paint~n"),
DrawContext = wxPaintDC:new(Frame),
wxDC:drawLine(DrawContext, {50, 50}, {150,100}),
wxPaintDC:destroy(DrawContext)
end
}]).
io: , , , - , io: , , .
. , , , X Windows, , , , .
, , , :
wxFrame:show(Frame).
.