fltk.dialog
FLTK Dialog Functions
This module provides simple dialog functions for common user interactions:
- Message and alert dialogs
- Question dialogs with Yes/No or custom buttons
- Text input dialogs
- Password input dialogs
License
BSD-3-ClauseCopyright
Copyright © 2025 DDN (D Developer Network) Members
struct Color
class NativeFileChooser
Types 5
enumBeepType
Beep types for the beep() function.
defaultBeep = 0Default system beep
message = 1Message notification beep
error = 2Error notification beep
question = 3Question notification beep
password = 4Password notification beep
notification = 5General notification beep
enumFileChooserType
File chooser types for NativeFileChooser.
browseFile = 0Browse for a single file
browseDirectory = 1Browse for a directory
browseMultiFile = 2Browse for multiple files
browseMultiDirectory = 3Browse for multiple directories
browseSaveFile = 4Browse for save file location
browseSaveDirectory = 5Browse for save directory location
classNativeFileChooser
Native file chooser dialog.
Provides platform-native file selection dialogs for opening and saving files. Uses the operating system's native file chooser for a consistent user experience.
Example:
auto chooser = new NativeFileChooser(FileChooserType.browseFile);
chooser.title = "Open File";
chooser.filter = "Text Files\t*.txt\nAll Files\t*";
if (chooser.show() == 0) {
string filename = chooser.filename;
// Open the file...
}Fields
NativeFileChooserPtr _handleMethods
void title(string value)Sets the dialog title.void filter(string value)Sets the file filter pattern.void directory(string value)Sets the initial directory.void presetFile(string value)Sets the preset filename.int show()Shows the file chooser dialog.Constructors
this(FileChooserType type = FileChooserType.browseFile)Creates a new native file chooser.Destructors
enumColorMode
Color chooser mode.
rgb = 0RGB sliders
byteMode = 1Byte value sliders (0-255)
hex = 2Hex input
hsv = 3HSV sliders
Functions 8
fn
int choiceDialog(string message, string b0, string b1 = null, string b2 = null)Shows a choice dialog with up to 3 buttons.fn
Color * colorChooser(string title, Color initialColor = Color.init, ColorMode mode = ColorMode.rgb)Shows a color chooser dialog.