wxBitmapButton(3)
π wxBitmapButton π
okay bestie, welcome to the Erlang Module Definition page for wxBitmapButton β yes that's the manual name, it lives in the wx 2.6 docs and it's literally just the glow-up guide for one very cute little button. sit down, hydrate, let's go π«Ά
β¨ NAME β¨
wxBitmapButton β a bitmap button is a control that contains a bitmap. that's it, that's the whole vibe π
πΈ DESCRIPTION πΈ
okay so real talk: since wxWidgets 2.9.1, bitmap display is supported by the base wxButton class itself. so the only tiny advantage of using this class is that it lets you specify the bitmap right in its constructor, unlike wxButton (which is giving "you have to do it the long way" energy π). if you want the full tea on image support in wxButton, go read the base class documentation, bestie, it's all there.
π¨ Styles
this class supports the following styles, and yes every single one is iconic:
wxBU_LEFTβ left-justifies the bitmap label. yes babe, left. πwxBU_TOPβ aligns the bitmap label to the top of the button. up up and away β¬οΈwxBU_RIGHTβ right-justifies the bitmap label. right where it belongs πwxBU_BOTTOMβ aligns the bitmap label to the bottom of the button. β¬οΈ note that thewxBU_EXACTFITstyle supported bywxButtonis not used by this class, because bitmap buttons don't have any minimal standard size by default. no cap, that's just how it is.
See: wxButton
this class is derived, and can use functions, from:
wxButtonwxControlwxWindowwxEvtHandler
that's a whole ancestry tree of slay π
wxWidgets docs: wxBitmapButton
π Events
event types emitted from this class:
command_button_clickedβ the moment the button gets clicked, main character energy fr fr β
π¦ DATA TYPES π¦
wxBitmapButton() :: wx:wx_object().
one type, one icon, one legend β¨
π FUNCTIONS π
π create
create(This, Parent, Id, Bitmap, [Option]) -> boolean()
when
This :: wxBitmapButton(),
Parent :: wxWindow:wxWindow(),
Id :: integer(),
Bitmap :: wxBitmap:wxBitmap(),
Option ::
{pos, {X :: integer(), Y :: integer()}} |
{size, {W :: integer(), H :: integer()}} |
{style, integer()} |
{validator, wx:wx_object()}.
button creation function for two-step creation. it's giving "part two of a two-part series" π¬
for more details, see new/4.
π destroy
destroy(This :: wxBitmapButton()) -> ok.
destroys the object. bye bestie, it was real ππ
π new()
new() -> wxBitmapButton().
default ctor. the blank canvas moment, the "before" picture, the empty page π
π new(Parent, Id, Bitmap, [Option])
new(Parent, Id, Bitmap, [Option]) -> wxBitmapButton()
when
Parent :: wxWindow:wxWindow(),
Id :: integer(),
Bitmap :: wxBitmap:wxBitmap(),
Option ::
{pos, {X :: integer(), Y :: integer()}} |
{size, {W :: integer(), H :: integer()}} |
{style, integer()} |
{validator, wx:wx_object()}.
constructor, creating and showing a button. the glow-up itself, the debut, the β¨momentβ¨
Remark: thebitmapparameter is normally the only bitmap you need to provide, and wxWidgets will draw the button correctly in its different states. so like, chill, it's handled. π§ but if you want more control, call any of the functionsSetBitmapPressed()(not implemented in wx, so don't come for it π),wxButton:setBitmapFocus/2,wxButton:setBitmapDisabled/2.
See: create/5
π newCloseButton(Parent, Winid)
newCloseButton(Parent, Winid) -> wxBitmapButton()
when
Parent :: wxWindow:wxWindow(),
Winid :: integer().
helper function creating a standard-looking "Close" button. lowkey the MVP of this whole page π
to get the best results, platform-specific code may need to be used to create a small, title bar-like "Close" button. this function is provided to avoid the need to test for the current platform, and it creates the button with as native a look as possible. so it does the platform-sniffing for you, bestie, that's the whole point π«Ά
Return: the new button.
Since: 2.9.5
and that's the whole page, no skips, no summaries, every flag and function accounted for πβ
signing off: this has been brought to you by Ericsson AB, rocking the wx 2.6 era, and yes the header said wxBitmapButton(3) and the footer said the same thing twice because that's just how manpages dress up. stay iconic, go build a cute little button, command_button_clicked your way to greatness ππ
no cap.
π¦ where this page comes from
- ubuntu stonking: erlang-doc 1:29.0.6+dfsg-1 Β· Apache-2.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms