Package org.lwjgl.util.tinyfd
Class TinyFileDialogs
java.lang.Object
org.lwjgl.util.tinyfd.TinyFileDialogs
Bindings to tiny file dialogs, a native dialog library with support for:
- message / question
- input / password
- save file
- open file & multiple files
- select folder
- color picker
The dialogs can be forced into console mode.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringCurses dialogs are difficult to use, on windows they are only ascii and uses the unix backslashstatic final String0 (default) or 1.static final String0 (default) or 1.static final StringContains info about requirements.static final StringIf you pass "tinyfd_query" asaTitle, the functions will not display the dialogs but will filltinyfd_responsewith the retain solution and return 0 for console mode, 1 for graphic mode.static final String1 (default) or 0 : on unix, hide errors and warnings from called dialogsstatic final String0 (default) or 1 : on unix, prints the command line callsstatic final StringContains tinyfd current version number.static final StringOn windows, set to 1 if you want to use UTF-8. -
Method Summary
Modifier and TypeMethodDescriptionstatic longntinyfd_colorChooser(long aTitle, long aDefaultHexRGB, long aDefaultRGB, long aoResultRGB) Unsafe version of:colorChooserstatic longntinyfd_getGlobalChar(long aCharVariableName) Unsafe version of:getGlobalCharstatic intntinyfd_getGlobalInt(long aIntVariableName) Unsafe version of:getGlobalIntstatic longntinyfd_inputBox(long aTitle, long aMessage, long aDefaultInput) Unsafe version of:inputBoxstatic intntinyfd_messageBox(long aTitle, long aMessage, long aDialogType, long aIconType, int aDefaultButton) Unsafe version of:messageBoxstatic intntinyfd_notifyPopup(long aTitle, long aMessage, long aIconType) Unsafe version of:notifyPopupstatic longntinyfd_openFileDialog(long aTitle, long aDefaultPathAndFile, int aNumOfFilterPatterns, long aFilterPatterns, long aSingleFilterDescription, int aAllowMultipleSelects) Unsafe version of:openFileDialogstatic longntinyfd_saveFileDialog(long aTitle, long aDefaultPathAndFile, int aNumOfFilterPatterns, long aFilterPatterns, long aSingleFilterDescription) Unsafe version of:saveFileDialogstatic longntinyfd_selectFolderDialog(long aTitle, long aDefaultPath) Unsafe version of:selectFolderDialogstatic intntinyfd_setGlobalInt(long aIntVariableName, int aValue) Unsafe version of:setGlobalIntstatic voidstatic Stringtinyfd_colorChooser(CharSequence aTitle, CharSequence aDefaultHexRGB, ByteBuffer aDefaultRGB, ByteBuffer aoResultRGB) Displays a color chooser dialog.static Stringtinyfd_colorChooser(ByteBuffer aTitle, ByteBuffer aDefaultHexRGB, ByteBuffer aDefaultRGB, ByteBuffer aoResultRGB) Displays a color chooser dialog.static Stringtinyfd_getGlobalChar(CharSequence aCharVariableName) static Stringtinyfd_getGlobalChar(ByteBuffer aCharVariableName) static inttinyfd_getGlobalInt(CharSequence aIntVariableName) static inttinyfd_getGlobalInt(ByteBuffer aIntVariableName) static Stringtinyfd_inputBox(CharSequence aTitle, CharSequence aMessage, CharSequence aDefaultInput) Displays an input dialog.static Stringtinyfd_inputBox(ByteBuffer aTitle, ByteBuffer aMessage, ByteBuffer aDefaultInput) Displays an input dialog.static booleantinyfd_messageBox(CharSequence aTitle, CharSequence aMessage, CharSequence aDialogType, CharSequence aIconType, boolean aDefaultButton) Displays a message dialog.static booleantinyfd_messageBox(ByteBuffer aTitle, ByteBuffer aMessage, ByteBuffer aDialogType, ByteBuffer aIconType, boolean aDefaultButton) Displays a message dialog.static inttinyfd_notifyPopup(CharSequence aTitle, CharSequence aMessage, CharSequence aIconType) Displays a notification popup.static inttinyfd_notifyPopup(ByteBuffer aTitle, ByteBuffer aMessage, ByteBuffer aIconType) Displays a notification popup.static Stringtinyfd_openFileDialog(CharSequence aTitle, CharSequence aDefaultPathAndFile, org.lwjgl.PointerBuffer aFilterPatterns, CharSequence aSingleFilterDescription, boolean aAllowMultipleSelects) Displays a file open dialog.static Stringtinyfd_openFileDialog(ByteBuffer aTitle, ByteBuffer aDefaultPathAndFile, org.lwjgl.PointerBuffer aFilterPatterns, ByteBuffer aSingleFilterDescription, boolean aAllowMultipleSelects) Displays a file open dialog.static Stringtinyfd_saveFileDialog(CharSequence aTitle, CharSequence aDefaultPathAndFile, org.lwjgl.PointerBuffer aFilterPatterns, CharSequence aSingleFilterDescription) Displays a file save dialog.static Stringtinyfd_saveFileDialog(ByteBuffer aTitle, ByteBuffer aDefaultPathAndFile, org.lwjgl.PointerBuffer aFilterPatterns, ByteBuffer aSingleFilterDescription) Displays a file save dialog.static Stringtinyfd_selectFolderDialog(CharSequence aTitle, CharSequence aDefaultPath) Displays a folder selection dialog.static Stringtinyfd_selectFolderDialog(ByteBuffer aTitle, ByteBuffer aDefaultPath) Displays a folder selection dialog.static inttinyfd_setGlobalInt(CharSequence aIntVariableName, int aValue) static inttinyfd_setGlobalInt(ByteBuffer aIntVariableName, int aValue)
-
Field Details
-
tinyfd_version
Contains tinyfd current version number.- See Also:
-
tinyfd_needs
Contains info about requirements.- See Also:
-
tinyfd_response
If you pass "tinyfd_query" asaTitle, the functions will not display the dialogs but will filltinyfd_responsewith the retain solution and return 0 for console mode, 1 for graphic mode.Possible values for
tinyfd_responseare (all lowercase) for the graphic mode:windows_wchar windows applescript kdialog zenity zenity3 matedialog shellementary qarma yad python2-tkinter python3-tkinter python-dbus perl-dbus gxmessage gmessage xmessage xdialog gdialogFor the console mode:
dialog whiptail basicinput no_solution- See Also:
-
tinyfd_verbose
0 (default) or 1 : on unix, prints the command line calls- See Also:
-
tinyfd_silent
1 (default) or 0 : on unix, hide errors and warnings from called dialogs- See Also:
-
tinyfd_allowCursesDialogs
Curses dialogs are difficult to use, on windows they are only ascii and uses the unix backslash- See Also:
-
tinyfd_forceConsole
0 (default) or 1. For unix & windows: 0 (graphic mode) or 1 (console mode).0: try to use a graphic solution, if it fails then it uses console mode.
1: forces all dialogs into console mode even when an X server is present, it can use the package dialog or dialog.exe. On windows it only make sense for console applications
- See Also:
-
tinyfd_assumeGraphicDisplay
0 (default) or 1.Some systems don't set the environment variable
DISPLAYeven when a graphic display is present. Set this to 1 to tell tinyfiledialogs to assume the existence of a graphic display.- See Also:
-
tinyfd_winUtf8
On windows, set to 1 if you want to use UTF-8.LWJGL note: this is automatically set to 1.
- See Also:
-
-
Method Details
-
ntinyfd_getGlobalChar
public static long ntinyfd_getGlobalChar(long aCharVariableName) Unsafe version of:getGlobalChar -
tinyfd_getGlobalChar
-
tinyfd_getGlobalChar
-
ntinyfd_getGlobalInt
public static int ntinyfd_getGlobalInt(long aIntVariableName) Unsafe version of:getGlobalInt -
tinyfd_getGlobalInt
- Parameters:
aIntVariableName- one of:verbosesilentallowCursesDialogsforceConsoleassumeGraphicDisplaywinUtf8- Returns:
- -1 on error
-
tinyfd_getGlobalInt
- Parameters:
aIntVariableName- one of:verbosesilentallowCursesDialogsforceConsoleassumeGraphicDisplaywinUtf8- Returns:
- -1 on error
-
ntinyfd_setGlobalInt
public static int ntinyfd_setGlobalInt(long aIntVariableName, int aValue) Unsafe version of:setGlobalInt -
tinyfd_setGlobalInt
- Parameters:
aIntVariableName- one of:verbosesilentallowCursesDialogsforceConsoleassumeGraphicDisplaywinUtf8- Returns:
- -1 on error
-
tinyfd_setGlobalInt
- Parameters:
aIntVariableName- one of:verbosesilentallowCursesDialogsforceConsoleassumeGraphicDisplaywinUtf8- Returns:
- -1 on error
-
tinyfd_beep
public static void tinyfd_beep() -
ntinyfd_notifyPopup
public static int ntinyfd_notifyPopup(long aTitle, long aMessage, long aIconType) Unsafe version of:notifyPopup -
tinyfd_notifyPopup
public static int tinyfd_notifyPopup(@Nullable ByteBuffer aTitle, @Nullable ByteBuffer aMessage, ByteBuffer aIconType) Displays a notification popup.- Parameters:
aTitle- the dialog title orNULLaMessage- the message orNULL. It may contain \n and \t characters.aIconType- the icon type. One of:"info" "warning" "error"
-
tinyfd_notifyPopup
public static int tinyfd_notifyPopup(@Nullable CharSequence aTitle, @Nullable CharSequence aMessage, CharSequence aIconType) Displays a notification popup.- Parameters:
aTitle- the dialog title orNULLaMessage- the message orNULL. It may contain \n and \t characters.aIconType- the icon type. One of:"info" "warning" "error"
-
ntinyfd_messageBox
public static int ntinyfd_messageBox(long aTitle, long aMessage, long aDialogType, long aIconType, int aDefaultButton) Unsafe version of:messageBox -
tinyfd_messageBox
public static boolean tinyfd_messageBox(@Nullable ByteBuffer aTitle, @Nullable ByteBuffer aMessage, ByteBuffer aDialogType, ByteBuffer aIconType, boolean aDefaultButton) Displays a message dialog.- Parameters:
aTitle- the dialog title orNULLaMessage- the message orNULL. It may contain \n and \t characters.aDialogType- the dialog type. One of:"ok" "okcancel" "yesno" "yesnocancel" aIconType- the icon type. One of:"info" "warning" "error" "question" aDefaultButton- 0 for cancel/no, 1 for ok/yes- Returns:
- 0 for cancel/no, 1 for ok/yes, 2 for no in yesnocancel
-
tinyfd_messageBox
public static boolean tinyfd_messageBox(@Nullable CharSequence aTitle, @Nullable CharSequence aMessage, CharSequence aDialogType, CharSequence aIconType, boolean aDefaultButton) Displays a message dialog.- Parameters:
aTitle- the dialog title orNULLaMessage- the message orNULL. It may contain \n and \t characters.aDialogType- the dialog type. One of:"ok" "okcancel" "yesno" "yesnocancel" aIconType- the icon type. One of:"info" "warning" "error" "question" aDefaultButton- 0 for cancel/no, 1 for ok/yes- Returns:
- 0 for cancel/no, 1 for ok/yes, 2 for no in yesnocancel
-
ntinyfd_inputBox
public static long ntinyfd_inputBox(long aTitle, long aMessage, long aDefaultInput) Unsafe version of:inputBox -
tinyfd_inputBox
@Nullable public static String tinyfd_inputBox(@Nullable ByteBuffer aTitle, @Nullable ByteBuffer aMessage, @Nullable ByteBuffer aDefaultInput) Displays an input dialog.- Parameters:
aTitle- the dialog title orNULLaMessage- the message orNULL. May NOT contain \n and \t characters on Windows.aDefaultInput- ifNULLit's a password box- Returns:
- the input value or
NULLon cancel
-
tinyfd_inputBox
@Nullable public static String tinyfd_inputBox(@Nullable CharSequence aTitle, @Nullable CharSequence aMessage, @Nullable CharSequence aDefaultInput) Displays an input dialog.- Parameters:
aTitle- the dialog title orNULLaMessage- the message orNULL. May NOT contain \n and \t characters on Windows.aDefaultInput- ifNULLit's a password box- Returns:
- the input value or
NULLon cancel
-
ntinyfd_saveFileDialog
public static long ntinyfd_saveFileDialog(long aTitle, long aDefaultPathAndFile, int aNumOfFilterPatterns, long aFilterPatterns, long aSingleFilterDescription) Unsafe version of:saveFileDialog- Parameters:
aNumOfFilterPatterns- the number of patterns inaFilterPatterns
-
tinyfd_saveFileDialog
@Nullable public static String tinyfd_saveFileDialog(@Nullable ByteBuffer aTitle, @Nullable ByteBuffer aDefaultPathAndFile, @Nullable org.lwjgl.PointerBuffer aFilterPatterns, @Nullable ByteBuffer aSingleFilterDescription) Displays a file save dialog.- Parameters:
aTitle- the dialog title orNULLaDefaultPathAndFile- the default path and/or file orNULLaFilterPatterns- an array of file type patterns (NULLor {"*.jpg","*.png"}aSingleFilterDescription-NULLor "image files"- Returns:
- the selected file path or
NULLon cancel
-
tinyfd_saveFileDialog
@Nullable public static String tinyfd_saveFileDialog(@Nullable CharSequence aTitle, @Nullable CharSequence aDefaultPathAndFile, @Nullable org.lwjgl.PointerBuffer aFilterPatterns, @Nullable CharSequence aSingleFilterDescription) Displays a file save dialog.- Parameters:
aTitle- the dialog title orNULLaDefaultPathAndFile- the default path and/or file orNULLaFilterPatterns- an array of file type patterns (NULLor {"*.jpg","*.png"}aSingleFilterDescription-NULLor "image files"- Returns:
- the selected file path or
NULLon cancel
-
ntinyfd_openFileDialog
public static long ntinyfd_openFileDialog(long aTitle, long aDefaultPathAndFile, int aNumOfFilterPatterns, long aFilterPatterns, long aSingleFilterDescription, int aAllowMultipleSelects) Unsafe version of:openFileDialog- Parameters:
aNumOfFilterPatterns- the number of patterns inaFilterPatterns
-
tinyfd_openFileDialog
@Nullable public static String tinyfd_openFileDialog(@Nullable ByteBuffer aTitle, @Nullable ByteBuffer aDefaultPathAndFile, @Nullable org.lwjgl.PointerBuffer aFilterPatterns, @Nullable ByteBuffer aSingleFilterDescription, boolean aAllowMultipleSelects) Displays a file open dialog.- Parameters:
aTitle- the dialog title orNULLaDefaultPathAndFile- the default path and/or file orNULLaFilterPatterns- an array of file type patterns (NULLor {"*.jpg","*.png"}aSingleFilterDescription-NULLor "image files"aAllowMultipleSelects- if true, multiple selections are allowed- Returns:
- the file(s) selected or
NULLon cancel. In case of multiple files, the separator is '|'.
-
tinyfd_openFileDialog
@Nullable public static String tinyfd_openFileDialog(@Nullable CharSequence aTitle, @Nullable CharSequence aDefaultPathAndFile, @Nullable org.lwjgl.PointerBuffer aFilterPatterns, @Nullable CharSequence aSingleFilterDescription, boolean aAllowMultipleSelects) Displays a file open dialog.- Parameters:
aTitle- the dialog title orNULLaDefaultPathAndFile- the default path and/or file orNULLaFilterPatterns- an array of file type patterns (NULLor {"*.jpg","*.png"}aSingleFilterDescription-NULLor "image files"aAllowMultipleSelects- if true, multiple selections are allowed- Returns:
- the file(s) selected or
NULLon cancel. In case of multiple files, the separator is '|'.
-
ntinyfd_selectFolderDialog
public static long ntinyfd_selectFolderDialog(long aTitle, long aDefaultPath) Unsafe version of:selectFolderDialog -
tinyfd_selectFolderDialog
@Nullable public static String tinyfd_selectFolderDialog(@Nullable ByteBuffer aTitle, ByteBuffer aDefaultPath) Displays a folder selection dialog.- Parameters:
aTitle- the dialog title orNULLaDefaultPath- the default path orNULL
-
tinyfd_selectFolderDialog
@Nullable public static String tinyfd_selectFolderDialog(@Nullable CharSequence aTitle, CharSequence aDefaultPath) Displays a folder selection dialog.- Parameters:
aTitle- the dialog title orNULLaDefaultPath- the default path orNULL
-
ntinyfd_colorChooser
public static long ntinyfd_colorChooser(long aTitle, long aDefaultHexRGB, long aDefaultRGB, long aoResultRGB) Unsafe version of:colorChooser -
tinyfd_colorChooser
@Nullable public static String tinyfd_colorChooser(@Nullable ByteBuffer aTitle, @Nullable ByteBuffer aDefaultHexRGB, @Nullable ByteBuffer aDefaultRGB, ByteBuffer aoResultRGB) Displays a color chooser dialog.- Parameters:
aTitle- the dialog title orNULLaDefaultHexRGB-NULLor "#FF0000"aDefaultRGB- { 0 , 255 , 255 }. Used only ifaDefaultHexRGBisNULL.aoResultRGB- returns the selected color.aDefaultRGBandaoResultRGBcan be the same array.- Returns:
- the selected hexcolor as a string "#FF0000" or
NULLon cancel
-
tinyfd_colorChooser
@Nullable public static String tinyfd_colorChooser(@Nullable CharSequence aTitle, @Nullable CharSequence aDefaultHexRGB, @Nullable ByteBuffer aDefaultRGB, ByteBuffer aoResultRGB) Displays a color chooser dialog.- Parameters:
aTitle- the dialog title orNULLaDefaultHexRGB-NULLor "#FF0000"aDefaultRGB- { 0 , 255 , 255 }. Used only ifaDefaultHexRGBisNULL.aoResultRGB- returns the selected color.aDefaultRGBandaoResultRGBcan be the same array.- Returns:
- the selected hexcolor as a string "#FF0000" or
NULLon cancel
-