wxColourDialog(3)
β¨ wxColourDialog (like, the Erlang module definition, bestie) β¨
π NAME π
wxColourDialog β this class represents the colour chooser dialog. yes, THE colour chooser. the moment has arrived. π¨
π DESCRIPTION π
okay so picture this: starting from wxWidgets 3.1.3, and currently in the MSW port only, this dialog generates wxEVT_COLOUR_CHANGED events while it is being shown β i.e. from inside its wxDialog:showModal/1 method. and what do those events do? they notify the program about the change of the currently selected colour, and they let it, like, preview the effect of selecting this colour. live previews?? we love to see it. π
β οΈ but bestie, listen: if you react to this event, you should also correctly revert to the previously selected colour if the dialog is cancelled by the user. no leaving the user's screen in a haunted state, fr fr.
Example of using this class with dynamic feedback for the selected colour:
See:
- Overview cmndlg
wx_color()wxColourData?wxGetColourFromUser()
This class is derived, and can use functions, from:
wxDialogwxTopLevelWindowwxWindowwxEvtHandler
wxWidgets docs: wxColourDialog
π¦ DATA TYPES π¦
wxColourDialog() :: wx:wx_object().
like, that's the whole type. short. iconic. periodt.
π FUNCTIONS π
create(This, Parent, [Option]) -> boolean()
when
This :: wxColourDialog(),
Parent :: wxWindow:wxWindow(),
Option :: {data, wxColourData:wxColourData()}.
Same as new/2. literally the same thing, just vibing under a different name. β¨
destroy(This :: wxColourDialog()) -> ok.
Destroys the object. bye babe, we hardly knew ye. π
getColourData(This) -> wxColourData:wxColourData()
when This :: wxColourDialog().
Returns the colour data associated with the colour dialog. it's giving "hand over the colour data rn". π«Ά
new() -> wxColourDialog().
no args, no problem. π
new(Parent, [Option]) -> wxColourDialog()
when
Parent :: wxWindow:wxWindow(),
Option :: {data, wxColourData:wxColourData()}.
Constructor. okay so here's the tea:
Pass a parent window, and optionally a pointer to a block of colour data, which will be copied to the colour dialog's colour data.
Custom colours from colour data object will be used in the dialog's colour palette. Invalid entries in custom colours list will be ignored on some platforms (GTK) or replaced with white colour on platforms where custom colours palette has fixed size (MSW). so like, your cursed custom colour might just get ghosted or turned into white depending on where you're running. π
See: wxColourData
and that's the whole page, bestie!! π§ this little gem came to you from Ericsson AB, running on wx 2.6, and it lives at wxColourDialog(3). go forth and pick your colours. βππΈ
π¦ 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