Skip to content
Snippets Groups Projects
Commit f650ebff authored by emarsden's avatar emarsden
Browse files

Improvements to the CMUCL Motif Interface guide:

   - improved the example to load the CLM subsystem and to set up packages
     correctly

   - added pdfinfo LaTeX commands
parent 5eaefe41
No related branches found
No related tags found
No related merge requests found
...@@ -3,13 +3,28 @@ ...@@ -3,13 +3,28 @@
%% LaTeX formatting by Marco Antoniotti based on internals.doc. %% LaTeX formatting by Marco Antoniotti based on internals.doc.
\documentclass{article} \documentclass[a4paper]{article}
\usepackage{a4wide} % \usepackage{a4wide}
\usepackage{palatino}
\newif\ifpdf
\ifx\pdfoutput\undefined
\pdffalse
\else
\pdfoutput=1
\pdftrue
\fi
\ifpdf
\pdfinfo{
/Title (The CMUCL Motif Toolkit)
/Keywords (CMUCL, Motif, interface)
}
\newcommand{\functdescr}[1]{\paragraph{\texttt{#1}}} \newcommand{\functdescr}[1]{\paragraph{\texttt{#1}}}
\title{CMUCL Motif Toolkit} \title{The CMUCL Motif Toolkit}
\begin{document} \begin{document}
...@@ -371,15 +386,61 @@ current application. ...@@ -371,15 +386,61 @@ current application.
\item Ability to send strings longer than 4096 bytes. \item Ability to send strings longer than 4096 bytes.
\end{itemize} \end{itemize}
All these things should start appearing in the next few
weeks\footnote{NOTE: This document was written at CMU many years ago.
The ``formatter'' does not make any guarantees about the validity of
this claim.}
\section{A brief example} \section{A brief example}
The following gives a simple example that pops up a window containing
a ``Quit'' button. Clicking on the button exits the application. Note
that the application runs concurrently with CMUCL: you can
evaluate forms in the listener while the Motif application is running.
Exiting the application does not cause CMUCL to exit; once you have
quit the application, you can run it again.
To run this example, save the code to a file named
\verb|motif-example.lisp| and in the CMUCL listener, type
\begin{verbatim}
USER> (compile-file "motif-example")
; Loading #p"/opt/cmucl/lib/cmucl/lib/subsystems/clm-library.x86f".
;; Loading #p"/opt/cmucl/lib/cmucl/lib/subsystems/clx-library.x86f".
; Byte Compiling Top-Level Form:
; Converted my-callback.
; Compiling defun my-callback:
; Converted test-init.
; Compiling defun test-init:
; Converted test.
; Compiling defun test:
; Byte Compiling Top-Level Form:
#p"/home/CMUCL/motif-example.x86f"
nil
nil
USER> (load *)
; Loading #p"/home/CMUCL/motif-example.x86f".
t
USER> (motif-example:test)
#<X Toolkit Connection, fd=5>
Got callback on #<X Toolkit Widget: push-button-gadget 82D89A0>
Callback reason was cr-activate
Quit button is #<X Toolkit Widget: push-button-gadget 82D7AD0>
USER> (quit)
\end{verbatim}
\newpage
The source code:
\begin{verbatim} \begin{verbatim}
;;; file motif-example.lisp
(eval-when (:load-toplevel :compile-toplevel)
(require :clm))
(defpackage :motif-example
(:use :cl :toolkit)
(:export #:test))
(in-package :motif-example)
(defun my-callback (widget call-data quit) (defun my-callback (widget call-data quit)
(format t "Got callback on ~A~%" widget) (format t "Got callback on ~A~%" widget)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment