TextInputCanvas/DesktopTextInputCanvas Paint event not called with Xojo 2022

Hi @Björn_Eiríksson,

I think there is an issue with TextInputCanvas and DesktopTextInputCanvas on macOS (did not test it other platforms).

The Paint event is called with Xojo 2021R3.1, but never with Xojo 2022 releases.

It works fine here with 2022r2 (DesktopTextInputCanvas). How does your code look like?

A simple canvas control with TextInputCanvas so API V1 (not DesktopTextInputCanvas, my mistake, sorry) on a window and one line of code to set a breakpoint.

I also tried with FormatedTexControl (API V1) and the Paint event is not called on Xojo 2022 R2 releases.

Edit:
I checked with DesktopTextInputCanvas and the Paint event is called. So the bug only occurs with TextInputCanvas.

Are you sure your using the Einhugur version of the control ?

I am not sure how to test amd its curious if Martin is not getting any issue. (Dont reallyk now how to use that control)

I use the 1.5 version.

The Paint event is called with DesktopTextInputCanvas, but not with TextInputCanvas.

The test is easy. I drop a canvas and change its super TextInputCanvas (for API 1) or DesktopTextInputCanvas for Api 2). I put one line of code in the Paint event and set a breakpoint on it.

The Paint event is called with DesktopTextInputCanvas, but never with TextInputCanvas. It happens only with Xojo 2022 R11 and R2 on macOS (Windows not tested yet). The bug does not occur with 2021 R31.

As far as I know then it is not valid case to force Non desktop version of a control if the Window is DesktopWindow ?

You should be dragging the control from the Toolbar then you get whatever type fits the Window its supposed to live on.

Or am I misunderstanding something here ?

You are right. API2 is a real pain! I prepared a test project for you. The project was created with Xojo 2021 R11 to ensure it is an API1 project. Here is the link :

When run or built with 2021R11, 2021R31, the paint event is called as the screenshot below shows.

When run or built with 2022R11, 2022R2, the paint event is not called as the screenshot below shows.

I don’t know why you get a different result, but your project runs fine with Björn’s plugin and Xojo 2022r2 on my end.

Please check again if you really use the latest TIC version from Björn. You can download it here.

Thank you for testing.

Do you use the TextInputCanvas plugin for APIv1 or APIv2 ?

I use Björn’s plugin. Depending on the Xojo project type (API 1 or API 2) it automatically uses the correct control version (API 1.0 TextInputCanvas as subclass of RectControl or API 2.0 DesktopTextInputCanvas as subclass of DesktopUIControl).

All I did is download your sample project and open and run it in Xojo 2022r2.

OK, that’s what I understood but it still did not work. The Paint event was not called.

So, I decided to clear the Xojo cache, relaunch Xojo 2022 R11 and Xojo 2022 R2, tested the sample project and it works fine. I tested FTC and my larger project and everything is fine. I do not know why it did not before.

Björn and Martin, sorry for taking your time.

2 Likes

No problem at all, am happy it works now for you.