A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://www.lispworks.com/documentation/lw61/IDE-W/html/ide-w-122.htm below:

6.7 Using graphs in your programs

6.7 Using graphs in your programs All Manuals

>

LispWorks IDE User Guide

>

6 Manipulating Graphs 6.7 Using graphs in your programs

You can read about the CAPI class graph-pane in the CAPI Reference Manual for detailed API information for using graphs in your own programs. We will also look at a short example in this section. The following code listing defines a callback function and creates a graph-pane object:

(defun node-children (node)
  (if (equal node 'pets)
      (list 'dog 'parrot)
    (if (equal node 'dog)
        (list 'Kito 'Otis 'Sammy 'Teddy)
      (if (equal node 'parrot)
          (list 'Brady)))))
 
(setq test-graph
      (capi:contain
       (make-instance 'capi:graph-pane
                      :roots '(pets)
                      :children-function
                      'node-children)
       :best-width 300
       :best-height 400))

The children function node-children should return nil for a leaf node in the graph or a list of child nodes for a non-leaf node. Sample Graph from a User Program shows the generated graph-pane.

Figure 6.12 Sample Graph from a User Program

LispWorks IDE User Guide (Windows version) - 25 Nov 2011


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4