Interzona

nodgui

Table of Contents

Latest News

2020-03-27 version 0.0.6

Fixed a bug in validatecommand for widget entry.

2019-12-07 Version 0.0.5

The user can choose (from a set) the shape of a symbol to paint the points of a scatter plot.

Introduction

"No Drama GUI"

Common Lisp bindings for the Tk GUI toolkit.

Screenshots

date-picker.png

Figure 1: A date picker widget

canvas.png

Figure 2: A canvas with some shapes painted on it

Dependency

Programs

Lisp libraries

  • alexandria;
  • cl-ppcre-unicode;
  • cl-lex;
  • cl-yacc;
  • clunit2;
  • cl-colors2;
  • named-readtables.

All of the above libraries are available on quicklisp.

TCL/TK libraries (optional)

Installing

  1. install the tk interpreter (example on a Debian system follows)
$ su -
# apt-get install tk
  1. optionally install tklib
$ su -
# apt-get install tklib
  1. open a REPL and type
(ql:quickload "nodgui")
  1. try it!
(nodgui.demo::demo)

Source code

Optionally you can install the library getting the source code from project's repository.

Widget pack

This library define a few additional widgets more than the standard TK ones.

There should be a decent quantity of documentation as docstrings on the sources.

Probably checking the excellent quickdocs or the excellent as well quickref could be useful too (note that the documentation there does not always reflects the latest version of this library).

MegaWidget

All these widget, written in common lisp, are defined in file src/nogui-mw.lisp.

MegaWidget list

history-entry
An entry widget keeping the history of previous input (which can be browsed through with cursor up and down), the input can be also auto-completed pressing the TAB key.
treelist

Display a tree-like structure by a set of listboxes.

tree-list.png

tooltip

Display a little informative box for the widget under the mouse pointer position.

tooltip.png

License for the image.

gtree

Render a tree.

graphical-tree.png

searchable-listbox
A listbox with an entry to filter its contents
autocomplete-listbox
Acts like searchable-listbox but the items added comes from the results from apply autocomplete-function-hook to the content of the text entry. This function is triggered after a character is inserted into the entry.
date-picker

A widget to choose a date

date-picker.png

password-entry
A widget to input a password (the actual characters are not shown when typed, a placeholder is rendered instead).
progress-bar-star

a progress bar that display stars to show progress

progress-bar-star.png

Tklib

Some more widget in nodgui derive from wrapping and, in some case, extending the widget set contained in tklib

To use these widget in nodgui tklib must be installed on your system, fortunately this library is widely available at least on GNU/Linux.

On Debian just a couple of commands are needed:

$ su -
(root)# apt-get install tklib

Tklib derived widgets

calendar
A widget to choose a date;

tklib-calendar.png

notify-window
show a fading out notification text to the user; on the top right of the screen;

tklib-notify.png

dot-plot
draw a scatter plot (with optional error bars) on a canvas.

tklib-plot.png

bar-chart
draw an histogram

tklib-histogram.png

equalizer-bar

tklib-equalizer-bar.png

swap-list

tklib-swaplist.png

FAQ

Can I contribute to this project?

Yes, of course! Please open an issue or a pull request on the web repository, if you do not feel comfortable with coding, documentation improvements are very welcome too! :)

Also i would appreciate testing if the library works on different environment than mine (Debian GNU/Linux with SBCL).

Status

All tk commands as of version 8.4 with support information. - means not supported by purpose (look comment), x means supported, though some options may not be supported.

command supported comment
bell x  
bind x  
bindtags modify modify the tag list of a widget that
    describes which events it gets
bitmap - see image
button x  
canvas x  
checkbutton x  
clipboard x (canvas get missing… tricky…)
colors - see Colors Name
console - only on some platforms
cursors x  
destroy x  
entry x  
event create create and manage virtual events
focus x focus management functions
font    
frame x  
grab    
busy x  
grid x  
image x  
keysyms x  
label x  
labelframe x  
listbox x  
loadTk -  
lower x  
menu x  
menubutton x  
message x  
option -  
options - only helpfile
pack x  
panedwindow x  
photo x support for PNG, GIF, JPEG and raw RGB(A) format.
place x geometry manager using coordinates
radiobutton x  
raise x  
scale x  
scrollbar x  
selection    
send    
spinbox x  
text x  
tk    
tk_bisque - only for tk backwards compatibility
tk_chooseColor    
tk_chooseDirectory    
tk_dialog    
tk_focusFollowsMouse    
tk_focusNext    
tk_focusPrev    
tk_getOpenFile x  
tk_getSaveFile x  
tk_menuSetFocus -  
tk_messageBox x  
tk_optionMenu    
tk_popup    
tk_setPalette -  
tk_textCopy    
tk_textCut    
tk_textPaste    
tkerror -  
tkvars -  
tkwait    
toplevel x  
treeview x  
winfo x  
wm x  

support of all config args as keywords to make-instance:

command supported
bitmap -
button x
canvas x
checkbutton x
entry x
frame x
image  
label x
labelframe x
listbox x
menu  
menubutton  
message  
panedwindow x
photo  
radiobutton x
scale x
scrollbar x
spinbox x
text x
toplevel x

Compatibility

OS / compiler SBCL 1.4.14 ECL CCL 1.11.6
GNU/Linux x x1 x2
MacOS ? ? x3
Win ? ? ?

Notes

Colors Name

Color name from library cl-color can be used as follows:

  • with a reader macro (#%...%) at read time:

    (named-readtables:in-readtable nodgui.syntax:nodgui-syntax) ; do not forget that!
    
    [...]
    
    #%red%
    

    at runtime using:

    (rgb->tk cl-colors:+red+)
    

    the list of supported colors name can be found in: this file.

License

This software is Copyright (c) 2003-2010 Peter Herth

Portions Copyright (c) 2005-2010 Thomas F. Burdick

Portions Copyright (c) 2006-2010 Cadence Design Systems

Portions Copyright (c) 2010 Daniel Herring

Portions Copyright (c) 2018, 2019 cage

The authors grant you the rights to distribute and use this software as governed by the terms of the Lisp Lesser GNU Public License (http://opensource.franz.com/preamble.html), known as the LLGPL.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

This single file is released under LLGPL

Footnotes:

1

Using version from git repository

2

There are problem with multi-threading (writing or reading to wish pipe concurrently)

3

It requires TCL/TK update see: issue #7


This work is licensed under a Creative Commons Attribution-ShareAlike 3.0 Italy License.

Distribuited software and source code published are licensed under the GNU General Public License version 3.0 or later if not specified otherwise.