Events from Declares

I’m using declares from GOLANG, is there anyway to send events so that I don’t have to keep polling the functions to see if they have any data for me?

Hello Nicholas,

In the Xojo and C++ work that I have performed, almost all work on Windows involves polling. The odd exception is interrupts when working with electronics where an outside change is recorded to initiate an event.

In C++ this is performed with concurrency and multiple threads. Xojo doesn’t support concurrency.

An option you could try is to use a separate thread to continuously poll function while the main thread continues to run the program.

I ran into a similar issue where graphical drawing with Xojo on Windows is slow, and graphics with many other languages is considerably faster and tends to show that there are issues with performance with Xojo on Windows. I created plugins and wrote a book with OpenGL2.1 (I Wish I Knew How To... Program OpenGL Legacy 2.1 64-bit for Windows (XDL-0024)) to significantly increase graphics performance, where refresh rates significantly improved (about 10-times the speed) with an added benefit of lower CPU use. This involved creating my own Window (Form) that is separate from Xojo and using input calls from the new form and not using keyboard or mouse tracking through Xojo - which worked out excellent. Xojo GUI interaction was minimized and calls to the Windows API were maximized.

In conclusion, polling is usually the proper way to work with functions for data on Windows.

Edit: Polling on Xojo is slow, and significant performance improvements occur with declares and polling events when minimizing Xojo interaction and promoting API interaction.

Windows drawing was a LOT faster before the change to Direct2D and along with that came the loss of true transparency… That was back in 2016…

I hope Xojo can eventually improve the current Windows drawing situation.

More focus on performance overall would be welcome.

-Karen