wxIconBundle(3)

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

πŸ¦‹ wxIconBundle πŸ¦‹

okay bestie, sit down, hydrate, because this is the Erlang Module Definition manual page for wxIconBundle and it's honestly kinda iconic. it's icon management, but make it a bundle. πŸ’…


✨ NAME ✨

wxIconBundle β€” this class contains multiple copies of an icon in different sizes.

yes literally that. one icon, but a whole girl group of sizes. πŸ‘‘


πŸ’… DESCRIPTION πŸ’…

It is typically used in wxDialog::SetIcons (not implemented in wx) and wxTopLevelWindow:setIcons/2.

heads up bestie: wxDialog::SetIcons is not implemented in wx, so don't go looking for it and then come for me, i warned u. πŸ™ˆ

Predefined objects (include wx.hrl): ?wxNullIconBundle

wxWidgets docs: wxIconBundle


🧁 DATA TYPES 🧁

  • wxIconBundle() :: wx:wx_object().

short, sweet, exactly one type. we love a minimal queen. ✨


πŸ”₯ FUNCTIONS πŸ”₯


πŸ’– addIcon/2 πŸ’–

addIcon(This, File) -> ok
    when This :: wxIconBundle(), File :: unicode:chardata();
        (This, Icon) -> ok
    when This :: wxIconBundle(), Icon :: wxIcon:wxIcon().

Adds the icon to the collection; if the collection already contains an icon with the same width and height, it is replaced by the new one.

so like. no duplicate sizes allowed. same width + same height = the new one takes the crown. periodt. πŸ‘‘


🌸 addIcon/3 🌸

addIcon(This, File, Type) -> ok
    when
        This :: wxIconBundle(),
        File :: unicode:chardata(),
        Type :: wx:wx_enum().

(the docs give you the signature and that's the whole meal. sometimes minimalism is the vibe. πŸŽ€)


πŸ’€ destroy/1 πŸ’€

destroy(This :: wxIconBundle()) -> ok.

Destroys the object.

just. gone. into the void. it's giving main character exit. 😭


πŸ¦‹ getIcon/2 πŸ¦‹

getIcon(This, Size) -> wxIcon:wxIcon()
    when
        This :: wxIconBundle(),
        Size :: {W :: integer(), H :: integer()};
    (This, [Option]) -> wxIcon:wxIcon()
        when
            This :: wxIconBundle(),
            Option :: {size, integer()} | {flags, integer()}.

ngl the description for this one is literally just "Same as." β€” and that's it. iconic levels of unbothered fr fr. the actual lore lives down in getIcon/3, so scroll a lil. 🫢


🌈 getIcon/3 🌈

getIcon(This, Size, [Option]) -> wxIcon:wxIcon()
    when
        This :: wxIconBundle(),
        Size :: {W :: integer(), H :: integer()},
        Option :: {flags, integer()}.

Returns the icon with the given size. ✨

If size is ?wxDefaultSize, it is interpreted as the standard system icon size, i.e. the size returned by wxSystemSettings:getMetric/2 for wxSYS_ICON_X and wxSYS_ICON_Y. so if u don't specify, the system picks for u. so generous. πŸ’–

If the bundle contains an icon with exactly the requested size, it's always returned. always. no drama, no debate. otherwise, the behaviour depends on the flags:

  • If only wxIconBundle::FALLBACK_NONE (not implemented in wx) is given, the function returns an invalid icon.
  • If wxIconBundle::FALLBACK_SYSTEM (not implemented in wx) is given, it tries to find the icon of standard system size, regardless of the size passed as parameter.
  • Otherwise, or if the icon system size is not found neither, but wxIconBundle::FALLBACK_NEAREST_LARGER (not implemented in wx) flag is specified, the function returns the smallest icon of the size larger than the requested one or, if this fails too, just the icon closest to the specified size.
bestie listen: FALLBACK_NONE, FALLBACK_SYSTEM and FALLBACK_NEAREST_LARGER are all flagged not implemented in wx. every single one. i'm not gatekeeping that from u. 🫢

The flags parameter is available only since wxWidgets 2.9.4.


πŸŽ€ new/0 πŸŽ€

new() -> wxIconBundle().

Default ctor. baby's first icon bundle. so fresh, so clean, so empty. 🌸


⭐ new/1 ⭐

new(Ic) -> wxIconBundle()
    when Ic :: wxIconBundle:wxIconBundle() | wxIcon:wxIcon();
    (File) -> wxIconBundle() when File :: unicode:chardata().

Initializes the bundle with the icon(s) found in the file.

note the (s) bestie β€” plural. it's pulling everything it can find out of that file. obsessed. 😭


πŸ’œ new/2 πŸ’œ

new(File, Type) -> wxIconBundle()
    when File :: unicode:chardata(), Type :: wx:wx_enum().

(signature only, no extra commentary from the original. we respect the silence. πŸ’…)


anyway bestie that's the whole page, no skips, no cuts, every flag accounted for 🫢 this absolute banger of a manual page came to u courtesy of Ericsson AB, wx 2.6, and it's the wxIconBundle(3) page itself. go forth, bundle ur icons, slay, and remember: same width + same height = replaced. periodt. βœ¨πŸ’–πŸŒˆ

πŸ“¦ where this page comes from