wxIcon(3)

πŸ“¦
version 29.0.6 Β· 3 versions
, in ubuntu stonking

🌸 wxIcon 🌸

okay bestie, welcome to wxIcon(3) β€” this is the Erlang Module Definition for the wxIcon module, and honestly? it's giving tiny-but-mighty. an icon is a small rectangular bitmap, usually used for denoting a minimized application. that's the whole vibe. let's get into it πŸ’–


✨ NAME ✨

wxIcon β€” an icon is a small rectangular bitmap usually used for denoting a minimized application. short king energy, but it does SO much.


πŸ’… DESCRIPTION πŸ’…

so here's the tea: a wxIcon differs from a wxBitmap in that it always has a mask associated with it, for transparent drawing. periodt. πŸŽ€

on some platforms, icons and bitmaps are implemented identically β€” because there's genuinely no real distinction between a wxBitmap with a mask and an icon, and some platforms just don't have a specific icon format at all (X-based applications usually standardize on XPMs for small bitmaps and icons, iykyk). but some platforms (looking at you, Windows) DO make the distinction, so a separate class is provided. slay.

Remark: it's 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 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
  • wxIconBundle
  • wxDC:drawIcon/3
  • wxCursor

This class is derived, and can use functions, from:

  • wxBitmap

wxWidgets docs: wxIcon


🌈 DATA TYPES 🌈

wxIcon() :: wx:wx_object().

that's it. that's the type. cute, right? πŸ¦‹


🫢 FUNCTIONS 🫢

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

copyFromBitmap(This, Bmp) -> ok
                            when
                                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 πŸ’–

Destroys the object πŸ’€. it's gone. say bye.


πŸ’– 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. no cap, it's empty until you fill it in.


πŸ’– new(Name) -> wxIcon() when Name :: unicode:chardata(); (Icon) -> wxIcon() when Icon :: wxIcon() πŸ’–

new(Name) -> wxIcon() when Name :: unicode:chardata();
         (Icon) -> wxIcon() when Icon :: wxIcon().

Copy ctor. πŸŽ€


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

new(Name, [Option]) -> wxIcon()
                when
                    Name :: unicode:chardata(),
                    Option ::
                        {type, wx:wx_enum()} |
                        {desiredWidth, integer()} |
                        {desiredHeight, integer()}.

Loads an icon from a file or resource. πŸ”₯

See: wxBitmap:loadFile/3


lowkey obsessed with how much power lives in such a small rectangle. go forth and icon-ify, bestie πŸ’œ

that's the whole page, fr fr. this one came to you from Ericsson AB, wx 2.6, docs date wxIcon(3) β€” mwah πŸ’‹

πŸ“¦ where this page comes from