wxDirDialog(3)
π wxDirDialog π
okay bestie, so this one lives in the Erlang Module Definition world under wx 2.6, and it's the whole vibe of a directory chooser dialog β¨
πΈ NAME πΈ
wxDirDialog β this class is literally the directory chooser dialog, that's it, that's the whole personality π
β¨ DESCRIPTION β¨
π Styles π
the tea is that this class supports these styles, and you need to know all of them:
wxDD_DEFAULT_STYLEβ equivalent to a combo ofwxDEFAULT_DIALOG_STYLEandwxRESIZE_BORDER, so it's giving both at once π«ΆwxDD_DIR_MUST_EXISTβ the dialog will only let the user pick a folder that already exists. when this style is not given, a"Create new directory"button gets added to the dialog (on Windows) or some other way is provided for the user to type in the name of a new folder πwxDD_CHANGE_DIRβ changes the current working directory to whatever directory the user chose. no cap.
β οΈ note: this flag cannot be used with the wxDD_MULTIPLE style. periodt.
wxDD_MULTIPLEβ lets the user select multiple directories. this flag is only available since wxWidgets 3.1.4 πwxDD_SHOW_HIDDENβ shows hidden and system folders. this flag is only available since wxWidgets 3.1.4 π
notice that wxRESIZE_BORDER has a special side effect under Windows, where two different directory selection dialogs are available, and this style also implicitly selects the new version, since the old one always has fixed size. as the new version is almost always preferable, it is recommended that wxRESIZE_BORDER style be always used. this is the case if the dialog is created with the default style value, but if you need to use any additional styles you should still specify wxDD_DEFAULT_STYLE unless you explicitly need to use the old dialog version under Windows. E.g. do instead of just using wxDD_DIR_MUST_EXIST style alone. π
Remark: MacOS 10.11+ does not display a title bar on the dialog. use setMessage/2 to change the string displayed to the user at the top of the dialog after creation. the wxTopLevelWindow:setTitle/2 method is provided for compatibility with pre-10.11 MacOS versions that do still support displaying the title bar π
See:
- Overview
cmndlg wxFileDialog
this class is derived, and can use functions, from:
wxDialogwxTopLevelWindowwxWindowwxEvtHandler
wxWidgets docs: wxDirDialog π
π¦ DATA TYPES π¦
wxDirDialog() :: wx:wx_object().
π₯ FUNCTIONS π₯
destroy(This :: wxDirDialog()) -> okβ destroys the object. bye bestie πβ¨getMessage(This) -> unicode:charlist()whenThis :: wxDirDialog()β returns the message that will be displayed on the dialog π¬getPath(This) -> unicode:charlist()whenThis :: wxDirDialog()β returns the default or user-selected path π
β οΈ Note: this function can't be used with dialogs which have thewxDD_MULTIPLEstyle, useGetPaths()(not implemented in wx) instead. iykyk.
new(Parent, [Option]) -> wxDirDialog()
when
Parent :: wxWindow:wxWindow(),
Option ::
{title, unicode:chardata()} |
{defaultPath, unicode:chardata()} |
{style, integer()} |
{pos, {X :: integer(), Y :: integer()}} |
{sz, {W :: integer(), H :: integer()}}.
constructor β¨ use wxDialog:showModal/1 to actually show the dialog, that's the main character moment π
setMessage(This, Message) -> ok
when
This :: wxDirDialog(),
Message :: unicode:chardata().
sets the message that will be displayed on the dialog π¬
setPath(This, Path) -> ok
when This :: wxDirDialog(), Path :: unicode:chardata().
sets the default path π€οΈ
and that's the whole page, bestie π«Ά this lil icon was brought to you by Ericsson AB, running wx 2.6, and the page itself is wxDirDialog(3) β slay, ate, no crumbs left, periodt π
ππ
π¦ 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