;;; -*- Mode:gate; Fonts:(CPTFONT); Base:10 -*- =Node: Nodes with Functions =Function: (load "gateway:source;function-demo") =Text: The following two nodes have functions associated with them using the =Function: facility. Any time one uses this facility, it is important to be explicit in naming the package and checking if the function is bound, if any required subsystems are loaded. In order to run these demos, you must first load "gateway:source;function-demo". Conveniently, the function of THIS node is to load that file, so you should click on Execute Function in the Miscellaneous section of the menu, or simply hit Hyper-Super-X. Of course, you only need to do that once for this session. The graphics can be run as many times as you want. The first node just draws random circles on the screen, using a variant of the old DRF code. The second finds an illustration made with an experimental paint facility (sorry, not available in release 3.0) and displays it on the main Gateway screen. =Node: DRF Example =Function: (zwei:DRF) =Text: To run DRF on this screen, click on Execute Function in the Miscellaneous section of the menu, or simply hit Hyper-Super-X The screen should get twenty random circles drawn on it. The code for DRF looks like: (defun DRF (&optional (number-of-circles 20) (window zwei:display-pane-1)) (let* ((w (send window :width)) (h (send window :height)) (a (fix (// (sqrt (* w h)) 4))) ;proportional to window area ) (loop for i from 0 to number-of-circles do (send window :draw-circle (random w) (random h) (random a)) ))) =Node: Picture Example =Function: (zwei:get-gi "gateway:data;amusing-demo-drawing.qfasl") =Text: When you run this function, the illustration is found, either as an already loaded image (see the variable GD:*Gateway-images*) or by searching in the gateway directory for a file of the appropriate type. Once the bit array is located, we BITBLT it to the main gateway screen using the TV:ALU-IOR operation. This overlays the image with the text already printed, which can be useful. When full picture handling capability is developed in future, optional Gateway modules, a wider range of features will be considered. Suggestions are always welcome. =Node: Function Calling Demos =Nodelist: @ Nodes with Functions @ DRF Example @ Picture Example