summaryrefslogtreecommitdiff
path: root/vendor/0xacab.org/leap/go-dialog/README.md
diff options
context:
space:
mode:
authorKali Kaneko (leap communications) <kali@leap.se>2019-01-12 18:39:45 +0100
committerRuben Pollan <meskio@sindominio.net>2019-01-17 12:30:32 +0100
commitb1247d2d0d51108c910a73891ff3116e5f032ab1 (patch)
treee9948964f0bfb1ad2df3bc7bad02aa1f41ccfbd8 /vendor/0xacab.org/leap/go-dialog/README.md
parentefcb8312e31b5c2261b1a1e95ace55b322cfcc27 (diff)
[pkg] all your deps are vendored to us
Diffstat (limited to 'vendor/0xacab.org/leap/go-dialog/README.md')
-rw-r--r--vendor/0xacab.org/leap/go-dialog/README.md29
1 files changed, 29 insertions, 0 deletions
diff --git a/vendor/0xacab.org/leap/go-dialog/README.md b/vendor/0xacab.org/leap/go-dialog/README.md
new file mode 100644
index 0000000..afedf80
--- /dev/null
+++ b/vendor/0xacab.org/leap/go-dialog/README.md
@@ -0,0 +1,29 @@
+# dialog
+Simple cross-platform dialog API for go-lang
+
+# examples
+ ok := dialog.Message("%s", "Do you want to continue?").Title("Are you sure?").YesNo()
+
+Creates a dialog box titled "Are you sure?", containing the message "Do you want to continue?",
+a "Yes" button and a "No" button. Returns true iff the dialog could be displayed and the user
+pressed the "Yes" button.
+
+ filename, err := dialog.File().Filter("Mp3 audio file", "mp3").Load()
+
+Creates a file selection dialog allowing the user to select a .mp3 file. The absolute path of
+the file is returned, unless an error is encountered or the user cancels/closes the dialog.
+In the latter case, `filename` will be the empty string and `err` will equal `dialog.Cancelled`.
+
+ filename, err := dialog.File().Filter("XML files", "xml").Title("Export to XML").Save()
+
+Asks the user for a filename to write data into. If the user selects a file which already exists,
+an additional dialog is spawned to confirm they want to overwrite the existing file.
+
+ directory, err := dialog.Directory().Title("Load images").Browse()
+
+Asks the user for a directory.
+
+# platform details
+* OSX: uses Cocoa's NSAlert/NSSavePanel/NSOpenPanel clasess
+* Win32: uses MessageBox/GetOpenFileName/GetSaveFileName (via package github.com/AllenDang/w32)
+* Linux: uses Gtk's MessageDialog/FileChooserDialog (via package github.com/mattn/gtk)