wxDirPickerCtrl(3)
π wxDirPickerCtrl π
okay bestie, so this is the Erlang module definition for wxDirPickerCtrl β literally just a whole control that lets your user pick a directory. That's it. That's the vibe. ποΈβ¨
πΈ NAME πΈ
wxDirPickerCtrl β a control that lets the user select a directory, fr fr.
β¨ DESCRIPTION β¨
So here's the tea π«: the generic implementation is a button that brings up a wxDirDialog when you click it. The native implementation may differ, but bestie, it's usually a (small) widget that gives you access to the dir-chooser dialog. Iconic behavior honestly. π
It's only available if wxUSE_DIRPICKERCTRL is set to 1 (which is the default, so like, you're fine π
).
π Styles π
This class supports the following styles, no cap:
wxDIRP_DEFAULT_STYLEβ the default style, the main character β¨. It includeswxDIRP_DIR_MUST_EXISTand, under wxMSW only,wxDIRP_USE_TEXTCTRL.wxDIRP_USE_TEXTCTRLβ creates a text control to the left of the picker button which is completely managed by thewxDirPickerCtrland which can be used by the user to specify a path (seeSetPath). The text control is automatically synchronized with the button's value. Use functions defined inwxPickerBaseto modify the text control. The way it just... syncs itself π obsessed.wxDIRP_DIR_MUST_EXISTβ creates a picker that allows selecting only existing directories in the popupwxDirDialog. β οΈ Notice that, as withwxFLP_FILE_MUST_EXIST, it is still possible to enter a non-existent directory even when this file is specified if thewxDIRP_USE_TEXTCTRLstyle is also used. Also note that ifwxDIRP_USE_TEXTCTRLis not used, the native wxGTK implementation always uses this style as it doesn't support selecting non-existent directories. Very "we do it differently over here" energy.wxDIRP_CHANGE_DIRβ change current working directory on each user directory selection change. Just casually rearranging your whole filesystem vibe. πwxDIRP_SMALLβ use a smaller version of the control with a small"..."button instead of the normal"Browse"one. This flag is new sincewxWidgets 2.9.3π± (so it was born in 2.9.3, baby of the family).
See:
wxDirDialogwxFileDirPickerEvent
This class is derived, and can use functions, from β the whole family tree π³:
wxPickerBasewxControlwxWindowwxEvtHandler
wxWidgets docs: wxDirPickerCtrl
π Events π
Event types emitted from this class β the notifications it's sending you:
command_dirpicker_changedπ£
π DATA TYPES π
wxDirPickerCtrl() :: wx:wx_object().
Just a lil object, your everyday Erlang wx object bestie. π«Ά
π FUNCTIONS π
π« create
create(This, Parent, Id, [Option]) -> boolean()
when
This :: wxDirPickerCtrl(),
Parent :: wxWindow:wxWindow(),
Id :: integer(),
Option ::
{path, unicode:chardata()} |
{message, unicode:chardata()} |
{pos, {X :: integer(), Y :: integer()}} |
{size, {W :: integer(), H :: integer()}} |
{style, integer()} |
{validator, wx:wx_object()}.
Creates the widgets with the given parameters. Build-a-widget workshop π οΈβ¨
Return: true if the control was successfully created or false if creation failed. Slay or flop, no in-between π
π« destroy
destroy(This :: wxDirPickerCtrl()) -> ok.
Destroys the object π₯ okay bye bestie, it's giving closure.
π« getPath
getPath(This) -> unicode:charlist() when This :: wxDirPickerCtrl().
Returns the absolute path of the currently selected directory. It will literally tell you where you're standing. ππ
π« new (the no-args one) π±
new() -> wxDirPickerCtrl().
Fresh out the box, no arguments, brand new. β¨
π« new (the full-glow-up one) π
new(Parent, Id, [Option]) -> wxDirPickerCtrl()
when
Parent :: wxWindow:wxWindow(),
Id :: integer(),
Option ::
{path, unicode:chardata()} |
{message, unicode:chardata()} |
{pos, {X :: integer(), Y :: integer()}} |
{size, {W :: integer(), H :: integer()}} |
{style, integer()} |
{validator, wx:wx_object()}.
Initializes the object and calls create/4 with all the parameters. So it's basically the "do the whole routine in one go" version πβοΈπ¨
π« setPath
setPath(This, Dirname) -> ok
when
This :: wxDirPickerCtrl(),
Dirname :: unicode:chardata().
Sets the absolute path of the currently selected directory. You're the one choosing where it lives now. π―
β οΈ Important bestie, listen up: If the control useswxDIRP_DIR_MUST_EXISTand does not use thewxDIRP_USE_TEXTCTRLstyle, the dirname must be a name of an existing directory and will be simply ignored by the native wxGTK implementation if this is not the case. So like, don't come crying to me when wxGTK just β¨pretends you never said anythingβ¨ π
mwah, that's a wrap π This manual page came to you from Ericsson AB, covering wx 2.6, and yes it's the wxDirPickerCtrl(3) page β thank you for coming to my TED talk, go pick some directories, 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