Open eugenesvk opened 5 months ago
Hey, I wrote some extension methods for native-windows-gui
for my app, and that includes a function to set a bitmap to a menu item. Here you can find the implementation, you're free to use it in your project as long as you respect the MIT license ;)
You might need to modify it a little as I'm using the windows-sys
crate for the Windows calls and you might want to use winapi
instead, but it should take very little effort to adjust it.
Thanks! Will take a look (and MIT is one of the most respected licenses ;))
Do you know how to add an icon to the whole menu group, not just its items (for which your extension works fine, thanks!). I've tried a similar thing for the Menu
, but there are no bitmap fields/arguments for the MenuInfo equivalent to menuitems?
I have no idea myself, you'll have to dive deep into the Win32 API and see if what you want can be done. If there is a way, it can be done as an extension to native-windows-gui
objects.
Another look revealed that Menu is constructed the same way as MenuItem, so I can tweak you impl to apply an icon to it as well
So you could have menu items like this
Also, is it possible to just add text to that empty area? As emoji icon could serve the purpose of a real image