wwlispkdialog Reference Manual

Version 1.2 - July 2008


What is wwlispkdialog? wwlispkdialog is a library which adds to wwlisp the capability to define GUI dialogs based on Qt and KDE. A unique class, the kdialog class, is added to the native wwlisp class hierarchy. With it, the programmer can define very populated dialogs with tens of widgets and sophisticated interactions and feedbacks, using the callback principle which is well known and has been used in most of the GUI toolkits.

It is also possible to define a dialog in a totally linear way such that the user can view, enter or modify values, select radiobuttons or tick checkboxes, and finally press an ok or a cancel button, and then to retrieve all the values and states straight in the program, without any complicated concept of signals, slots or even GUI-callback. Just do something like:

create a dialog and add widgets to it
display the dialog and let the user interact with it, finishing by pressing any button
retrieve the values in the program or script
destroy the dialog

Sure, the tremendous capabilities of Qt and KDE are by far not fully exploited by the wwlispkdialog library, but a lot of scripting, prototyping and application development can already be done with the few selected widgets and options implemented in this library.

Finally, this library can evolve to contain more classes and more options to control the widgets, but this depends mostly on you, the Users! Give me a feedback, your critics, your suggestions and maybe we could make this humble tool quite useful for the community.
Index of The Classes and Classless Functions
The class definitions describe the methods specific to each class. In each class, all the methods defined in its ancestor classes are also callable, but they are not repeated in the documentation.

How to Load the Library

Simple Explanation

Do (use "kdialog") to load and initialize the library.

Detailed Explanation

wwlisp must be installed as well as the wwlispkdialog library. Usually, they are installed in /usr/local/bin. The library is a standard Linux shared object which must be loaded in the wwlisp process by calling the dlopen system call. This is done by the wwlisp library class constructor. Once the library has been loaded in the process and a library object has been returned to wwlisp, the new functions and classes contained in the library must still be linked to the global environment of the calling wwlisp thread. This is done by using the foreign function interface and calling an initialization function of the library. Then only all the classes, methods and classless functions are available to the user, as native compiled functions. Actually the procedure is quite simple, just start the wwlisp interpreter and then evaluate the following forms:
(setq kdlib(make-instance library "/usr/local/bin/wwlispkdialog"))
(call kdlib "int initialize()")

The library initialization function creates also a KApplication object needed for KDE, but this code is not multi-threaded. So, if you intend to spawn threads in your application, initialize first the library and then only start other threads. This garantees that the KApplication code is executed only one time and avoids unexpected results.

Snapshots

A Demo Dialog

The following snapshot shows a typical demo dialog. This application has no other purpose than to demonstrate a quite busy dialog and to test it.


To run the demo, first install wwlisp and wwlispkdialog on your computer, then download the following demokdialog script in your current directory, make it executable, and finally invoke it (do ./demokdialog).
Updated 1 July 2008 Copyright © 2008 Walther Waeles

SourceForge.net Logo