rain1 ca94f01675 * README.md: Set version to 0.1. | 8 years ago | |
---|---|---|
examples | 8 years ago | |
.gitignore | 8 years ago | |
LICENSE | 8 years ago | |
Makefile | 8 years ago | |
README.md | 8 years ago | |
zenity.scm | 8 years ago |
Version: 0.1
Zenity is a command line tool that displays simple dialog boxes.
This library creates scheme procedures that build up a zenity command line, call it then parse the result and return it as scheme data.
https://help.gnome.org/users/zenity/stable/
To use this you need to install the zenity
program.
After than you need to move the zenity.scm
file of this repo into your GUILE_LOAD_PATH
.
To test that it's working try this:
$ guile
scheme@(guile-user)> (use-modules (zenity))
scheme@(guile-user)> (zenity-info "Hello world!")
Gtk-Message: GtkDialog mapped without a transient parent. This is discouraged.
$1 = #t
the warning can be ignored.
There are two examples programs:
guile -l birthday.scm
: This programs asks your date of birth and sometimes wishes a happy birthday.guile -l list-example.scm
: This program demonstrates using the list dialog (since it is a bit more complex to call than others).(zenity-calendar message)
Shows a calendar for the user to pick a date from. The return value will be #f on Cancel, and an assoc list with fields day
, month
, year
on success.
(zenity-file-selection title #:key (multiple #f) (directory #f) (save #f) (filename #f))
This opens up a dialog for choosing a file. There are keyword options to allow selecting multiple files, restricting it to directories only or making a new filename to save data to. A new keyword filename added to let you preset which directory the file might be chosen from.
Warning: A limitation of the way zenity outputs the file list (separated by the | character) is that this gives bad output on files with | in the name.
(zenity-list message columns rows)
(zenity-checklist message columns rows)
Pass in list of columns and then a list of rows to let display and let an item be chosen from a list.
The return value of zenity-list is the selected row. The return value of zenity-checklist is a list of the string versions of the first column of the selected items.
(zenity-error message)
(zenity-info message)
(zenity-question message)
(zenity-warning message)
Display a simple informational dialog box. The -question and -warning variants return a boolean for whether OK or Cancel was pressed.
(zenity-password message)
(zenity-entry message)
Asks the user for some input, the return value is #f on Cancel or the text that was inputted.