ftp.nice.ch/pub/next/developer/languages/cows/COWS.1.4.s.tar.gz#/COWS/Example Nibs/Example.rtf

This is Example.rtf in view mode; [Download] [Up]

Copyright © 1994 by Sean Luke

Example.nib
COWS Version 1.4
May 20, 1994


The example.nib file shows how you can use the COWS Palettes to work, by doing NeXT's standard Celsius-to-Fahrenheit calculator entirely in COWS and Interface Builder, with no Obj-C code at all.  This nib won't load unless Interface Builder has loaded the COWSPalette and COWS_IBConnectors palette.  To understand what's going on, you need to read up on these palettes, which explain these objects and how they work.

You can make this nib file the main nib file of a little application. If you do this, you can remove the start button entirely.  But so long as you test the nib file in Interface Builder, you need the start button to start up the Controller object (IB doesn't exactly work like an application does, unfortunately).  Also, Interface Builder forgets about parsed objects that cover existing ones.  You'll be less confused if you re-parse the file NewControls.h (in the Palettes directory) after loading this nib file.

The Controller is set to automatically call up an attention panel using the System Library's alert function.  You can remove this from the Controller's inspector window if you're annoyed by it.

So you ask "So what?  This is almost more complex to set up than writing an Objective-C program!"  Well, yes, in this instance.  That's why it's an example.  COWS isn't meant to do this kind of thing (it's really meant to run sophisticated macros), but it's nice to see that it can.  In addition, this allows people with no C development experience to write short programs that do real things, not toy demos in Interface Builder.  Also, it makes for a much much better prototyper than just IB alone.  Also, using COWS, you can change your little program on the fly without having to recompile it.  Lastly, as the COWS team manages to circumvent many roadblocks Interface Builder has put in our way for doing this kind of thing, this file should get simpler and easier to understand, to the point where you can write COWS programs entirely in IB that are simpler and almost as powerful as C programs.

Anyway, it's a nifty demo.  :-)

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