Skip to content

Commit

Permalink
Readme updated
Browse files Browse the repository at this point in the history
  • Loading branch information
tenfensw committed Jul 23, 2019
1 parent 1e51a0d commit 4c63f62
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions README.md
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
Expand Down Expand Up @@ -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/


0 comments on commit 4c63f62

Please sign in to comment.