11.01.2015 Views

CLIM 2 User Guide

CLIM 2 User Guide

CLIM 2 User Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Notice the Window Menu Button in the upper right corner. Pressing the left mouse button over it brings<br />

up a menu of choices. Choosing Size allows you to change the size of the window. We have done so, making<br />

the window bigger:<br />

Clicking on the Quit button will cause the frame to be closed. You can clear the display pane portion by<br />

evaluating<br />

(window-clear *test-pane*)<br />

*test-frame* and *test-pane*<br />

The frame we have just created is the value of *test-frame*. The display pane inside the frame is the<br />

value of *test-pane*. many of the examples in this manual use *test-frame* or *test-pane*.<br />

If you wish to try those examples, you should create this frame and pane as indicated above.<br />

Many <strong>CLIM</strong> operations need a context to work<br />

Many <strong>CLIM</strong> operations need to be executed from within the context of a frame’s top level function. In particular<br />

this ensures that *application-frame* is correctly bound. If you get unexpected results by<br />

calling <strong>CLIM</strong> functions outside of this context (eg simply evaluating the forms within a listener) the first<br />

thing you should try is to call the functions from within the frame’s top level. You can do this by defining<br />

frame commands with :menu t and then activating the command from the running frame. e.g.<br />

(define-test-command (com-clear :menu t) ()<br />

(let ((stream (get-frame-pane *application-frame* ’display)))<br />

(window-clear stream)))<br />

Another alternative is to use the <strong>CLIM</strong> Lisp Listener demo. This provides a read-eval-print loop running<br />

within the frame’s top level. *standard-output* can be used whenever a <strong>CLIM</strong> stream pane is<br />

required. eg.<br />

(window-clear *standard-output*)<br />

20 <strong>CLIM</strong> 2.2 <strong>User</strong> <strong>Guide</strong>

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!