[erlang-questions] wx-erlang question

Bob Cowdery bob@REDACTED
Wed Apr 13 21:04:03 CEST 2011


Dan

Thanks. I thought was was just an integer id. Will look out for that in
the future.
Just had a play in python. It does the same, returns None. I tried
creating a new caret, setting it on the text control and then hiding it.
No complaints but it didn't do anything so I guess caret handling is all
buggy.

Found one mention on wxPython-users which indicates that GetCaret will
only return a caret on 'some' platforms. I'm on Win 7. Looks like I need
to think of another work round.

Bob

On 13/04/2011 18:22, Dan Gudmundsson wrote:
> 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