Path for widgets icons

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

Inside main-view.xml I declared a button:

<button id="btnHashResultCopy" width="32" icon="resources/icons/edit-copy.png" style="padding:5px;" />

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)?

I think icons work in hxwidgets …
to set your resources you have to modify module.xml to add them there maybe do you have a module.xml ?

I added the following lines in my hxwidgets.hxml:

--cmd mkdir -p build/hxwidgets/resources/icons
--cmd cp -r resources/* build/hxwidgets/resources/

Folders are created and filled up with icons but I’m not able to get the GUI load them inside the widgets.

yeah that’s not how you do it

there are two types of path

  • 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
<module>
    <resources>
        <resource path="resources" prefix="resources" />
    </resources>
</module>
  • external link with file:// I think
<button id="btnHashResultCopy" width="32" icon="file://resources/icons/edit-copy.png" style="padding:5px;" />

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 :slight_smile: Haxeui is not complex there are few things to know and once you know them it will be easy to guess the rest.

But yeah modules.xml is important to know it’s where you define the settings haxeui haxeui-core/haxe/ui/module.xml at master · haxeui/haxeui-core · GitHub you can define new locales themes etc …

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:

<menuitem text="Item 1" icon="icons/16/scroll_pane_text.png" shortcutText="Ctrl+A" />

I thought it was a bug in HTML5 but I get the same issue when compiling on my Linux box. It seems that the entry “icon” is ignored…

Actually it seems the reason Builder - HaxeUI is the paths don’t really exist.
Now I don’t this will work on hxwidgets… hxwidgets is far more limited.

This is what i meant when i said that the documentation is lacking…
Apart from that, thank you for all the help you are giving me.