8.5 Examples of Defining Presentation Translators in CLIM

8.5.3 Defining Presentation Translators for the Blank Area

You can also write presentation translators that apply to blank areas of the window, that is, areas where there are no presentations. Use blank-area as the from-presentation-type. There is no highlighting when such a translator is applicable, since there is no presentation to highlight. You can write presentation translators that apply in any context by supplying nil as the to-presentation-type.

When you are writing an interactive graphics routine, you will probably encounter the need to have commands available when the mouse is not over any object. To do this, you write a translator from the blank area.

The presentation type of the blank area is blank-area. You probably want the :x and :y arguments to the translator.

For example:

 (clim:blank-area com-add-circle my-command-table 
                  :documentation "Add a circle here.") 
 (x y)
 '(,x ,y)) 

CLIM 2.0 User's Guide - OCT 1998

Generated with Harlequin WebMaker