[erlang-questions] wx-erlang question

Bob Cowdery bob@REDACTED
Wed Apr 13 16:28:41 CEST 2011


Hi

I'm having a fair bit of trouble with the syntax of wx-erlang.

Having failed to get mouse wheel events from a wxStaticText (still my
first choice but I think it's a wx limitation and I'm not sure how to
work round it with Erlang) I thought I would try to make a wxTextCtrl
behave like a wxStaticText. One of the first things I wanted to do is
turn off the caret.

T = wxTextCtrl:new(Panel, 1, [{value, "0"}]),
C = wxTextCtrl:getCaret(T),
wxCaret:hide(C),

gives me:
** exception exit: {{badarg,0},{wxCaret,hide,0}}

but if I create a new caret I can call hide() on it.

io:format("~p, ~p", [C, wxCaret:new(T, {1,1})]),
{wx_ref,0,wxCaret,[]}, {wx_ref,51,wxCaret,[]}

Is it to do with fact that wx-erlang did not create it so has no object
reference as it seems to object to the id = 0.

Bob



More information about the erlang-questions mailing list