[erlang-questions] wx-erlang question

Dan Gudmundsson dangud@REDACTED
Wed Apr 13 19:22:44 CEST 2011


Hi

Obj id 0 is null, so I guess getCaret returns NULL,
you can check if something returns NULL with wx:is_null(Caret).

But from the docs it looks like it always should return a caret, so
it's a bit strange.
I will take a closer look tomorrow so it's a not a wxerlang bug, but
it might be a wxWidgets bug
or just bad documentation.

/Dan

On Wed, Apr 13, 2011 at 4:28 PM, Bob Cowdery <bob@REDACTED> wrote:
> 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
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions
>



More information about the erlang-questions mailing list