RowTextAt on disappeared for PopupMenu?

I would like to use RowTextAt for a PopupMenu described here: DesktopPopupMenu — Xojo documentation

The problem: I get an error typing it manually and then compiling it. When I only enter the name of PopupMenu, then a dot I got a selection menu but “RowTextAt” is not selectable.

Xojo Mac Version 2023, Release 1

Any ideas?

Is it a PopupMenu or a DesktopPopupMenu? They are different controls.

Is the window itself of type Window or DesktopWindow?

Hello and thank you for your answers. Do you mean where the PopupMenu on? No, it’s called “Window” (Super) and the PopupMenu is of type PopupMenu as well (no Desktop…). I’ve just checked the Library. I can’t select a “DesktopPopupMenu” or a “DesktopWindow”.

Yes you can. They just don’t bother to call them that in the Library.

That’s the issue…

You’re attempting to use a method of the DesktopPopupMenu class on a PopupMenu object. They’re different classes. PopupMenu is the popup menu control for API1 projects (which yours is) while DesktopPopupMenu is the popup menu control for API2 projects (newer ones). Each have different methods (more specifically, they have the same capabilities, but the methods, properties and events were renamed).

I think it’ll work if you use MyPopupMenu.Text instead (the API1 documentation is hard to find (I couldn’t), but an API1 project shows “.text” as valid).

“SelectedRow” returns the text for me under 2021r2.1, but I’m not sure if that’s API1 or API2.

1 Like

In the most recent IDE, in an API1 project, autocomplete shows “SelectedRowValue” and “Text” as deprecated, both with “SelectedRow” as a replacement.
Logically, “SelectedRow” is the API2 and “Text” was API1. “SelectedRowValue” is odd, because it’s not the most recent version, yet it doesn’t sound API1-like. Perhaps it was in API1.5 :grin:.

What a mess…

1 Like

It’s most likely SelectedRowText.

By the way, IMO we should be pushing people away from API1, not towards it.

Many, many thanks everyone! I can follow everything and all suggested options work! I only can set one at right solution but there are many!
Thank you and merry Xmas!

2 Likes