Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!uunet!dino!ux1.cso.uiuc.edu!olson From: olson@brutus.cs.uiuc.edu (Robert Olson) Newsgroups: comp.sys.next Subject: Re: Interface Builder Message-ID: <1989Nov15.033207.13872@ux1.cso.uiuc.edu> Date: 15 Nov 89 03:32:07 GMT References: <770001@hpvcfs1.HP.COM> <680016@hpcuhc.HP.COM> Sender: news@ux1.cso.uiuc.edu (News) Reply-To: olson@cs.uiuc.edu (Robert Olson) Organization: University of Illinois, Urbana-Champaign Lines: 49 In article <680016@hpcuhc.HP.COM> edwardm@hpcuhc.HP.COM (Edward McClanahan) writes: >Steve Miller writes: > >> However, one concern that I have is when you finally build you interface and >> then you add all of you custom code to do the special things you program is >> ment to do, can you go back to IB and change things without any grief. > >Although I'm not familiar with Prototype, I echo your concern. I asked this >very question at a demo I attended several months ago (given by Bruce Webster). >Unfortunately, the answer is NO (or, was 'no'). Apparently, NeXT sees IB as >a "prototyper" and "initial implementation generator" and NOT as an Interface >Modifier. I don't have any great problem with this under 1.0, although it does take a little hacking. If you have an interface for a class Foo in files Foo.h and Foo.m and you want to add an action newAction: to Foo, add a method declaration - newAction:sender; to Foo.h and a method definition - newAction:sender { return self; } to Foo.m. Save the files, go into InterfaceBuilder, select Foo in the Class browser, and pull the pulldown to Parse. It will tell you that the methods have changed, do you want to do this?? Answer yes. Now if you look at the actions for Foo, you will see newAction: there and you will be able to connect to it. You can do the same with outlets. To add an outlet newOutlet to Foo, add id newOutlet; to the instance variables of Foo in Foo.h and the method - setNewOutlet:anObject { newOutlet = anObject; return self; } to Foo.m and repeat the parsing procedure. I assume you can delete actions and outlets by deleting the appropriate definitions and methods, but I haven't tried it. And of course, if you're not changing any outlets or actions you can fiddle with the rest of the interface to your heart's content without changing your custom code. Bob Bob Olson University of Illinois at Urbana/Champaign Internet: olson@cs.uiuc.edu UUCP: {uunet|convex|pur-ee}!uiucdcs!olson