Positioning Modal Window

Mojave 10.14.6
Xojo 2019.r2
In an existing project, I have code to position a modal window in the upper right corner of the screen. This worked appropriately in Xojo 2019.r1.1 but in Xojo 2019.r2, the modal window is displayed in the center of the screen from left to right and about 1/3 of the distance from the top. It is a reasonably aesthetic choice but it is not what I want.

In the test snippet of code below, I can assign values to the modal window (winHelp in this example). Following the code executing in the debugger, these properties get correctly assigned, but when the window is displayed after the winHelp.ShowModal command, the values for Left and Top have been changed so as to place the window in the central part of the screen.

winHelp.Top = 80 winHelp.Left = 100 winHelp.Title = theTitle winHelp.HV_Help.LoadPage(winHelp.contentHTML, Nil) // Implicit Instantiation is on for this window so do not need to declare a new window winHelp.ShowModal // Now it gets displayed

My impression is that ShowModal has been changed so as to force the location that Xojo has decided is best. My attempt assigning specific values to the winHelp.Left and winHelp.Top properties is ignored (overridden really. The values are reassigned.)

But I do not see this behavior explained explicitly in the documentation. I am asking for other’s experience in this regard and other people’s understanding of this situation.

  1. set BOUNDS not top and left as I explained here
  2. if this has changed from 2019r1.1 then file a bug report

Var myBounds As New REALbasic.Rect myBounds.Left = 100 myBounds.Top = 100 myBounds.Height = winHelp.Height myBounds.Width = winHelp.Width winHelp.Bounds = myBounds

As per my understanding of the Palardy suggestion I run the code above. At this point in the debugger I see, winHelp.Top set to 122 and windHelp.Left set to 100. The Bounds rect has a Left of 100.0 and a Top of 100.0

winHelp.Title = theTitle winHelp.HV_Help.LoadPage(winHelp.contentHTML, Nil) // Implicit Instantiation is on for this window so do not need to declare a new window winHelp.ShowModal // Now it gets displayed

At this point in the debugger the Bounds rect has a Left of 1110.0 and a Top of 263. So, as I interpret it, the ShowModal command has taken control of the Left and Top properties and ALSO the Bounds rect who has had its properties changed as well to “correspond”. The window is displayed in the center of the screen.

file a bug report and go back to 2019r1.1
just tried it in 2019r1 and 2019r2
its not doing what it should
like the placement property is completely overriding the setting of the bounds explicitly

the alternative is to put the setting of the bounds in the modal windows open event

but this is a “silent behaviour change” that should have a bug report

<https://xojo.com/issue/57799>