Window opening in Windows

I have an App with no issues when running in the Mac. For the compiled version in Windows 7 or 8 I am seeing an issue when drawing the window.

In one case for this Window I do not have an open event and the window draws slow, but it draws correctly.

In the other case for the same window, I have an open event with a simple DB select query (SQLite). No pictures. This makes the window not to draw completely. When I pass the mouse over, the area with the issue gets correctly draw.

I tried to add a refresh, but did not work.

Any suggestions ?

Any suggestions here ?

I don’t think there is enough information here for anyone to offer specific suggestions. Code in the Open event might delay the opening of the window, but it should not affect its drawing. Sounds like something else is the culprit.

As an alternative might be do have a Timer that fires shortly after the window opens and do the SQL stuff there.

Thank you Paul. I am still learning as you may already noticed … You are always supportive.

If I call from the Open event a Method to do the Db query, is it the correct procedure/ best practice ?

I was thinking that I may be doing something wrong.

I tried calling the method from the open event and did not work either. I am calling the method from the wrong place ?

I was thinking about the timer. A thread would also be useful ?

There’s nothing wrong with calling a method from the Open event. Your issue sounds like something else. Put a break point in and see if everything finishes correctly

Jym/ Paul,

as I compile in the Mac, it was easier for me to add the timer as to add the breakpoint. I do not have an issue when I run the Mac version. The issue comes with Windows.

After adding a 500 ms timer in the Open event before querying the DB, it improved, but not solved. Part of the window is still not complete, until I hit a tab between the text fields.

I can now read the text field (originally I could not, the window was partially overlapping between the background and the text field). Something happening when the first text field got focus.

I could not see any major issue in the code, as the Mac version is running smooth.

Looks like some kind of performance issue in the Windows compiled version, when drawing the screen.

1 Like

Trying putting the following as the very first couple of lines of the open event:

me.show
app.doevents()

I’ll probably get barked at for telling you to do that… but it’s worked for me on similar situations.

Does it change if you do not open your window with .show but .visible=true? It thereby changes the order of events.

As soon as I comeback from a business trip I will try it. The window is being open with a New Window.

Solved. The Label was going over the TextField in the layout …