1 CAPI Reference Entries
A function that knows how to redisplay the pane.
A function called when the user scrolls the pane.
output-paneis a subclass of
gp:graphics-port-mixinwhich means that it supports many of the graphics ports drawing operations. When the CAPI needs to redisplay a region of the output pane, the
display-callbackgets called with the
output-paneand the x, y, width and height of the region that needs redrawing, and the callback should then use graphics port operations to redisplay that area. To force an area to be redisplayed, use the function
input-modelprovides a means to get callbacks on mouse and keyboard gestures. An
input-modelis a list of mappings from gesture to callback, where each mapping is a list of a gesture and a callback and optional arguments to be passed to the callback. The gesture itself is a list specifying the type of gesture, which can be a button, key, character or motion gesture, along with optional arguments specifying keyboard modifiers (
:meta) and actions associated with the gesture (
:motion). These options can be specified in any order, and if the list is only one item long then the gesture can be specified as just the item itself.
:button-3) along with an optional action (one of
:motion) and zero or more keyboard modifiers.
:keymeaning any key) along with an optional action (one of
:release) and zero or more keyboard modifiers.
:charactermeaning any character.
:motion), or it can be defined for motions whilst no button is down by just specifying the keyword
:motionwith no additional arguments.
input-modelalso accepts a command instead of a gesture, where a command is defined using
define-command, and provides an alias for a gesture.
output-paneand the new x and y coordinates of the top-left hand corner of the visible part of the output pane. This callback is for information only, as scrolling and redrawing any exposed areas will be handled by calls to the
(defun display-circle (self x y width height) (declare (ignore x y width height)) (gp:draw-circle self 200 200 200 :filled t)) (capi:contain (make-instance 'capi:output-pane :display-callback 'display-circle) :best-width 200 :best-height 200)
(defun test-callback (self x y) (capi:display-message "Pressed button 1 at (~S,~S) in ~S" x y self)) (capi:contain (make-instance 'capi:output-pane :title "Press button 1:" :input-model `(((:button-1 :press) test-callback))) :best-width 200 :best-height 200)
(defun draw-character (self x y character) (gp:draw-character self character x y)) (capi:contain (make-instance 'capi:output-pane :title "Press keys in the pane..." :input-model '((:character draw-character))) :best-width 200 :best-height 200)
(capi:contain (make-instance 'capi:output-pane :title "Drag button-1 across this pane:" :input-model '(((:motion :button-1) gp:draw-point))) :best-width 200 :best-height 200)
Generated with Harlequin WebMaker