Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!cs.utexas.edu!rice!uw-beaver!Teknowledge.COM!polya!ali From: ali@polya.Stanford.EDU (Ali T. Ozer) Newsgroups: comp.sys.next Subject: Re: Interface Builder Message-ID: <12812@polya.Stanford.EDU> Date: 11 Nov 89 20:31:48 GMT References: <770001@hpvcfs1.HP.COM> Reply-To: ali@Polya.Stanford.EDU (Ali T. Ozer) Organization: . Lines: 46 In article <770001@hpvcfs1.HP.COM> stevem@hpvcfs1.HP.COM (Steve Miller) writes: >I saw a demonstration of the NeXT yesterday and have a couple of questions >on the Interface Builder (IB) ... > ... 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. With >Prototyper, you often have to re-insert your own code after making interface >changes effectively making Prototyper a one way street: once you create an >interface and add your own code, you will probably not use Prototype again >since you've modified the files it created. This is not a problem with Interface Builder; you can go back and change the interface as much as you want even after you've written your code. Interface Builder doesn't generate any code to create the user interface; it simply generates archive files that describe the user interface and the messages to be sent when the various user interface objects (buttons, sliders, etc) are fiddled with. In IB-speak, the messages to be sent by UI objects are known as "actions" and the objects to receive these messages are the "targets." All target-action messages follow the same structure: The only argument passed in the message is a pointer to the UI object sending the message. The target object will ask the sender for more details if it needs to. This makes it very easy to change the interface even after you've created and written all your back-end code. For instance, you can usually replace all your number input boxes with sliders within a matter of seconds and not have to change any code. >Does Interface Builder have similar problems? In some cases, yes, but to a much lesser extent, and not at all when it comes to creating/editing your interface. One case where it does happen is when you describe a new class of your own to Interface Builder through the IB class window. You can make IB generate skeleton interface & implementation files for your class by using the "Unparse" button. However, if you then go ahead and edit these skeleton files, you won't be able to "Unparse" anymore as IB will overwrite any changes. One way to get around this problem is to use the parse feature of IB: IB can read an interface file back in, through the "Parse" button. So you can make your changes to the interface and implementation files and then do a "Parse" to load the new description back into IB. If you follow the same format for describing the various actions and outlets as IB does when it generates the interface files, this will work out fine. Ali