SaveFileDialog
classin packageklyn.gui.windows.dialogs
public class SaveFileDialog extends FileDialog:
└ Widget
└ Dialog
└ SaveFileDialog

Selects a destination filename without creating the file.

import klyn.gui.windows.dialogs

dialog = SaveFileDialog("Export report")
dialog.suggestedName = "report"
dialog.defaultExtension = "html"
if dialog.showDialog():
dialog.selectedFile.write("<h1>Report</h1>")
Inherited Attributes
attributeInherited Attributes from Dialog: terminal, title
attributeInherited Attributes from Widget: lastRenderAnsi, lastRenderHeight, lastRenderPlain, lastRenderWidth, layout, visible
Properties
Modifier and Type Member Description
public property confirmOverwrite
confirmOverwrite as Boolean = true
Whether replacing an existing file requires explicit confirmation.
public property defaultExtension
defaultExtension as String = ""
Extension appended when the selected filename has no extension.
public readonly property selectedFile
selectedFile as FilePath:
Destination selected by the last successful invocation, or null.
public property suggestedName
suggestedName as String = ""
Filename proposed when the dialog opens.
Inherited Properties
propertyInherited Properties from FileDialog: filterIndex, filters, initialFolder
propertyInherited Properties from Widget: focusable, focused, lastRenderFrame, position, size
propertyInherited Properties from Object: type
Inherited Events
eventInherited Events from Dialog: accepted, cancelled
Constructors
Modifier and Type Member Description
public SaveFileDialog
SaveFileDialog(title as String = "Save file"):
Creates a save-file dialog.
Methods
Modifier and Type Member Description
public showDialog
showDialog(owner as Window = null) as Boolean throws DialogException:
Displays the chooser and waits for a destination or cancellation.
Inherited Methods
methodInherited Methods from Dialog: accept, cancel, close, show
methodInherited Methods from Widget: add, baseAnsiStyle, captureRenderFrame, children, clearChildren, configureCursor, focusNext, handleEvent, handleMouseEvent, hasActiveTextInput, idle, paint, paintToFrame, performLayout, refresh, renderAnsiSnapshot, renderPlainSnapshot, scrollbarThumbGlyph, scrollbarTrackGlyph, terminalPromptVisible
methodInherited Methods from Object: deepCopy, fromJson, hash, toDict, toJson, toString, toXml