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

Selects one or more existing regular files.

import klyn.gui.windows.dialogs

dialog = OpenFileDialog("Open sources")
dialog.allowMultiple = true
dialog.filters = [FileDialogFilter("Klyn sources", "*.kn")]
if dialog.showDialog():
for file in dialog.selectedFiles:
print(file)
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 allowMultiple
allowMultiple as Boolean = false
Whether the user can select more than one file.
public readonly property selectedFiles
selectedFiles as IList<FilePath>:
Files selected by the last successful dialog invocation.
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 OpenFileDialog
OpenFileDialog(title as String = "Open file"):
Creates an open-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 selection 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