-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
5 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
# DialogBind | ||
*Copyright (C) Tim K 2018-2019 <[email protected]>. Licensed under MIT License.* | ||
*Copyright (C) Tim K 2018-2019 <[email protected]>. Licensed under MIT License.*<br> | ||
https://rubygems.org/gems/dialogbind | ||
|
||
DialogBind is a library wrapping around message box displaying tools (zenity and xmessage) on Linux, macOS and Windows written in Ruby. | ||
|
||
## A simple example | ||
|
@@ -27,14 +29,7 @@ require 'dialogbind' | |
|
||
That's it! You can use it from your code, but it will only work on Linux, macOS, Windows and FreeBSD. Other platforms are not supported right now. | ||
|
||
## Basic usage | ||
Currently, the following functions are available: | ||
- ``def guiputs(text, title='DialogBind')`` - shows a simple information message box with the specified text and title. Returns true if the dialog box was successfully shown or false if something went wrong. | ||
- ``def guierror(text, title='DialogBind')`` - shows an error message box with the specified text and title. Returns the same value as guiputs. | ||
- ``def guiselect(list, text, title='DialogBind')`` - shows a list message box with the specified items and text/title. If the user selects nothing, '' is returned. The selection is returned if something was actually selected. If something goes wrong, nil is returned. More than two list entries are currently not supported. | ||
- ``def guilicense(file, title='DialogBind')`` - shows a license message box, the contents of which will be read from the specified file. Returns false if the license agreement was denied, otherwise, true is returned. Does not work on macOS. | ||
- ``def guiprogress(text, title='DialogBind')`` - shows a progress message box. It would be nice if you've placed it in a seperate thread. Currently, it is buggy when used with zenity backend, so it is not recommended for use in production. | ||
|
||
The backend to use is determined automatically, though you can always specify it manually by setting the ``DIALOGBIND_BACKEND`` variable. Currently, ``xmessage``, ``macos`` and ``zenity`` are the only backends that are supported. | ||
## Docs | ||
Docs are available on RubyDoc: http://www.rubydoc.info/gems/dialogbind/ | ||
|
||
|