Popovers possible?

I am trying to create a popover window after clicking on a button, but this doesn’t seem to be very simple in Xojo. I found this article:
“https:// ifnotni l.com/t/a-cross-platform-popup-window-in-xojo-code/946

It works fine till the moment I have to use this code for the popup window position:

Public Function GlobalLeft(extends r as rectControl) as double
Dim retValue As Double = r.TrueWindow.Left + r.Left

Dim p As RectControl = r.Parent
While p <> Nil
retValue = retValue + p.Left
p = p.Parent
Wend

Return retValue
End Function

The last line (End Function) gives a Syntax error message. I searched for this and it seems to be a bug? I am using Xojo 2022 release 1.1.

I have this. Works perfectly.

When you create a Method, (also known as a Function), you do not type in the words Public Function and End Function in the code section. Those are part of the Method and not normally seen unless you copy the Method and paste it in a text document or the Forum here. The Function parameters are put in the parameters box on the right and the return type in the return field. There is no bug. You typed in something not needed.

You can also get an eye there:

This is very nice, something interesting though in the example provided.

The main popup says:

On Windows, the “Blah” button looks bad because it isn’t treated as transparent. But the “MsgBox” button looks good because it is inside a Rectangle control (the fillcolor is set in the window.activate event). This problem also happens with checkboxes and possibly other controls too.

You don’t need to enclose controls in a Rectangle on Mac, but it doesn’t hurt. You can just have one big rectangle behind all the controls.

Interestingly, the Move me button looks fine on Windows, but the Blah and the MsgBox buttons take a bit to draw themselves, any idea on why the differences? I mean I would get if the MsgBox and the Blah buttons were different, but they both behave the same way. This is with the latest version of Xojo if that matters.

This code dates back to 2013. Since then, Xojo Windows started using Direct2D underneath, which may explain some differences.

Fair, but I don’t understand why the two buttons behave differently from the middle button.

Perhaps you want to get in touch with @Bill_Gookin .