HDTenEightyP/NetNews huggingface dataset:
From: andrew@cubetech.com (Andrew Loewenstern)
Subject: Re: Question about visibility of interface variables
Organization: Cube Technologies, Inc.
Date: Tue, 21 Jul 1992 08:59:52 GMT

In article <20JUL92.11345443@enh.nist.gov> aoml@enh.nist.gov writes:
>I need to have a couple of variables which are specific to the particular nib
>section that is loaded.  (I have several of the same nib files on screen at the
>same time, but each must have its own, discrete data set).  I figure that by
>putting these variables in the @interface section of the header file, they
>will be specific, like I need.  However, a large part of my file consists of
>regular C functions (which run faster, I think, than methods).  When I put the
>variables in the @interface section, my functions can no longer see them.  I
>can see what is going on here, and where my problem is.  Does anyone know of a
>better way of handling this than changing my functions into methods?  Thanks.
>Kevin

Make all of the functions that need to access instance variables into
methods belonging to that class.  Forget functions and let the
Objc-Runtime do the work for you.  Unless you need to call a
function/method more than about 700,000 times in a row as fast as
possible, you won't win anything by using a function, and in that
case, you would still use a method and call methodFor: right before
you call the method 3 million times...

The overhead for a method call isn't a whole lot more than that of a
function (which isn't a whole lot in the first place)...


andrew
-- 
andrew@cubetech.com
Andrew Loewenstern      | "If I am not for myself, who will be for me?
Cube Technologies, Inc. |  If I am only for myself, who am I?" -Hillel
From: hans@dev01 (Hans Peter Geiser)
Newsgroups: comp.sys.next.programmer
Subject: Re: Non-copyable TextField
Date: 31 Jul 92 07:38:29 GMT

> 
>   I'm trying to make a subclass of TextField object that cannot be copied
> with the cut/copy keys or cut/copy menu entries. 

The easiest way to prevent a text of being copied is to send it the message  
[myText setSelectable:NO]. I'm not sure if you have also to sent the  
setEditable:NO message to the text as in IB you cannot make an editable text  
non-selectable.

Hans - Peter Geiser
hans@nextpoint.de
Newsgroups: comp.sys.next.programmer
From: mmelling @Trirex.com(Michael Mellinger)
Subject: Re: Edit for programs and enscripting them
Organization: Trirex Systems Inc.
Date: Thu, 23 Jul 1992 22:42:17 GMT

In article <8JUL199223052305@mpx2.lampf.lanl.gov>  
silbar@mpx2.lampf.lanl.gov (Dick Silbar) writes:
> This must be a solved problem.  I have been writing my ObjC programs
> with the Edit app, with the TabWidth set to 2.  For outputting these
> to the printer, I'd like to use the Enscript submenu item in the
> UserCommands (or whatever it is that is specified by the .commanddict
> file) menu item.  That invokes enscript with the "-2r" option, which
> is nice for saving trees.  What isn't nice is that the enscript tab
> width seems to be 8, which means my nicely indented things then don't
> look so nice, anymore.

Use the Unix "expand" command, and pipe the result to enscript.
For example,

  expand -2 foo.m | enscript -2r -Pmy_favorite_printer

-Mike
Newsgroups: comp.sys.next.programmer
From: gary@niagara.ucs.ualberta.ca (Gary Ritchie)
Subject: Destroying Zones
Organization: University Of Alberta, Edmonton Canada
Date: Mon, 27 Jul 1992 01:04:36 GMT

I'm loading a nib file into its own zone, so that I can later destroy the  
zone and make everything go away.  I'm having a problem because the nib  
file contains Windows, and the program has a segmentation fault shortly  
after the zone is destroyed.

I remember glancing at an article in the spring NeXTworld magazine which  
discussed how to deal with freeing zones which contain Windows, but I  
don't have access to that particular issue anymore.

Could someone give me a quick summary on the steps necessary?

Gary Ritchie
gary@niagara.ucs.ualberta.ca
From: rmyers@dec5200.acs.uci.edu (Richard Myers)
Subject: usleep and efficiency
Newsgroups: comp.sys.next.programmer
Organization: University of California, Irvine
Date: 30 Jul 92 06:20:06 GMT

2 questions
1. Why does a simple usleep(100000); *HANG* my app?
	Background: The program does a DPSTimedEntry.  Do these conflict?
	  also, it only hangs when I have the sound turned on for the app.
	  also, it doesn't COMPLETELY hang.  If I'm running from a shell,
	  I can send a ^C and it'll continue. (Yes, I'm pretty sure it's
	  the usleep from gdb.  No, it's not consistent (takes variable #
	  of usleeps to hang))

2. Is there an EASY way of finding out which way to code a line faster.
eg. should I say if 'fabs(x) > 2' or '(x > 2.0) || (x < -2.0)'?  I'd like
a faster way to test this than doing a full profile run!
[BTW, the second way is faster].

Thanks,
	Kurt
Newsgroups: comp.sys.next.programmer
From: eps@futon.SFSU.EDU (Eric P. Scott)
Subject: Re: NeXT Fax format
Reply-To: eps@cs.sfsu.edu
Organization: San Francisco State University
Date: Tue, 28 Jul 1992 05:33:48 GMT

In article <1992Jul27.233807.22424@novell.com>
	jscherer@novell.com writes:
>Can someone tell me what format a fax is stored in on my NeXT..

Looks like TIFF to me.

					-=EPS=-
-------
% tiffutil -info DemoFax.fax
Directory at 0x8c48
  Subfile Type: multi-page document (2 = 0x2)
  Image Width: 1728 Image Length: 2186
  Resolution: 200, 200
  Resolution Unit: pixels/inch
  Bits/Sample: 1
  Compression Scheme: CCITT Group 3 facsimile encoding
  Photometric Interpretation: "min-is-white"
  Samples/Pixel: 1
  Rows/Strip: 1
  Number of Strips: 2186
  Planar Configuration: Not planar
  Group 3 Options: EOL padding (4 = 0x4)
  Page Number: 0-1
% tiffutil -dump DemoFax.fax
Magic: 0x4d4d <big-endian> Version: 0x2a
Directory 0: offset 35912 (0x8c48)
SubFileType (254) LONG (4) 1<2>
ImageWidth (256) SHORT (3) 1<1728>
ImageLength (257) SHORT (3) 1<2186>
BitsPerSample (258) SHORT (3) 1<1>
Compression (259) SHORT (3) 1<3>
Photometric (262) SHORT (3) 1<0>
StripOffsets (273) LONG (4) 2186<8 14 18 26 37 47 58 110 171 230 290 355 418...
SamplesPerPixel (277) SHORT (3) 1<1>
RowsPerStrip (278) LONG (4) 1<1>
StripByteCounts (279) LONG (4) 2186<6 4 8 11 10 11 52 61 59 60 65 63 62 60 5...
XResolution (282) RATIONAL (5) 1<200>
YResolution (283) RATIONAL (5) 1<200>
PlanarConfig (284) SHORT (3) 1<1>
Group3Options (292) LONG (4) 1<4>
ResolutionUnit (296) SHORT (3) 1<2>
PageNumber (297) SHORT (3) 2<1 0>
From: bhead@hfs.questor.wimsey.bc.ca (Bradley Head)
Newsgroups: comp.sys.next.programmer
Subject: strlen() memory exception in Speaker/Listener - NeXT's doing
Date: Fri, 24 Jul 1992 15:06:03 GMT
Reply-To: bhead@hfs.questor.wimsey.bc.ca (Bradley Head)
Organization: Headfirst Software, Vancouver, BC, Canada



When I specify a parameter type of (char *) in  a msgwrap file, then 
proceed to use the speaker message passing a NULL pointer, the speaker 
sending mechanism produces an exception inside strlen(). Why didn't NeXT  
check for NULL prior to calling strlen(). Now I have to, and it makes the 
interface less than seamless. In University, when writing published
functions, I was taught to check input parameters (especially pointers) 
prior to using them.  strlen() doesn't check for a NULL string pointer  
before dereferencing it (which is why I wrote my own strlen()), neither  
does NeXT before using it inside Speaker/Listener. Now I have to throw in 
the check prior to the call. This wouldn't bother me so much if NeXT would 
DOCUMENT such a side affect.

...Brad
-- 
Bradley Head, bhead@hfs.questor.wimsey.bc.ca (NeXTmail :-)
InStep Mobile Communications Inc., Vancouver, BC CANADA
Newsgroups: comp.sys.next.programmer
From: burchard@horizon.math.utah.edu (Paul Burchard)
Subject: implementing "tools"---performv:: selector switcharoo?
Organization: University of Utah Computer Center
Date: Tue, 21 Jul 92 23:16:30 GMT

I'm making an abstract superclass whose subclasses will want to define a  
variety of processing "tools".  Each of the tools is a method; the methods have  
different names but identical declarations in terms of arg and return types.   
The superclass will ask the subclass what tool to use when, and then apply that  
tool in its operations.  If all the args were id's this would be trivial to  
implement, using Object's "perform" methods, but that's not possible in my  
situation.

It looks like the way to do it is to forward:: an unimplemented generic tool  
message from the object to itself, BUT to slip in the correct specific selector  
like this:

	- forward:(SEL)aSelector :(marg_list)argFrame
	{
	    SEL tool = [self toolForMode:mode]; // subclass method
	    if(aSelector == @selector(genericTool:::)) // unimplemented
		return [self performv:tool :argFrame];
	    return [self doesNotRecognize:aSelector];
	}

Now it is completely clear from the docs that you can performv:: the exact  
selector and arg frame passed to forward::, but it is not clear whether it is  
kosher to substitute selectors.  The forward:: docs offer the following vague  
encouragement:
	An implementation of the forward:: method can do more than just forward 
	messages.  It can, for example, locate code that responds to a variety 
	of different messages, thus avoiding the necessity of having to write a 
	separate method for each selector.

So am I asking for trouble?  This will probably work for now, but is it  
"cheating"?
--
--------------------------------------------------------------------
Paul Burchard	<burchard@math.utah.edu>
``I'm still learning how to count backwards from infinity...''
--------------------------------------------------------------------
From: bill@epnxt.jsc.nasa.gov
Newsgroups: comp.sys.next.programmer
Subject: Is there a docView method in the View Class?
Date: 22 Jul 1992 20:29:25 GMT
Reply-To: bill@epnxt.jsc.nasa.gov
Organization: nasa-jsc

Would someone please explain what the docView method really does?  

I was browsing through the Spectro program (availble on the archives) and  
noticed that the author has the following:

mySound = [[soundView docView] sound];

were soundView is a connection from the Files Owner to a view call  
Scrolling Sound.  This view is a subclass of View (not ScrollView).   
Looking up the info on View, I could not find a docView method.  I did  
find one in ScrollView.  I am also trying to figure out if sound is a  
sound file and what docView has to do with it.  I did not see any function  
called sound.

Thanks in advance.  

				Bill
From: pgraff@next.com (Peter Graffagnino)
Newsgroups: comp.sys.next.programmer
Subject: Re: Obscure DPS messages
Date: 22 Jul 92 20:57:22 GMT

In article <1992Jul22.075638.27238@csus.edu> eps@futon.SFSU.EDU (Eric P.  
Scott) writes:
> In article <1992Jul21.231505.7669@u.washington.edu>
> 	zeno@hardy.u.washington.edu (Sean T. Lamont) writes:
> >Does anyone know what this means?
> >
> >DPS client library error: PostScript program error, DPSContext 90128
> >%%[ Error: undefinedresult; OffendingCommand: bin obj seq, type=128,  
elements=2, size=20 ]%%
> 
> undefinedresult usually means something like division by zero.

This error can also signify that you are passing `NaN' as a floating point  
value into a pswrap.  This can occur if you have uninitialized automatic  
float variable in C that is getting passed into a wrap.

Peter
From: jesperse@nas.nasa.gov (Dennis Jespersen)
Newsgroups: comp.sys.next.programmer
Subject: cannot send iconReleasedAt message: why?
Date: 28 Jul 92 20:04:27 GMT
Organization: Computational Fluid Dynamics Branch, NASA Ames Research Center


I have been putting drag and drop capability into a program, following
along the lines of the Acceptor example and the ImageText
mini-example.  I added the methods
 iconEntered:at::iconWindow:iconX:iconY:iconWidth:iconHeight:pathList:
 iconExitedAt::
 iconReleasedAt::ok:
to my application's delegate.  Things usually work well, but sometimes
the machine hangs for a while, then returns and there is a message in
the console log: 
   cannot send iconReleasedAt message (errno=-203)
Is this from the Workspace Manager?  What could be causing it?  There
is no repeatable sequence I can go through to cause this to happen.

I am running OS 2.1, Workspace Version 218, PostScript Version 2.1.55.4.
--
Dennis Jespersen                Voice: (415) 604-6742                      
MS 202A-1		        FAX:   (415) 604-1095                      
NASA Ames Research Center       email: jesperse@rft28.nas.nasa.gov         
Moffett Field, CA 94035-1000    We have met the enemy and he is us. -- Pogo
Newsgroups: comp.sys.next.programmer
From: andrew@cubetech.com (Andrew Loewenstern)
Subject: Re: NXSplitView with VERTICAL bar
Organization: Cube Technologies, Inc.
Distribution: world,local
Date: Sun, 26 Jul 1992 13:28:12 GMT

In article <1992Jul23.181444.3535@arizona.edu> zazula@pri.com writes:
>In article <1992Jul22.172001.515@swabsib.stgt.sub.org>  writes:
>> Hi,
>> 
>> I want to rotate a NXSplitView like in the NewsGrazer, so that I can devide 
>> two subviews with a VERTICAL bar. 
>
>Hi -
>
>MiniExamples to the rescue, again (se Re: NXBrowser Class Help!).
>
>Check out the ZooView MiniExample.  In particular, the "SideSplitView" class.


Anyone figure out why SideSplitView is so slow compared to SplitView?
I looked at the code for a few minutes once but didn't see anything
bad...


andrew
-- 
andrew@cubetech.com
Andrew Loewenstern      | "If I am not for myself, who will be for me?
Cube Technologies, Inc. |  If I am only for myself, who am I?" -Hillel
From: lele@itnsg1.cineca.it (Lele Gaifax)
Newsgroups: comp.sys.next.programmer
Subject: Programmatically change a TextField under editing
Date: 23 Jul 92 11:47:09 GMT
Organization: Laboratorio di Fisica Computazionale, INFM. Trento Italia

I'm trying to change a TextField' content while the user is editing it.
I replaced the TextFilterFunc for that TextField, and I want to do some
fancy replacement to the text when the user press some keys. 

My textFilterFunc prototype is
char * textFilterFunc (id textObj, char * inputText, int * inputLength,
		       int position);

I tried to do a "[[textObj setSel:startPos :endPos] replaceSel:replacement]"
where of course startPos and endPos are integer position *inside* the text,
and replacement is a string computed from the previous content.

What I see on the screen is the field get blanked... or something very similar.

I also tried using [textObj superview] and the setStringValue: on that
TextField id, but the same happened.

How can I obtain the result I want? In few word, what I like to see is that
whenever the user types BACKSPACE, the current character will be replaced by
a blank, instead of getting deleted.

thanx a lot for any hints ...and forgive my poor english ;-)
lele.
-- 
Lele Gaifax - lele@itnsg1.cineca.it
Sicuramente i cattivi hanno scoperto qualche cosa che i buoni ignorano.
						- Woody Allen
From: cc100aa@xray.gatech.edu (Ray Spalding)
Newsgroups: comp.sys.next.programmer
Subject: Re: ScollView Strangesness ?
Keywords: what is going wrong ?
Date: 27 Jul 92 21:47:15 GMT
Organization: Georgia Institute of Technology

In article <151l40INNn1m@agate.berkeley.edu> william@moica.berkeley.edu (William E. Grosso) writes:
>I have a strange prboblem with a ScrollView. It seems to 
>lose branches of the view hierarchy when scrolling 
>(e.g. a subview and all it's descendants will occasionally
>just diappear). Sometimes they reappear if I continue scrolling.
>
>Has this happened to anybody else before ? Any clues as to what
>is going wrong ?

Yes, this has happened to me.

When you scroll in a piece of a view, drawSelf:: normally is sent
only to the subviews that intersect the newly exposed portion.  If
you have overlapping views, like some shapes (each in a subview)
on a larger background subview, your background will sometimes get
drawSelf:: whereas not necessarily all your shapes will.  The drawing
of the background may then overlay some or all of the shapes.

One way to fix this is to set the proper clipping path before
displaying your background view.  Something like:

- drawSelf:(const NXRect *)rects :(int)rectCount
{
        if (rectCount == 1) NXRectClip(rects);
        else NXRectClipList(rects+1,2);

-- 
Ray Spalding, Office of Information Technology
Georgia Institute of Technology, Atlanta Georgia, 30332-0715
Internet: ray.spalding@oit.gatech.edu (NeXT Mail accepted)
From: bobb@agora.rain.com (Bob Beauchemin)
Newsgroups: comp.sys.next.programmer
Subject: Non-copyable TextField
Date: 29 Jul 92 16:24:37 GMT
Article-I.D.: agora.1992Jul29.162437.3218
Organization: Open Communications Forum


  I'm trying to make a subclass of TextField object that cannot be copied
with the cut/copy keys or cut/copy menu entries. I made a subclass called
XTextField and set it up with a "empty" copy method (ie a copy method that
does nothing but printf("copy method invoked").
  However, I can still copy the text and my custom copy method does not
ever appear to get invoked during the COPY operation.

  I've read that all TextField objects share the same Text object for
rendering text. Can I override the COPY method in this Text object somehow?
Is this why my subclass of TextField with a custom COPY method will not
work?

  Does anyone have/know of any examples of a TextField (or Text) subclass
that cannot be copied?

  Thanks,

Bob Beauchemin
bobb@agora.rain.com
From: kjartan@ecu.unice.fr (Kjartan Pierre Emilsson)
Newsgroups: comp.sys.next.programmer
Subject: Re: Destroying Zones
Keywords: zones,dynamic loading
Date: 28 Jul 92 12:36:12 GMT
Reply-To: kjartan@ecu.unice.fr
Organization: University of Nice Sophia-Antipolis, France

This talk about destroying zones to get rid of objects, reminds me of a  
strange bug I have encountered recently:

I have a program, which dynamically loads modules, with their own nib and  
objects.  I created a zone for the File's owner object, which eventually  
loaded the nib file into that zone.  Each time I loaded a new module, I  
unloaded the previous module and destroyed its zone to get rid of  
everything.  In addition to that, I did not use the modules' window, but  
stealed its view hierarchy which I then added as a content view of the  
main program window.  This worked fine, until I put a ColorWell in one of  
my modules.  What happened then, was that the ColorWell behaved correctly  
the first time the module was loaded, but if I loaded it later and  
activated the Well, the program crashed.
The only way I could make it work was to put one ColorWell in the main  
window, such that that class would always be loaded.  I don't know the  
real reason for this bug, but I guess that once you pop up a color panel  
using the ColorWell, the panel must somehow remember who popped him up, so  
if you then destroy the module and the ColorWell with it, the next time  
you try to popup the Color Panel, it tries to send a message to its  
previous Well.  Does anybody have clues to this problem ?  Are there other  
objects with the same behaviour ?  What is the criterion which determines  
whether an object will not support a zone destroy ?

-Kjartan

PS.:  How does one build a shared library with some custom classes, say  
for example a library corresponding to a user defined palette ?
--
Kjartan Pierre Emilsson			e-mail: kjartan@ecu.unice.fr
Non-Linear Institute of Nice		tel.: 93 52 98 36
Universite de Nice - Sophia Antipolis	fax: 93 52 98 48
Parc Valrose
Nice, FRANCE
Newsgroups: comp.sys.next.programmer
From: chris@ao_next2.psych.th-darmstadt.de (Christoph Ruhbach)
Subject: Help for Postscript error
Date: Wed, 29 Jul 1992 19:36:19 GMT
Organization: TH Darmstadt

Hi,
(first, warning and sorry for my bad english, i cant it better, but i come  
still this year to USA to take a language course )

i try to implement a little graphic program similar the draw program. The  
graphic objects are drawing with 

lockFocus - draw - unlockFocus  to an offscreen window
then i composite the objects to my view.

its no problem, but after 5 - 15 drawings i see the following error  
message on my shell:

DPS client library error: PostScript program error, DPSContext 92128
%%[ Error: limitcheck; OffendingCommand: gsave ]%%

i ask me: what is the error, i dont use gsave...i use only lockFocus
and now i ask you : can you help me ?

thank you very very much for your help

Bye    chris

===========================================================
Christoph Ruhbach          Technical University of Darmstadt
Fachbereich 3 Psychologie  Hochschulstr.1
                           6100 Darmstadt
                           GERMANY
E-Mail: chris@ao_next1.psych.th-darmstadt.de
===========================================================
From: phayes@magnus.acs.ohio-state.edu (Patrick W Hayes)
Newsgroups: comp.sys.next.programmer
Subject: Re: Problems implementing services and new problem
Date: 29 Jul 92 20:50:38 GMT
Organization: The Ohio State University


	A potential problem could be that you changed your program while
it was in the Apps directory.  I have noticed that the Workspace Manager caches
the services you provide so it doesn't have to check every time you log in.  So
to provide new or different services I now remove my program from the Apps 
directory, log out, log in, install it again, log out, and log in again.  It 
took me about six hours to figure that one out.
	My problem is with dynamic services.  I create the file in
 ~/.NeXT/services with my program name and same format as the one that I 
compile with, call NXUpdateDynamicServices() and I don't see my new services.
I'm already the servicesDelegate, so that isn't it.  I even noticed that a new
service from Digital Librarian won't appear in Edit's Services menu until you
quit and restart and open a document, but my own still does not show up.  Any
help greatly appreciated. 
Newsgroups: comp.sys.next.programmer
From: edlau@mitl.com (Ed Lau)
Subject: problem with Malloc Debug
Organization: Matsushita Information Technology Laboratory
Distribution: na
Date: Fri, 24 Jul 1992 17:37:54 GMT


Does anyone have insights as to why Malloc Debug won't recognize my  
application? Selecting Open... in the menu pops up a panel informing me that I  
do not own any "application configured for use with the Malloc Debugger." Yet I  
have linked my application with the proper library by adding  
/usr/lib/libMallocDebug.a to "Other libs" in IB as instructed in the Help  
Panel.

Any help is appreciated. Thank you.

Ed Lau
edlau@chaos.mitl.com
Newsgroups: comp.sys.next.programmer
Subject: NXBrowser problem.
From: scott@nic.gac.edu (Scott Hess)
Date: 23 Jul 92 00:49:39
Distribution: world
Organization: Gustavus Adolphus College

I've a situation where I need the action method for an NXBrowser
to modify the values in the browser.  Unfortunately, I've been
having some problems.  [This is under NS2.1.]

An obvious incantation to reload the browser would be to incant
[browser loadColumnZero].  _But_, there's a problem here.  The
action method will have been called from a Matrix in the browser
- and loadColumnZero frees all of the columns and then recreates
them!  So, when you return from the action method after doing a
loadColumnZero, your program crashes (because the Matrix id was
moved out from under the Matrix mouseDown: routine).

OK, another option is to do [browser reloadColumn:0].  This _works_,
but not all that well.  What happens is that I get the output:

Assertion failed: You removed a View from the View hierarchy that
had been lockFocus'ed

which isn't quite what I wanted, either.  The solution that I've
used is to schedule a delayed method invocation via
perform:with:afterDelay:cancelPrevious:.  This works, but does have
other drawbacks.  Anyone have a better idea?

Thanks,
--
scott hess <shess@ssesco.com>  <Who's now in a programming Berserker-frenzy>
12901 Upton Avenue South, #326  Burnsville, MN 55337 (612) 895-1208 Anytime!
<I want to become so famous that people buy tapes of me reading source code>
Newsgroups: comp.sys.next.programmer