ftp.nice.ch/peanuts/GeneralData/Usenet/news/1990/CSN-90.tar.gz#/comp-sys-next/1990/Jun/Window-as-Outlet

This is Window-as-Outlet in view mode; [Up]


Date: Sun 14-Jun-1990 19:36:39 From: Unknown Subject: Window as Outlet hello, I know that it may seems stupid, but how can i Link a window displayed and defined by IB to an outlet (named windowIB for instance) , ie how to get that window in your code ? my problem is i have defined a specific kind of View, and i would like to "plug" it within that window. how do i have to proceed ? Help very much appreciated Phil >From: pentch@milton.acs.washington.edu (Dean Pentcheff)
Date: Sun 15-Jun-1990 01:55:50 From: Unknown Subject: Re: Window as Outlet This is one of those "Ouch, got ya!" problems-- since you can't instantiate a view w/o actually dragging out a copy in IB, there is no way to make connections to that view from IB. The solution: 1- if at all possible, if the window you want to tie the view to exists in IB, even if you can't make the view have the attributes you want, you can instantiate that way and then in the +newFrame or -appDidInit (application delegate method), adjust the views attributes to what you want... 2- if the window doesn't exist (tieing the view to the appIcon or doing something else goofy on the fly) you can do the following: you will need an object (either subclass of window or just an object that is instantiated) that has an outlet connected to the window so it can send messages to the window. In that objects new method, do the instance variables: id myView; id myWindow; + new { self = [super new]; myView = [SpecialViewClass newFrame:theRect]; /* or new */ return self; } now in appDidInit (so you know the window has been instatiated and can be messed with: -appDidInit { [myWindow addSubView:myView]; /* or something similar, I can't remember the exact call-- I'm doing this off the top of my head. You could also add your view so it is the contentView */ /* do whatever other mods you want in here */ return self; } Hope this helps-- mail if you have any questions. I won't be back online til monday, but will be happy to help more if necessary... using a NeXT keyboard all day?? This message was some serious typing effort, it seems... b.bumgarner | Disclaimer: All opinions expressed are my own. wb1j+@andrew.cmu.edu | I officially don't represent anyone unless I NeXT Campus Consultant | explicity say I am doing so. So there. <Thpppt!> "I ride tandem with the random/Things don't run the way I planned them.." >From: lacsap@media-lab.MEDIA.MIT.EDU (Pascal Chesnais)

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