ID:167061
 
How do you show a icon in browse(), and has its own icon_state.

EX.

If there are two apples, one is green and the other is red.
If they both come from the same icon file. How would you make them both show in browse().

I already know how to show a regular .dmi file, but I don't know how to specify the icon state.
You can use browse_rsc() (as you probably are doing it now) and send an icon object with the correct icon and icon_state through it instead of just a whole icon.

src << browse_rsc(icon('apples.dmi', "red apple"), "red_apple.png")
src << browse_rsc(icon('apples.dmi', "green apple"), "green_apple.png")

src << browse({"
Red apple: <img src="red_apple.png"><br>
Green apple: <img src="green_apple.png"></br>
"}
)


In response to Unknown Person
Thanks it works perfect.