ftp.nice.ch/pub/next/science/mathematics/workbench/Histogram.s.tar.gz#/Histogram

DataCounter.h
[View DataCounter.h] 
DataCounter.m
[View DataCounter.m] 
English.lproj/
 
Histogram.h
 
Histogram.m
 
Histogram.tiff
 
HistogramInspector.h
[View HistogramInspector.h] 
HistogramInspector.m
[View HistogramInspector.m] 
HistogramInspector.nib/
 
HistogramView.h
[View HistogramView.h] 
HistogramView.m
[View HistogramView.m] 
Makefile
 
PB.gdbinit
 
PB.project
 
README
 
ToolAndInspectorProtocols.h
[View ToolAndInspectorProtocols.h] 
drawHistogram.c
[View drawHistogram.c] 
drawHistogram.h
[View drawHistogram.h] 
drawHistogram.psw
 

README

The Histogram tool gives an example of the inclusion of additional classes in a wbTool bundle and of the use of the outputViewBox in Workbench.

Including additional classes in a tool is just a matter of including them in the project and making sure that the tool class itself is the first class linked into the executable.  This is done by Control-dragging it to the top of the list of classes in ProjectBuilder.  The tool can then load and instantiate these classes in its init method (see Histogram.m).

(The two classes included in the Histogram tool, HistogramView and DataCounter, are general classes for counting data and drawing histograms and bar graphs.  They contain more functionality than the Histogram tool uses.)

The outputViewBox in Workbench is provided to give tools a place in which to draw.  A tool should provide its own subclass of view which will do whatever drawing is needed.  In the tool's evaluate: method, it should send the outputViewBox an insertView: message to put its subclass of View into the box.  It should never send an addSubview: to the outputViewBox.  Since the window and the box are resizable, and the view that will do the drawing will be made resizable when it is inserted into the box, it needs to do its drawing in a way that will resize properly.

These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.