🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.next.programmer
Article #2277

weirdness: wave's or IB?

#2277
From: Michael B. Johnson
Date: Sun, 10 Jan 1993 23:49
49 lines
2553 bytes
Hi folks.  I would swear this was working a few weeks ago, but now it's not...

I'm writing some IB palettes which contains subclasses of Object, not View.
The objects are actually proxies for other full fledged processes running
on some arbitrary computer on the net.  If you do the obvious thing, i.e.
each time your ObjC object init's it starts up the companion process, you
end up with a bunch of "extra" processes.  For example, when you load your
palette into IB, IB init's each of the objects in your palette.  Then when
you drag an object from your palette into the Files Window, IB inits another
one.  So far, for each object on your palette you've got two processes 
floating out on the net that you don't want.  

You then go in to test mode.  At this point, you do want that process to
start up.  So what to do?

Well, IB is nice enough to declare a bunch of protocols that should help
you.  Jean-Marie has subclassed NXApp for IB and made it respond to a few
new messages.  So, in your init and awake msgs, if you put the following
code:

if ([NXApp resondsTo:@selector(isTestingInterface)])
{  // we're in IB
   if (![NXApp isTestingInterface]}
   {  // building interface, not testing
      return self;
   }
   //we're testing the interface, really exec the process
}
else
{  //we must be in an app (not IB), really exec the process
}

[self initWholeThang];

So, if you have some routine initWholeThang that actually starts up the 
associated process, you should be golden.  Unfortunately, I seem to be
getting NO back from [NXApp isTestingInterface] both when I'm building
the interface (i.e.just frobbing around in IB) and when I'm testing the
interace (command-r).  I would swear this was working fine a few weeks
ago, and I even diff'ed my current code against that version, and nothing
is different in that part.  Any ideas, please...  E-mail, and I'll summarize
if anyone points out my foolishness.  Thanks.


-- 

-->  Michael B. Johnson
-->  MIT Media Lab      --  Computer Graphics & Animation Group
-->  (617) 253-0663     --  wave@media-lab.media.mit.edu
Technical Details
Message-ID: <1993Jan10.234916.10685@news.media.mit.edu>
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!enterpoop.mit.edu!micro-heart-of-gold.mit.edu!news.media.mit.edu!wave

Show Full Headers
Complete Article Headers
Newsgroups: comp.sys.next.programmer
Path: arc1-ca.pugleaf.net!sparky!uunet!stanford.edu!enterpoop.mit.edu!micro-heart-of-gold.mit.edu!news.media.mit.edu!wave
From: wave@media.mit.edu (Michael B. Johnson)
Subject: weirdness: wave's or IB? 
Message-ID: <1993Jan10.234916.10685@news.media.mit.edu>
Sender: news@news.media.mit.edu (USENET News System)
Organization: MIT Media Laboratory
Date: Sun, 10 Jan 1993 23:49:16 GMT
Lines: 49