I experiencing troubles trying to set the path for widget icons, meaning I don’t know the rules to set the path for a resource.
I would like to assign an icon to a button, the structure of my app is:
/
assets/main-view.xml
resources/icons/*.png
src/main.hx & mainView.hx
It doesn’t load and show any image inside the button. I’m sure I’m doing something wrong but I wasn’t able to find any info about the path usage. Can anyone help me?
Ok, it seems that the icon is correctly present inside the build folder and seen by the program (I got the confirm using FileSystem.exist) but the icons are not presented inside the buttons. Is this a limitation from HxWidgets (while wxWidgets permit the usage of icons in buttons)?
resources but haxe ui must know about it.
to use resources … haxeui must know about it.
you must create a module.xml in the src folder in there aren’t any
and add
I have to be honest, documentation lacks a lot of information. I obtained the code in my first post using Copilot… Now I see that there are other things to know but I don’t know where they came from, to be honest.
yeah it’s true haxeui lacks a lot of documentation as in official documentation ( it’s basically a one man work)
it’s better to look at the code / at the forum / at discord
component builder is great too …
And even for the parts that are well documented … not sure llms know really much about them.
So continue to ask questions Haxeui is not complex there are few things to know and once you know them it will be easy to guess the rest.
I discovered another issue/bug/problem…
I’m just trying to give menu items some fancy icons but simply they don’t appear. I notice that the menus example in the components explorer shows the same bug: https://haxeui.org/explorer/#containers/menus
Look at the “Icons” menu: it doesn’t show any icon, but the code says the opposite:
Thanks for your reply. I don’t know where to store the icons to use on the menu. If I try to integrate your piece of code in my app, I get the usual result of all times I run my app, i.e. icons not showing in the menu items.
PS: as you can see, icons in the buttons are truncated: I’m not able to use them in their correct dimensions, even though I resize them to be smaller than the buttons.
the fact that haxeui-core/styles/shared/info-small.png doesnt work indicates something else is going on, since these are 100% embedded into the resulting application, i seem to remember making a comment somewhere in the source about a difference in linux. Ill see if i can find it, do any of your other native applications have menu icons?
/*
Note: Images in buttons for ubuntu dont work until you run:
gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "{'Gtk/ButtonImages': <1>, 'Gtk/MenuImages': <1>}"
*/
Thank you for your reply, but I’m using Manjaro Linux (based on Arch) and KDE as my desktop environment, and the command you suggested to me doesn’t work because my Linux box isn’t based on Gnome.
I have the Breeze theme installed, I have the icons in the menus enabled, I am using GTK for wxWidgets, I have set the KDE apps that use GTK to use the correct theme, and in the other GTK apps I can see the icons (below is a screenshot of the test app that opens the KDE panel). I don’t know what to say. However, I must mention one thing: I tried using Heaps as a backend and I must say that I can see the icons in the menus opened with Heaps, so it is definitely a problem that occurs with hxwidgets.
Its a weird one, for sure. I have you tried to build wxWidgets from latest dev source from github? Maybe that will help? Im not sure what else to suggest to be honest. Its clear your system can use menu icons, and haxeui-hxwidgets will attempt to use menu icons, which leads me to think its something in wxWidgets itself… … …