wxProgressDialog(3)
π¦ wxProgressDialog(3) β¨
hey bestie, welcome to the Erlang Module Definition page for wxProgressDialog π it's an Erlang module definition, it's iconic, and we're gonna go through every single detail together, no skips, no shortcuts. grab a strawberry π and let's go.
πΈ NAME πΈ
wxProgressDialog β okay so if the platform supports it, this class provides the platform's native progress dialog. and if it doesn't? it just simply is the wxGenericProgressDialog (not implemented in wx). that's it, that's the whole vibe. π
β¨ DESCRIPTION β¨
This class is derived, and can use functions, from all of these cuties π
wxDialogwxTopLevelWindowwxWindowwxEvtHandler
wxWidgets docs: wxProgressDialog
π DATA TYPES π
one (1) type, and she's simple:
wxProgressDialog() :: wx:wx_object().
π FUNCTIONS π
π destroy(This :: wxProgressDialog()) -> ok.
Destroys the object. that's it. bye bye π
π«Ά new(Title, Message, [Option]) -> wxProgressDialog()
when
Title :: unicode:chardata(),
Message :: unicode:chardata(),
Option ::
{maximum, integer()} |
{parent, wxWindow:wxWindow()} |
{style, integer()}.
β―οΈ resume(This) -> ok when This :: wxProgressDialog().
Can be used to continue with the dialog, after the user had clicked the "Abort" button. like, the user said "no bestie" but you're giving them another chance. resume the moment β¨
π update(This, Value, [Option]) -> boolean()
when
This :: wxProgressDialog(),
Value :: integer(),
Option :: {newmsg, unicode:chardata()}.
Updates the dialog, setting the progress bar to the new value and updating the message if a new one is specified. π¦
Returns true unless the "Cancel" button has been pressed.
If false is returned, the application can either immediately destroy the dialog, or ask the user for the confirmation and β if the abort is not confirmed β the dialog may be resumed with the resume/1 function. (yes, we're bringing resume/1 back, she's relevant again π
)
If value is the maximum value for the dialog, the behaviour of the function depends on whether wxPD_AUTO_HIDE was used when the dialog was created. If it was, the dialog is hidden and the function returns immediately. If it was not, the dialog becomes a modal dialog and waits for the user to dismiss it β meaning that this function does not return until this happens. like, it's literally holding your hand until the user lets go, okay?? π
β οΈ resize tea time β οΈ
Notice that if newmsg is longer than the currently shown message, the dialog will be automatically made wider to account for it. However, if the new message is shorter than the previous one, the dialog doesn't shrink back β that's on purpose, to avoid constant resizes if the message is changed often. To do this and fit the dialog to its current contents you may call wxWindow:fit/1 explicitly.
However, the native MSW implementation of this class does make the dialog shorter if the new text has fewer lines of text than the old one, so it is recommended to keep the number of lines of text constant in order to avoid jarring dialog size changes. π«
You may also want to make the initial message, specified when creating the dialog, wide enough to avoid having to resize the dialog later β e.g. by appending a long string of unbreakable spaces to it:
wxString (not implemented in wx)(L'\u00a0', 100)
...and that's the whole update situation. go forth and set your progress bars, bestie π§
π lowkey the biggest serve here is that every single option, every when clause, every type and every warning stayed exactly where it was. ate and left no crumbs. β
and that's a wrap on wxProgressDialog(3), babes π this page came to you from Ericsson AB, running wx 2.6 β sending you all the slay, mwah π
π
π¦ 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