wxIcon(3erl)

πŸ’– NAME πŸ’–

wxIcon β€” functions for the wxIcon class, bestie. This is the Erlang module definition page for wxIcon(3erl), and it's literally all about icon behavior. πŸ’…

✨ DESCRIPTION ✨

Okay so picture this: an icon is a small rectangular bitmap, usually used for denoting a minimized application. Cute, tiny, iconic. πŸŽ€

It differs from a wxBitmap in always having a mask associated with it for transparent drawing. The way that mask just has to be there? Obsessed. ✨

On some platforms, icons and bitmaps are implemented identically, since there is no real distinction between a wxBitmap with a mask and an icon; and there is no specific icon format on some platforms (X-based applications usually standardize on XPMs for small bitmaps and icons). However, some platforms (such as Windows) make the distinction, so a separate class is provided. No cap. πŸͺŸ

🌸 Remark 🌸

It is usually desirable to associate a pertinent icon with a frame. Icons can also be used for other purposes, for example with wxTreeCtrl and wxListCtrl. Icons have different formats on different platforms therefore separate icons will usually be created for the different environments. Platform-specific methods for creating a wxIcon structure are catered for, and this is an occasion where conditional compilation will probably be required. Note that a new icon must be created for every time the icon is to be used for a new window. In Windows, the icon will not be reloaded if it has already been used. An icon allocated to a frame will be deleted when the frame is deleted. For more information please see overview_bitmap. πŸ”₯

πŸŽ€ Predefined objects (include wx.hrl) πŸŽ€

  • ?wxNullIcon

πŸ¦‹ See πŸ¦‹

  • Overview bitmap
  • Overview bitmap (yes, it's listed twice β€” canon πŸ’€)
  • wxIconBundle
  • wxDC:drawIcon/3
  • wxCursor

πŸ‘‘ Inheritance / derived-from tea πŸ‘‘

This class is derived (and can use functions) from: wxBitmap

wxWidgets docs: wxIcon

🌈 DATA TYPES 🌈

wxIcon() = wx:wx_object()

πŸ’… EXPORTS πŸ’…

πŸ’– new() -> wxIcon()

Default ctor.

Constructs an icon object with no data; an assignment or another member function such as wxBitmap:loadFile/3 must be called subsequently.

πŸ’– new(Name) -> wxIcon()

πŸ’– new(Icon) -> wxIcon()

Types:

Icon = wxIcon()

Copy ctor.

πŸ’– new(Name, Options :: [Option]) -> wxIcon()

Types:

Name = unicode:chardata()
Option =
    {type, wx:wx_enum()} |
    {desiredWidth, integer()} |
    {desiredHeight, integer()}

Loads an icon from a file or resource.

See: wxBitmap:loadFile/3

πŸ’– copyFromBitmap(This, Bmp) -> ok

Types:

This = wxIcon()
Bmp = wxBitmap:wxBitmap()

Copies bmp bitmap to this icon.

Under MS Windows the bitmap must have mask colour set.

See: wxBitmap:loadFile/3

πŸ’– destroy(This :: wxIcon()) -> ok

Destructor.

See overview_refcount_destruct for more info.

If the application omits to delete the icon explicitly, the icon will be destroyed automatically by wxWidgets when the application exits.

Warning: Do not delete an icon that is selected into a memory device context.

mwah πŸ’– this page is brought to you by the wxWidgets team, version wx 2.2.2.1, and wxIcon(3erl) is outtie 🫢

πŸ“¦ where this page comes from