Re: textctrl.PositionToXy

Nathan smith <[email protected]> Thu, 17 Feb 2022 10:55:52 +0000
Newsgroups gmane.comp.python.wxpython
Message-ID <[email protected]>
Hi tim,


Thanks for that, I admit I rarely look at the c++ docs as I don't really=20
know the language that well other than knowing the rough syntax so it=20
didn't even cross my mind.


Re the weird line number, I suspect I figured out what it is.

I think it's employing its own wrapping, rather than counting "\n" where=20
as I was looking for counting "\n"'s.


Nathan

On 17/02/2022 06:32, Tim Roberts wrote:
> On 2/16/22 16:06, Nathan smith wrote:
>
>>
>> could someone give me a quick rundown of what textCtrl.PositionToXy=20
>> actually does?
>>
>> According to the documentation it returns a 0 based line position and=20
>> column number, which I would assume to mean,:
>> PositionToXy(t1.GetInsertionPoint())
>> would return (x, y) where y is the line number in the widget and x is=20
>> the character count from left to right.
>
> That's the theory, yes.
>
>
>> bug first off it returns (Bool, X, Y). What is that bool for?
>
> Success or failure.=C2=A0 You can look at the wxWidgets C++ reference for=
=20
> that.=C2=A0 It only fails if the incoming position is way too large.
>
>
>> And second off I have a texCtrl that is returning 318 when it only=20
>> has 169 lines in it.
>
> Interesting.=C2=A0 Does it return a reasonable X?=C2=A0 What was the=20
> GetInsertionPoint value?
>

--=20
You received this message because you are subscribed to the Google Groups "=
wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an e=
mail to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/=
wxpython-users/920e0dcc-c100-ff28-96dc-6a4ae3c0ab59%40gmail.com.