[mcclim-devel] Poor man's CLIM text style selection dialog

Paolo Amoroso amoroso at mclink.it
Sun Jul 24 16:23:16 UTC 2005


As a CLIM learning exercise, and as a way of finally contributing back
something even remotely useful to the CLIM community, I have written
the attached text style selection dialog.  I have tested it with
McCLIM and CMUCL under Linux, but it should work with little or no
modification with other CLIM implementations.

The dialog provides the same features of the CLIM text style model.
See for example make-text-style in the specification.

To invoke the dialog, just compile the file and evaluate:

  (clim-user::select-text-style)

from a listener, or call it from your own code.  When you click on
"OK", the function returns a CLIM text style object, nil otherwise.

The usage of the dialog should be straightforward, except for a couple
of issues.  When you enter a numeric text size in the appropriate
field (try 2 or 60 for fun), hit ENTER to update the sample text.  The
family/face/size gadgets are not updated.

See the code for additional information or issues.  The main problem
is that I shouldn't have written it in the first place: CLIM provides
the powerful accepting-values macro for creating dialogs.  McCLIM,
however, supports only part of its functionality and can be used in
simple cases.  The bottom line is that my code is an example of how to
fake a value-returning modal dialog, provides an interim solution, and
gives an appreciation of the power and complexity of accepting-values.


Paolo
-- 
Lisp Propulsion Laboratory log - http://www.paoloamoroso.it/log

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: select-text-style.lisp
URL: <https://mailman.common-lisp.net/pipermail/mcclim-devel/attachments/20050724/4e0e83bf/attachment.ksh>


More information about the mcclim-devel mailing list