Struggling with Retina Mac OS X Menu Icons

I am trying to Retina-enable one of my applications. Everything is going swimmingly and the application looks absolutely gorgeous on my new Retina MacBookPro! However, I have run across one stumbling block that I just have not been able to eliminate.

This application makes use of icons in menus. I have developed 2x versions of each of the menu icons. However, when using them, they look horrible. It appears they are being drawn at a lower resolution and then pixel-doubled by the OS.

Does MenuItem.Icon support Retina icons? If so, is there a trick I am missing to make this work?

Any help would be appreciated.

In order to add Retina icons to menu items, you currently need to use NSImage.

If you have the MBS plugin there are functions in there.
If you use the MacOSLib, there are functions in there.

Otherwise you can use my Retina Kit to do it.

Ah. I suppose that makes sense.

The menus I’m having problems with are dynamically-created pop-up menus (not the Popup Menu control, but menus generated by a custom control) and shown using MenuIItem.Popup. Can your Retina Kit handle that? (I ask because you have a note that says Contextual Menus are not currently supported.)

Thanks!

I do have code for that, I’ll add it into the Retina Kit in the next few days. It does require Xojo 2013r3 or later.

I am trying to achive the same. A retina ready Icon in the system Menu.
The following code, makes my icon blurry:

[code] Dim p As New Picture(18,18)
p.Graphics.DrawPicture(logo_36,0,0,18,18,0,0,36,36)

Dim nsi As New NSImageMBS§
[/code]

As you can see, i am using a 36px image and scale it down to 18px and i am using a NSImage Object. But it won’t work. :frowning:

Sascha, other way around:

Dim nsi As New NSImageMBS(logo_36) nsi.setsize 18, 18

Than you have a high res picture.

Thank you Christian. It works perfect! Excellent! :slight_smile:

Christian, once you have the NSImage, what do you do with it? In my case, I need to use it in a MenuItem to be assigned to a ToolButton.

Well, normally we’d use it with a NSMenuItemMBS and the image property.
Not sure if the menu items behind the Toolbutton are accessible.
If you build menu with NSMenuItemMBS, you could popup it yourself.