Looking For Basic Info About Icons and Textures?

Very naive question here but the only dumb question is one you don’t ask, so here goes: I am trying to understand Blizzard’s icons and how to make and use them in an addon. In my reading I’ve come across the term ‘texture’ and would like more information about what is a texture. They are clearly and closely related to icons (see, e.g., GetItemIcon(ItemId) function which, among many other functions, returns a texture.

So, what is a texture? Is it an icon’s image that would the be programatically attached to a button frame? Or is it the actual icon itself? Finally, I assume these ‘textures’ (or icons?) are settable programatically. Asked another way, how do set a button’s texture?

I apologize if these questons don’t make sense.

Thanks,

“Icon” is a texture and a texture is a static graphical image that can be displayed in a texture widget (UI frame object type) but "icon is usually used to describe a sub element of a composites of widgets.

Example: You display a lines in a list box. Each line is made up of a texture, a fonstring (text widget) and a couple of buttons. Commonly the texture would be referred to as the line icon. It’s also used to describe an image parameter returned from various functions like GetSpellInfo(), the 3rd return is the spell icon or image that can be used in a texture widget to display it.

You can see a list of widget types here:
https://wow.gamepedia.com/Widget_API

Most elements in the UI a made by combining widgets together to create a whole ie. the base button widget has no display until you add texture(s) to it to make it look like a button (or something else) .

There are many default (pre-made) composite elements build into the API like the standard red boxy button created using button widget that inherits the UIPanelButtonTemplate.

Example:
https://wow.gamepedia.com/API_ScriptObject_SetScript