Cocoa Popupmenu real height

Hello,
as docs say:
Changing the Height property has no effect for apps run on macOS. As a native control, macOS always draws the PopupMenu at its system-standard height.

So, when I toggle the popupmenu’s font between System and SmallSystem (fontsize = 0), the popupmenu adjusts its height.

But since in both cases, although the popupmenu visually changes its heigh, popupmenu1.height always returns 20, I’d like to know if it is possible to get its real height. That is, its real height when font is System, and its real height when font is SmallSystem.
Suggestions welcome. Thanks.

There are now 4 different “size” options for standard controls such as the Popup Menu. If Xojo returns the same size for each size, then you’d need to look into declares or plugins to ask the OS what the size is. I personally have not tried this, it looks like you’d need to ask the NSCell of the Popup Menu what it’s cellSizeForBounds is.

Yes, as I said, Xojo returns the same size (20) for each size.
And since I do not use plugins, I guessed I’d have to resort to declares.
In fact I somehow made some tests using the old macOSlibrary (controlsize, bounds etc.) but I could not reach any solution, possibly because I was not able to handle things properly.

Anyway, from reports I got, it seems Bigsur has got its own way when dealing with the height of popupmenus. But since I’m still running Catalina, I cannot test and see what really happens.

Thanks for your suggestions.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.