From: pottier@clipper.ens.fr (Francois Pottier)
Subject: csmp-digest-v3-011
Date: Sat, 9 Apr 94 11:03:42 MET DST

C.S.M.P. Digest             Sat, 09 Apr 94       Volume 3 : Issue 11
 
Today's Topics:
 
        AddResource() to self?
        Changing font when using PopupMenuSelect () Q!
        Converting C String to Str255?
        How to keep screen savers from activating?
        How to save a PICT?
        INIT: displaying a dialog
        LabView programming group?
        Proper way to dim screen
        Think Pascal tools for tracking down memory problems
        WorldScript compatible Text Editors



The Comp.Sys.Mac.Programmer Digest is moderated by Francois Pottier
(pottier@clipper.ens.fr).
 
The digest is a collection of article threads from the internet newsgroup
comp.sys.mac.programmer.  It is designed for people who read c.s.m.p. semi-
regularly and want an archive of the discussions.  If you don't know what a
newsgroup is, you probably don't have access to it.  Ask your systems
administrator(s) for details.  If you don't have access to news, you may
still be able to post messages to the group by using a mail server like
anon.penet.fi (mail help@anon.penet.fi for more information).
 
Each issue of the digest contains one or more sets of articles (called
threads), with each set corresponding to a 'discussion' of a particular
subject.  The articles are not edited; all articles included in this digest
are in their original posted form (as received by our news server at
nef.ens.fr).  Article threads are not added to the digest until the last
article added to the thread is at least two weeks old (this is to ensure that
the thread is dead before adding it to the digest).  Article threads that
consist of only one message are generally not included in the digest.

The digest is officially distributed by two means, by email and ftp.

If you want to receive the digest by mail, send email to listserv@ens.fr
with no subject and one of the following commands as body:
    help		                Sends you a summary of commands
    subscribe csmp-digest Your Name	Adds you to the mailing list
    signoff csmp-digest			Removes you from the list
Once you have subscribed, you will automatically receive each new
issue as it is created.

The official ftp info is //ftp.dartmouth.edu/pub/csmp-digest.
Questions related to the ftp site should be directed to
scott.silver@dartmouth.edu. Currently no previous volumes of the CSMP
digest are available there.

Also, the digests are available to WAIS users as comp.sys.mac.programmer.src.


-------------------------------------------------------

>From smoke@well.sf.ca.us (Nicholas Jackiw)
Subject: AddResource() to self?
Date: 24 Mar 1994 21:57:56 GMT
Organization: The Whole Earth 'Lectronic Link, Sausalito, CA


Hi Netters,

I'm required to add one of those annoying "Enter your name
and organization" splash pages (but at least I talked "them"
out of copy protection!).  I figured that the way these
were implemented was to add a resource directly to the
application. I know that in general, one shouldn't write
back to the application, because it may be locked, or
simultaneously in use, or what have you. On the other hand,
in this scheme, the application isn't legitimate until
this owner/organization resource has been written (once),
at which point the application will never "touch itself"
again.

So I put together a simple scheme:

a) Get user info, put it in a Handle
b) AddResource
c) ChangedResource
d) WriteResource

Works fine under THINK Pascal, where the resource file is
physically separate from the application code (which is
run from within the THINK Pascal application). But when
I build it into an application, AddResource fails with
-61/Write Premissions Error.

Why is this? I could see WriteResource failing, if the
app were on a locked disk, or there wasn't enough disk
space, but I thought AddResource() just modified the
in-memory resource map. How and why is this map being
declared read-only? And more to the point: how can I
add a resource to my own application?  [Sticking the
info into a Prefs file makes no sense; the whole point
is to keep the information with the application when
it moves between machines.]

Thanks for any tips you can give me. I suspect I'm
overlooking something obvious.

Cheers,
Nick

-- 
                              --- * ---
Nick Jackiw                  Smoke@well.sf.ca.us   | Jackiw@cs.swarthmore.edu
Key Curriculum Press, Inc.   Applelink:KEY.EDUSOFT | (510) 548-2304
                              --- * ---

+++++++++++++++++++++++++++

>From mxmora@unix.sri.com (Matt Mora)
Date: 24 Mar 1994 15:29:52 -0800
Organization: SRI International, Menlo Park, CA

In article <2mt2d4$h12@nkosi.well.com> smoke@well.sf.ca.us (Nicholas Jackiw) writes:
>
>Hi Netters,

Hi. Long time no post. Are you working in the real world now? :-)


>I'm required to add one of those annoying "Enter your name
>and organization" splash pages (but at least I talked "them"
>out of copy protection!).  I figured that the way these
>were implemented was to add a resource directly to the
>application. I know that in general, one shouldn't write
>back to the application, because it may be locked, or

As long as you are doing this during the installation process
then you know you have write permission. 

>
>So I put together a simple scheme:
>
>a) Get user info, put it in a Handle
>b) AddResource
>c) ChangedResource
>d) WriteResource

I don't know what could be wrong. Maybe your system is corrupt.

I ran this program and it worked fine in both cases. (From TP and
from the built application.


program Test;

  type

    PersonalInfoRec = record
        name: Str32;
        address: Str32;
        Phone: Str32;
      end;

  var
    pref: PersonalInfoRec;
    h: Handle;
begin

  pref.name := 'Matthew Mora';
  pref.address := '123 nowhereville';
  pref.phone := '765-4321';
  h := NewHandle(sizeof(PersonalInfoRec));
  if h <> nil then
    begin
      BlockMove(@pref, h^, sizeof(PersonalInfoRec));
      AddResource(h, 'PREF', 128, 'Prefs');
      ChangedResource(h);
      WriteResource(h);
      UpdateResFile(CurResFile);
      ReleaseResource(h);
    end;

end.


Xavier

-- 
___________________________________________________________
Matthew Xavier Mora                       Matt_Mora@sri.com
SRI International                       mxmora@unix.sri.com
333 Ravenswood Ave                    Menlo Park, CA. 94025

+++++++++++++++++++++++++++

>From d88-jwa@mumrik.nada.kth.se (Jon Wätte)
Date: 25 Mar 1994 08:28:32 GMT
Organization: The Royal Institute of Technology

In <2mt2d4$h12@nkosi.well.com> smoke@well.sf.ca.us (Nicholas Jackiw) writes:

>I'm required to add one of those annoying "Enter your name
>and organization" splash pages (but at least I talked "them"

Don't forget the validated serial number!

>were implemented was to add a resource directly to the
>application. I know that in general, one shouldn't write

Not good, since the user may run the app from a locked server
or CD-ROM or... and the application would always work, albeit
with a "known" name or number, if you copied it elsewhere.

Instead, put the pertinent info in a file in the preferences
folder. The app is always legitimate until it's moved to a
new CPU, or the system is re-installed from scratch.

ON THE OTHER HAND - adding a resource to yourself and staying
valid across crashes/backups is a good thing as well. If you're
worried about copying, though, you have to go the prefs file
route.

-- 
 -- Jon W{tte, h+@nada.kth.se, Mac Hacker Deluxe --

    CORRECTLY in this case meaning to the language spec, not to the
    naive expectations of the programmer.

---------------------------

>From rudolph@unixg.ubc.ca (Christopher E Rudolph)
Subject: Changing font when using PopupMenuSelect () Q!
Date: 25 Mar 94 05:09:43 GMT
Organization: The University of British Columbia

Hello,

I am using PopupMenuSelect (..) to display popup menus in an application. 
However the font is always in the System font regardless of what I try. 
Do I need to define a MDEF just to have a different font (geneva, 9) in my
popup menu or is there something I am missing.

thanx,

Chris Rudolph <rudolph@unixg.ubc.ca>
- ----------------------------------


+++++++++++++++++++++++++++

>From first.ascent@mindlink.bc.ca (Alex Curylo)
Date: 25 Mar 94 19:43:08 GMT
Organization: MIND LINK! - British Columbia, Canada

>I am using PopupMenuSelect (..) to display popup menus in an application.
However the font is always in the System font regardless of what I try.

The easiest way I know to work around this is to make your popup into a
popup menu control, and define the control procedure as popupMenuProc
(1008) + useWFont (2? 1? 4?). This is how all those 9-point popups in CTB
tool config dialogs are done.

---------------------------

>From danny@utkux.utcc.utk.edu (Danny W. McCampbell)
Subject: Converting C String to Str255?
Date: Fri, 18 Mar 1994 15:18:35 GMT
Organization: University of Tennessee

Hi all.  I am using straight C string manipulations
and want to convert a C string to a Str255 to pass
it through ParamText.  It is this easy to do? Please
help.  

Thanks in advance.

Danny W. McCampbell
danny@utkux.utcc.utk.edu

+++++++++++++++++++++++++++

>From Carl R. Osterwald <carl_osterwald@nrel.gov>
Date: Fri, 18 Mar 94 18:40:18 GMT
Organization: National Renewable Energy Laboratory

In article <danny.1114391555B@martha.utcc.utk.edu> Danny W. McCampbell,
danny@utkux.utcc.utk.edu writes:
>Hi all.  I am using straight C string manipulations
>and want to convert a C string to a Str255 to pass
>it through ParamText.  It is this easy to do? Please
>help.  

Try using c2pstr.

+++++++++++++++++++++++++++

>From rondavis@datawatch.com (Ron Davis)
Date: Fri, 18 Mar 1994 19:40:21 GMT
Organization: Datawatch

In article <danny.1114391555B@martha.utcc.utk.edu>,
danny@utkux.utcc.utk.edu (Danny W. McCampbell) wrote:

> Hi all.  I am using straight C string manipulations
> and want to convert a C string to a Str255 to pass
> it through ParamText.  It is this easy to do? Please
> help.  
> 
> Thanks in advance.
> 
> Danny W. McCampbell
> danny@utkux.utcc.utk.edu

    Most environments have procedures for doing this both ways.  In Think 
	   its CtoPstr((char*)string).  There's also c2pstr() that I use in
Codewarrior
	   but I believe it also work in Think.

__________________________________________________________________________
"I want to know God's thoughts...the rest are details."
                                           -- Albert Einstein
_________________________________________
Ron Davis                                  rondavis@datawatch.com       
Datawatch, Research Triangle Park, NC      (919)549-0711

The opions expressed are mine, not Datawatch's

+++++++++++++++++++++++++++

>From bsc@oui.com (Bill Stewart-Cole)
Date: 18 Mar 1994 20:30:06 -0600
Organization: Odyssey Ultraware Inc
St Louis, MO

Since you obviously are using a Mac, you are fairly likely to be using Think C
or Symantec C++. Both include the simple ctopstr() and ptocstr() functions,
which convert in place and take a string as a parameter. 

+++++++++++++++++++++++++++

>From kenlong@netcom.com (Ken Long)
Date: Mon, 21 Mar 1994 03:46:42 GMT
Organization: NETCOM On-line Communication Services (408 241-9760 guest)

Bill Stewart-Cole (bsc@oui.com) wrote:
: Since you obviously are using a Mac, you are fairly likely to be using Think C
: or Symantec C++. Both include the simple ctopstr() and ptocstr() functions,
: which convert in place and take a string as a parameter. 

And they are both in the Pascal.h header file.  I ran into some old 
source calls to "ptoc" or "ctop" which are not current.  Changing to the 
current calls ran fine.

-Ken-

+++++++++++++++++++++++++++

>From Bill McCloskey <billm@interaccess.com>
Date: 21 Mar 1994 03:05:03 GMT
Organization: ???

In article <danny.1114391555B@martha.utcc.utk.edu> Danny W. McCampbell,
danny@utkux.utcc.utk.edu writes:
>Hi all.  I am using straight C string manipulations
>and want to convert a C string to a Str255 to pass
>it through ParamText.  It is this easy to do? Please
>help.  

I usually do:
BlockMove( theCStr, thePStr+1, strlen( theCStr ) );
thePStr[0] = strlen( theCStr );

+++++++++++++++++++++++++++

>From michaelp@calvin.usc.edu (Michael Peterson)
Date: 22 Mar 1994 20:18:35 -0800
Organization: University of Southern California, Los Angeles, CA

Bill McCloskey <billm@interaccess.com> writes:

>In article <danny.1114391555B@martha.utcc.utk.edu> Danny W. McCampbell,
>danny@utkux.utcc.utk.edu writes:
>>Hi all.  I am using straight C string manipulations
>>and want to convert a C string to a Str255 to pass
>>it through ParamText.  It is this easy to do? Please
>>help.  

>I usually do:
>BlockMove( theCStr, thePStr+1, strlen( theCStr ) );
>thePStr[0] = strlen( theCStr );

Have you tried c2pstr, or mabye this only exists in MPW?

Michael Peterson

+++++++++++++++++++++++++++

>From Bill McCloskey <billm@interaccess.com>
Date: 25 Mar 1994 23:32:29 GMT
Organization: ???

In article <2mofur$aeu@calvin.usc.edu> Michael Peterson,
michaelp@calvin.usc.edu writes:
>>I usually do:
>>BlockMove( theCStr, thePStr+1, strlen( theCStr ) );
>>thePStr[0] = strlen( theCStr );
>
>Have you tried c2pstr, or mabye this only exists in MPW?

Usually the reason I do this is because you have two variables: a C and a
Pascal
string. On the version of c2pstr I found, you give it the C string, it
converts
it, and then you still have a C string, but containing Pascal data. Then
you have
to do some casting and stuff and I end up just copying it into a Pascal
string
anyway.

---------------------------

>From neath@brazil.psych.purdue.edu (Ian Neath)
Subject: How to keep screen savers from activating?
Date: Tue, 22 Mar 1994 14:00:17 GMT
Organization: Purdue University

First, thanks to the many people who've posted/emailed answers
previously.

I have a simulation program that keeps updating the screen each
cycle.  The problem is that many screen savers (e.g., Darkside)
kick in.  How do these screen savers decide when to save a screen
and how do I make my app tell these screen savers not too?

Thanks again.

--
      Ian Neath        | There are four kinds of people in this world:
neath@psych.purdue.edu | cretins, fools, morons and lunatics - U. Eco

+++++++++++++++++++++++++++

>From giles@med.cornell.edu (Aaron Giles)
Date: Tue, 22 Mar 1994 11:03:53 -0500
Organization: Cornell University Medical College

In article <Cn2K8I.rxu@mozo.cc.purdue.edu>, neath@brazil.psych.purdue.edu
(Ian Neath) wrote:

> I have a simulation program that keeps updating the screen each
> cycle.  The problem is that many screen savers (e.g., Darkside)
> kick in.  How do these screen savers decide when to save a screen
> and how do I make my app tell these screen savers not too?

I've had some (limited) success with posting key down events periodically.
 Like most solutions to this problem, this one has certain idiosyncracies.
 For instance, I got email from one person who said that there was a quiet
rhythmic tapping noise in the background -- turns out he had some
extension which make audible key clicks whenever he typed!

Anyone have a better solution? :-)
-- 
Aaron Giles
Macintosh & Newton Developer
Cornell University Medical College
giles@med.cornell.edu

+++++++++++++++++++++++++++

>From lowry@shiva.eche.ualberta.ca (Brian Lowry)
Date: 22 Mar 1994 22:46:27 GMT
Organization: Chem Eng - Univ of Alberta

In article <giles-220394110353@140.251.160.160>, giles@med.cornell.edu
(Aaron Giles) wrote:

> In article <Cn2K8I.rxu@mozo.cc.purdue.edu>, neath@brazil.psych.purdue.edu
> (Ian Neath) wrote:

> > I have a simulation program that keeps updating the screen each
> > cycle.  The problem is that many screen savers (e.g., Darkside)
> > kick in.  How do these screen savers decide when to save a screen
> > and how do I make my app tell these screen savers not too?

> I've had some (limited) success with posting key down events periodically.
>  Like most solutions to this problem, this one has certain idiosyncracies.
>  For instance, I got email from one person who said that there was a quiet
> rhythmic tapping noise in the background -- turns out he had some
> extension which make audible key clicks whenever he typed!

> Anyone have a better solution? :-)

  Look, either your application saves its graphics offscreen (like it's
supposed to), or it's simply incompatible with screen savers (or anything
else that can come in front of it.  What do you do when your application is
moved to the background or hidden?  Well, do the same thing when you
receive ANY redraw event, and, screen saver or not, your app will work
fine.  By the way, if the user didn't want their screen saver to go on,
then they'd turn it off or lengthen the time before activation...

-- 

Brian Lowry

+++++++++++++++++++++++++++

>From deweeset@ptolemy2.rdrc.rpi.edu (Thomas E. DeWeese)
Date: 22 Mar 1994 20:20:34 GMT
Organization: Rensselaer Polytechnic Institute, Troy NY, USA

In article <giles-220394110353@140.251.160.160>,
Aaron Giles <giles@med.cornell.edu> wrote:
>In article <Cn2K8I.rxu@mozo.cc.purdue.edu>, neath@brazil.psych.purdue.edu
>(Ian Neath) wrote:
>> kick in.  How do these screen savers decide when to save a screen
>> and how do I make my app tell these screen savers not too?
>
>I've had some (limited) success with posting key down events periodically.

>Anyone have a better solution? :-)
>Aaron Giles

	I don't know if it's better, but you could 'wiggle' the mouse
for the user, just one pixel back an forth, every minute or so.  You'd
have to experiment a little since some screen savers might have a min
that they consider a move.  It is concievable that people might notice
this and get upset, but I bet the mouse moves one pixel all the time
from tapping the table, or shifting your arms, and no one notices.
-- 
							Thomas DeWeese
deweeset@rdrc.rpi.edu     
			"The only difference between theory and practice is
			 that in theory there isn't any." -- unknown

+++++++++++++++++++++++++++

>From rang@winternet.mpls.mn.us (Anton Rang)
Date: 23 Mar 1994 00:30:32 GMT
Organization: Minnesota Angsters

In article <giles-220394110353@140.251.160.160> giles@med.cornell.edu (Aaron Giles) writes:
>In article <Cn2K8I.rxu@mozo.cc.purdue.edu>, neath@brazil.psych.purdue.edu
>(Ian Neath) wrote:
>
>> The problem is that many screen savers (e.g., Darkside)
>> kick in.  How do these screen savers decide when to save a screen
>> and how do I make my app tell these screen savers not too?
>
>I've had some (limited) success with posting key down events periodically.
> [...]
>Anyone have a better solution? :-)

  I believe that After Dark (and most newer screen savers, like
DarkSide) implement a Gestalt selector which can be used to control
the screen saver ('SAVR' or 'SAVC').  I don't know what level of
control's possible through it, though.  Anyone have more info on this?
--
Anton Rang (rang@winternet.mpls.mn.us)

+++++++++++++++++++++++++++

>From L.H.Wood@student.lut.ac.uk
Date: Tue, 22 Mar 1994 23:50:51 GMT
Organization: Loughborough University, UK.

In article <giles-220394110353@140.251.160.160> giles@med.cornell.edu (Aaron Giles) writes:
>In article <Cn2K8I.rxu@mozo.cc.purdue.edu>, neath@brazil.psych.purdue.edu
>(Ian Neath) wrote:
>
>> I have a simulation program that keeps updating the screen each
>> cycle.  The problem is that many screen savers (e.g., Darkside)
>> kick in.  How do these screen savers decide when to save a screen
>> and how do I make my app tell these screen savers not too?
>
>I've had some (limited) success with posting key down events periodically.
> Like most solutions to this problem, this one has certain idiosyncracies.
> For instance, I got email from one person who said that there was a quiet
>rhythmic tapping noise in the background -- turns out he had some
>extension which make audible key clicks whenever he typed!
>
>Anyone have a better solution? :-)

Use the screensaver gestalts defined by After dark and used by most screensavers
these days.

Full info in the After Dark programming manuals, available from info-mac or
the After Dark site at ftp.att.com /pub/afterdark.

L.


+++++++++++++++++++++++++++

>From Thomas Reed <reed@medicine.wustl.edu>
Date: 23 Mar 1994 14:49:28 GMT
Organization: Washington University

In article <lowry-220394154247@lowry.eche.ualberta.ca> Brian Lowry,
lowry@shiva.eche.ualberta.ca writes:
>  Look, either your application saves its graphics offscreen (like it's
>supposed to), or it's simply incompatible with screen savers (or anything
>else that can come in front of it.  What do you do when your application
is
>moved to the background or hidden?

I think his point is that he's written a simulation program that you sit
and watch without hitting any keys (or something like that), and the
screensaver always comes on during it.  I think that wanting to keep the
screensaver from kicking in is a legitimate desire.

Plus, there's no "supposed to" about saving graphics offscreen.  You can
update your graphics any way you want.  I've written programs where it's
more efficient to recalculate the graphics in a temporary buffer, rather
than saving it constantly in a static buffer.

-Thomas
=====================================================
Thomas Reed                    Washington University
Reed@telesphere.wustl.edu          Medical School
(also:  Reed@medicine.wustl.edu)
- ---------------------------------------------------
Clothes make the man.  Naked people have little or no
influence on society.  -- Mark Twain
=====================================================

+++++++++++++++++++++++++++

>From lowry@shiva.eche.ualberta.ca (Brian Lowry)
Date: 23 Mar 1994 18:18:21 GMT
Organization: Chem Eng - Univ of Alberta

In article <2mpktoINNosu@medicine.wustl.edu>, Thomas Reed
<reed@medicine.wustl.edu> wrote:

> I think his point is that he's written a simulation program that you sit
> and watch without hitting any keys (or something like that), and the
> screensaver always comes on during it.  I think that wanting to keep the
> screensaver from kicking in is a legitimate desire.

  Well then, ask the user to turn off their screen saver.  Or, better yet,
use the screen saver as a display shell (that's what they do best).  I've
been known to try out all kinds of graphics in After Dark first, because it
keeps the rest of my system happy (AD handles all the
refresh/update/background stuff for me).  Anyway, the above doesn't just
have a problem with screen savers - it will also die when an application
moves itself to the front (or when the user, so innocent that they can't
turn off a screen saver themself, brings something to the front, or -- gasp
-- clicks on the desktop!).  Not handling update events properly seems (to
me) an extreme example of laziness.

-- 

Brian Lowry

+++++++++++++++++++++++++++

>From Thomas Reed <reed@medicine.wustl.edu>
Date: 23 Mar 1994 20:22:48 GMT
Organization: Washington University

In article <lowry-230394111212@lowry.eche.ualberta.ca> Brian Lowry,
lowry@shiva.eche.ualberta.ca writes:
>  Well then, ask the user to turn off their screen saver.

What a pain?  As a user, would you rather turn off your screen saver, or
have the program do it for you?

>Anyway, the above doesn't just
>have a problem with screen savers - it will also die when an application
>moves itself to the front (or when the user, so innocent that they can't
>turn off a screen saver themself, brings something to the front, or --
gasp
>-- clicks on the desktop!).  Not handling update events properly seems
(to
>me) an extreme example of laziness.

Nobody ever said anything about not handling updates properly!  The
reason I can see is that it would be a major pain-in-the-ass if your
screensaver came on every five minutes (or whatever it's set to) while
watching a simulation.  That doesn't mean that he isn't handling updates!

-Thomas
=====================================================
Thomas Reed                    Washington University
Reed@telesphere.wustl.edu          Medical School
(also:  Reed@medicine.wustl.edu)
- ---------------------------------------------------
Clothes make the man.  Naked people have little or no
influence on society.  -- Mark Twain
=====================================================

+++++++++++++++++++++++++++

>From tzs@u.washington.edu (Tim Smith)
Date: 24 Mar 1994 03:13:47 GMT
Organization: University of Washington School of Law, Class of '95

Thomas Reed  <reed@medicine.wustl.edu> wrote:
>I think his point is that he's written a simulation program that you sit
>and watch without hitting any keys (or something like that), and the
>screensaver always comes on during it.  I think that wanting to keep the
>screensaver from kicking in is a legitimate desire.

Don't most screen savers provide a way for the user to indicate that they
are not kick in (e.g., moving the mouse to a specified part of the
screen)?  If the user of the simulation doesn't want the screen saver
to interfere, shouldn't it be left to the user to tell this to the
screen saver.  Presumably, they user installed the screen saver
because he or she *wants* it to kick in, and it is not the place of
the simulation program to decide that the user was wrong.

--Tim Smith

+++++++++++++++++++++++++++

>From mason@cis.umassd.edu (Mason Bliss)
Date: Fri, 25 Mar 1994 19:34:11 GMT
Organization: University of Massachusetts Dartmouth

In <RANG.94Mar22183032@icicle.winternet.mpls.mn.us> rang@winternet.mpls.mn.us (Anton Rang) writes:

>  I believe that After Dark (and most newer screen savers, like
>DarkSide) implement a Gestalt selector which can be used to control
>the screen saver ('SAVR' or 'SAVC').  I don't know what level of
>control's possible through it, though.  Anyone have more info on this?

You can turn the screen saver on and off, or wake it up and send it back
to slumber land... Pretty much whatever you want.

Check out the Gestalt 'SAVC' selector, as that does what you want.

So far, After Dark, Darkside, and Basic Black support this. I don't know
who else does.

-- 
Mason L. Bliss  <>  Psych Student & Random Hacker  <>  UMass Dartmouth
    Internet: mason@cis.umassd.edu    <>    FidoNet: 1:109/370.6
        You're brave! You shoot men! You step on their necks!

---------------------------

>From darrin@engin.umich.edu (Darrin P Cardani)
Subject: How to save a PICT?
Date: 22 Mar 1994 23:48:52 GMT
Organization: University of Michigan Engineering, Ann Arbor

I have a picture in a GWorld which I want to save to a file. I've tried
adapting the code from Think Reference for this, but it doesn't seem
to work. My Gworld is 16 bits deep. And I'm replacing the PutPict Std
Proc with one that writesto disk, like in the Think Ref. example.
I'm then doing a CopyBits of the entire GWorld onto itself.
Is this a problem? Is there a better way? Thanks for any help.

Darrin Cardani
darrin@engin.umich.edu
Darrin.Cardani@AtlantaGA.NCR.COM


+++++++++++++++++++++++++++

>From markhanrek@aol.com (MarkHanrek)
Date: 22 Mar 1994 20:39:02 -0500
Organization: America Online, Inc. (1-800-827-6364)

You are doing it the hard way, which is the slower memory-conservative
approach.

You really should find working example source code and imitate it.

Essentially, you write 512 bytes of zeroes to a file, then write the data in
your PicHandle (picture).

The way you come up with a PicHandle -- i.e. a picture version of the image in
your GWorld -- is you open up a new picture, and then CopyBits the GWorld's
PixMap to itself, then close the picture.

Off the top of my head, you'd do something like this...


  PicHandle     thePicture;
  PixMapHandle  thePixels;
  Rect          theRect;
  GWorldPtr     theGWorld;

  thePicture = OpenPicture( &theRect );

  thePixels = GetGWorldPixMap( theGWorld );
  LockPixels( thePixels );

  CopyBits( *thePixels, *thePixels, &theRect, &theRect, srcCopy, nil );

  ClosePicture;

  UnlockPixels( thePixels );

  // Create file with type 'PICT'
  // Open file
  // Write 512 bytes of zeros ( to accomodate ancient unused protocol )
  // Write all the data in thePicture
  // Close file


Of course, you could also now perform...

     DrawPicture( thePicture );

... if you wanted -- just to give you a point of reference.

You can take care of handling the appropriate rect and GWorld in the example
code above, natch.

Hope this helps.

Mark Hanrek

+++++++++++++++++++++++++++

>From Steve Bryan <sbryan@maroon.tc.umn.edu>
Date: Wed, 23 Mar 1994 16:18:46 GMT
Organization: Sexton Software

In article <2mo054INNfca@srvr1.engin.umich.edu> Darrin P Cardani,
darrin@engin.umich.edu writes:
>to work. My Gworld is 16 bits deep. And I'm replacing the PutPict Std
>Proc with one that writesto disk, like in the Think Ref. example.
>I'm then doing a CopyBits of the entire GWorld onto itself.
>Is this a problem? Is there a better way? Thanks for any help.

This should generate the pict but not quite a pict file. Are you getting
any output at all? Assuming you are don't forget that your pict file will
need a 256 byte header. You have the option of making that header all
zeros and still being compatible with most pict reading programs (eg
TeachText). Sorry if I'm pointing out something you already know but it
would be helpful if you'd include at least a little pseudo code to show
what you are trying.
Steve Bryan                       sbryan@maroon.tc.umn.edu
Sexton Software                   CompuServe: 76545,527
Minneapolis, MN                   fax: (612) 929-1799

---------------------------

>From petm@soda.berkeley.edu (Peter Mattis)
Subject: INIT: displaying a dialog
Date: 20 Mar 1994 22:25:56 GMT
Organization: Computer Science Undergrad Assoc., UCBerkeley

Ok, I'm trying to write an init that displays a dialog when the user
control-option-command clicks on the screen.

I know how to check for the click, but what is the best way to show
the dialog?

Creating it from scratch each time would be a pain, since I'm not 
sure how to create the control items in the dialog.

The method I tried and got a little success with is copying the
DITL and DLOG resources from my init to the system file when the init
loads, that way I can make a call to GetNewDialog(). (Of course, I set
the current resource file to the system file first).

It would be nice if I could simply keep the dialog around permanently and
keep it hidden when not needed. So how do I make a call to GetNewDialog at
startup? (i.e. How do you init the toolbox managers at startup? I've had
trouble doing this.) This would seem to be the nicest way since if some
user doesn't like this init they can simply through it away and not have
extra resources floating around in the system file.

Are there any other methods for doing this than what I've described?

All comments are welcome.
Thanks in advance.

-Peter Mattis

+++++++++++++++++++++++++++

>From gurgle@netcom.com (Pete Gontier)
Date: Mon, 21 Mar 1994 02:28:16 GMT
Organization: cellular

petm@soda.berkeley.edu (Peter Mattis) writes:

>Ok, I'm trying to write an init that displays a dialog when the user
>control-option-command clicks on the screen.

This is not the crux of your post, but allow me to point out anyway that
this is not great interface. There are plenty of INITs which detect
clicks in combination with some set of modifier keys, but they generally
respond with some interface like a popup menu which conforms intuitively
to the user's notion of clicking and holding the mouse button down.
Users generally don't cause dialogs to appear by clicking and holding.
When they cause dialogs to appear by clicking, there is always some
visual cue which tells them (a) where to click and (b) whether they have
succeeded in clicking on it. And then the dialog does not appear until
after the mouse button goes up.

>I know how to check for the click, but what is the best way to show
>the dialog? Creating it from scratch each time would be a pain, since
>I'm not sure how to create the control items in the dialog. The method
>I tried and got a little success with is copying the DITL and DLOG
>resources from my init to the system file when the init loads, that
>way I can make a call to GetNewDialog(). (Of course, I set the current
>resource file to the system file first).

Ack! Phbbt! You must have gotten tons of email already telling you not
to do this. Modifying the System file by any program other than an
installer is truly evil.

>It would be nice if I could simply keep the dialog around permanently
>and keep it hidden when not needed. So how do I make a call to
>GetNewDialog at startup?

Well, first of all, this is not something you want to do. If you succeed
in doing it, your dialog will only stick around until MultiFinder starts
up. Then seven zillion traps get patched and the window list gets new
behavior, etc. etc., and your dialog gets taken out of the loop, as it
were.

Fortunately, you don't have to do this. You have two alternatives,
and they both involve saving away some information at startup for
future use.

Firstly, you can save info which allows you to locate the extension file
when you need it. This might involve saving the file name, vRefNum, and
dirID. If you're really cool, you'll save the file type and creator
instead of the file name and search for your extension that way so that
the user can rename you during a session without screwing you. To get
this sort of information in the first place, start with CurResFile and
PBGetFCBInfo diring startup. If you can require System 7, you might be
interested in saving an alias record to yourself.

The nice thing about the above method is that it gives you general-case
access to your extension's resource fork. That means you can almost
pretend to be an app and do all the resource getting you like. Of
course, you can;t go opening the fork and leaving it open, so you'll
have to pretend your "app" is modal -- startup, run, and shutdown --
during which time the user cannot interact with other programs.

A more special-case method would be to save the DITL resource in a
handle in the System Heap during startup and later call NewDialog with
it. This works just fine, too.

>(i.e. How do you init the toolbox managers at startup? I've had trouble
>doing this.

This won't help you, because as I said all the initialization you do
will be wiped out when MultiFinder starts up anyway.

>This would seem to be the nicest way since if some user doesn't like
>this init they can simply through it away and not have extra resources
>floating around in the system file.

And that's precisely the reason you don't want to diddle the System
file, assuming you write absolutely perfect code and there's no chance
you'll blow away that file, rendering the Mac non-bootable. :-)

>All comments are welcome.

Oh yeah? Your mother wears army boots!
-- 
 Pete Gontier, CTO, Integer Poet Software; gurgle@netcom.com

+++++++++++++++++++++++++++

>From petm@soda.berkeley.edu (Peter Mattis)
Date: 21 Mar 1994 04:52:44 GMT
Organization: Computer Science Undergrad Assoc., UCBerkeley

gurgle@netcom.com (Pete Gontier) writes:

>A more special-case method would be to save the DITL resource in a
>handle in the System Heap during startup and later call NewDialog with
>it. This works just fine, too.

Go figure, just a little bit earlier I think that a cool way to
do what I want is to save a handle to a DITL resource at startup and
then use this in a call to NewDialog. I try this and it works in a
test app, but fails when I incorporate it into an init.

A few questions:
-Why is this method crashing?
-When I tested this method using an app I noticed that I couldn't use
the same handle over and over. I had to make a copy of it for each call
to NewDialog. Why? Does DisposDialog dispose of the itemlist?

On your comments about my displaying a dialog in response to a modifier-
click combination. This init is actually a mild form of security
protection for my computer. What I posted earlier wasn't quite correct.
The user (me) will (modifiers)-click in a certain place on the screen
to turn on the security. Then whenever the mouse button is clicked the
dialog box will appear prompting for a password. I'm not sure how
correct this is by Apple's UI guidelines, but since I probably won't
be releasing it, then I have little to worry about in that area.

I know there are other security programs out there, but the point isn't to
have a really terrific security program, but to have a simple one that
works adequately well. (In it's first incarnation, this program stops all
intermediate users from accessing my computer. In fact, the only way I
know of to circumvent it is to reboot the computer using a DIFFERENT
startup disk. This is because I disable the shift key from keeping inits
from loading when it's on. The first version was activated and
deactivated by using (modifier)-click combinations in certain areas
of the screen. I thought using a password to gain access would be much
more cool.)

-Peter Mattis

+++++++++++++++++++++++++++

>From rmah@panix.com (Robert S. Mah)
Date: Mon, 21 Mar 1994 04:34:45 -0500
Organization: One Step Beyond

petm@soda.berkeley.edu (Peter Mattis) wrote:

> gurgle@netcom.com (Pete Gontier) writes:
> 
> >A more special-case method would be to save the DITL resource in a
> >handle in the System Heap during startup and later call NewDialog with
> >it. This works just fine, too.
> 
> Go figure, just a little bit earlier I think that a cool way to
> do what I want is to save a handle to a DITL resource at startup and
> then use this in a call to NewDialog. I try this and it works in a
> test app, but fails when I incorporate it into an init.
> 
> A few questions:
> -Why is this method crashing?

Most likely because you're not calling DetachResource() on the DITL 
handle.  When a resource file (i.e. your INIT) get's closed, all the 
associated resources are purged from RAM.  Except, of course, for the 
ones you called DetachResource() on (because then, they're no longer 
technically resources).

> -When I tested this method using an app I noticed that I couldn't use
> the same handle over and over. I had to make a copy of it for each call
> to NewDialog. Why?

Because that's the way it i:-)   Dialog manager changes the DITL handle
in place and if you want to use it over again, you must do so from a
fresh copy.  This is described in Inside Mac I.


> Does DisposDialog dispose of the itemlist?

Yes.  Be careful here though.  Since you are planning to use this from
an INIT, be aware that calling NewDialog or GetNewDialog with a NULL
for the storage parameter will allocate the storage in the current app
heap, not the system heap.  Therefore, the storage can get munched if
you try to use the dialog between WaitNextEvent calls made by the under-
lying apps.


> startup disk. This is because I disable the shift key from keeping inits
> from loading when it's on. The first version was activated and

Pretty skanky!  How do you do diable the shift-key-disables-inits feature?

Cheers,
Rob
________________________________________________________________________
 Robert S. Mah              One Step Beyond              rmah@panix.com

+++++++++++++++++++++++++++

>From devon_hubbard@taligent.com (Devon Hubbard)
Date: Sat, 26 Mar 1994 00:09:55 GMT
Organization: Taligent, Inc.

In article <2miihk$qtl@agate.berkeley.edu>, petm@soda.berkeley.edu (Peter
Mattis) wrote:

> Ok, I'm trying to write an init that displays a dialog when the user
> control-option-command clicks on the screen.
> 
> I know how to check for the click, but what is the best way to show
> the dialog?
> 
> Creating it from scratch each time would be a pain, since I'm not 
> sure how to create the control items in the dialog.
> 
> The method I tried and got a little success with is copying the
> DITL and DLOG resources from my init to the system file when the init
> loads, that way I can make a call to GetNewDialog(). (Of course, I set
> the current resource file to the system file first).
> 
> It would be nice if I could simply keep the dialog around permanently and
> keep it hidden when not needed. So how do I make a call to GetNewDialog at
> startup? (i.e. How do you init the toolbox managers at startup? I've had
> trouble doing this.) This would seem to be the nicest way since if some
> user doesn't like this init they can simply through it away and not have
> extra resources floating around in the system file.
> 
> Are there any other methods for doing this than what I've described?
> 
> All comments are welcome.
> Thanks in advance.
> 
> -Peter Mattis

I hate to give away a method I used years ago to do this, but since this
isn't rocket science we're talking about, what can it hurt.  During INIT
time save the vol/dirid of your INIT (e.g. the current open res file). 
When it's time to bring up your dialog (or whatever), your INIT code opens
up (_HOpenResFile, etc.) your INIT/cdev from where it knows it's supposed
to be, thereby making it the current res file.  Your calls to
_GetNewDialog, etc. will work just fine.  Be very careful to save the
previous _CurResFile, restore it and everything the way it was, and close
your res file when done.  Be very careful about ResID numbering and check
all your rsrc calls to make sure they don't fall back to other rsrc files
in the chain.  It's a good idea to use Get1Resource-type calls wherever you
can.  Being polite and asking the user to locate the file if it's moved
since startup is a polite thing to do.  Use regular StandardGetFile calls
for that or politely fail.  Don't just beep or something if you can't open
your res file.

There are a lot of INITs out there (uh hem, mail type programs) that open
themselves during INIT time and leave themselves open forever.  I've always
hated this and thought this was nasty and stupid but that's just me.  Hope
this helps.

dEVoN

- ------------------------------------------------------------------------
Devon Hubbard                                                Silicon Pilot
devon_hubbard@taligent.com                                   Taligent, Inc

---------------------------

>From jcovele@netcom.com (John Covele)
Subject: LabView programming group?
Date: Fri, 25 Mar 1994 09:30:52 GMT
Organization: NETCOM On-line Communication Services (408 241-9760 guest)

Does anyone know where I can find a LabView programming group on the
internet?

-- 
John

jcovele@netcom.com
keymaster5@aol.com
keymaster@online.apple.com

+++++++++++++++++++++++++++

>From ejensen@server.uwindsor.ca (Erik Jensen)
Date: Fri, 25 Mar 1994 14:34:58 GMT
Organization: University of Windsor

In article <jcovele-250394013052@jcovele.slip.netcom.com>,
jcovele@netcom.com (John Covele) wrote:

> Does anyone know where I can find a LabView programming group on the
> internet?
> 
> -- 
> John

There is a LabVIEW mailing list that gets quite a few articles daily. Some
information I have is printed below:

>Welcome to the Info-LabVIEW Mailing List! At this time I would ask that you
>check the mail address I have used to send this msg to you. If it is
>not correct, please let me know, and I will make the necessary changes.

>If you'd like, a digest version of the list is available. Daily digests are
>formed and mailed at ~11:30 PM local time (east coast USA). Let me know if
>this is your preference. Please put the word "Digest" in the subject
>line to enable me to sort such msgs readily. In case you were wondering,
>the difference is that you'll get only one Info-LabVIEW msg a day, rather
>than the 15-20 msgs a day the list typically sees.

>To post to the list, mail to <info-labview@pica.army.mil>. Administrative
>issues such as SUBSCRIPTION and DELETION REQUESTS, as well as any mailer
>problems, SHOULD BE ADDRESSED TO <info-labview-request@pica.army.mil>,
>not to info-labview, or my personal account.

>PLEASE! DO NOT send subscription and deletion requests to <info-labview>. If
>you do so, your request will be forwarded to each of the readers of the list.
>Aside from their disinterest in such matters, it wastes lots of net bandwidth.
>Also, do not send list submissions to <info-labview-request>, as I have to
>forward them to the list by hand!

I hope this helps.

__________________________________________________________________________ 
Erik Jensen                                    
Department of Physics                         
University of Windsor                          ejensen@server.uwindsor.ca
__________________________________________________________________________

+++++++++++++++++++++++++++

>From timothys@hood.uucp (Timothy Sherburne)
Date: 26 Mar 94 06:00:42 GMT
Organization: University of Portland

jcovele@netcom.com (John Covele) writes:

>Does anyone know where I can find a LabView programming group on the
>internet?

>-- 
>John

>jcovele@netcom.com
>keymaster5@aol.com
>keymaster@online.apple.com

John-

There was a BitNet group devoted to LabVIEW programming (with access via e-mail, too).  This was 'bout a year ago since I last subscribed to it, but I'm sure it's still around.  Unfortunately, I can't remember the address off hand-try looking in the "List of Lists" for more info.

Tim
-- 
- ---------------------------------------
| Timothy Sherburne			|
| Internet:  timothys@hood.uofport.edu	|
- ---------------------------------------

---------------------------

>From daniels@tts.lth.se (Daniel Sobirk)
Subject: Proper way to dim screen
Date: Wed, 23 Mar 1994 16:18:07 +0100
Organization: TTS

HI!
For the purpose of a game I would like to neatly fade the screen to
black, do a little drawing and then fade back to the proper colors.
I have played around a bit with the clut, but compared with the
FadeAway module of AfterDark (which does exactly what I want) the clut
method is very slow. 
I think that modifing the gamma table(?) could be a way to go, but this
seems only to be documented in Designing Cards and Drivers... which I
don't own.
If somebody could point me in the right direction, or, even better,
could provide me with some example code I would be eternally grateful.
Pascal is preferred but anything will do.

Cheers,
Daniel.

PS
The game will eventually be released on CD-ROM (here in Sweden) and since I
will also do the About box. So if you can help me you will be immortalized,
at least in Sweden. Not bad eh?
D.

+++++++++++++++++++++++++++

>From Matt Slot <fprefect@engin.umich.edu>
Date: 23 Mar 1994 20:31:50 GMT
Organization: University of Michigan

Daniel Sobirk, daniels@tts.lth.se writes:

>I think that modifing the gamma table(?) could be a way to go, but this
>seems only to be documented in Designing Cards and Drivers... which I
>don't own.

I have written a THINK C library that does Gamma Fading with a simple
interface. The library is free and available for FTP from Sumex, Mac-Archive,
and I will post it to alt.sources.mac newsgroup. There is also a Pascal
version available (thanks to Matthew Xavier Mora).

Enjoy
Matt Slot

+++++++++++++++++++++++++++

>From kenlong@netcom.com (Ken Long)
Date: Wed, 23 Mar 1994 18:57:30 GMT
Organization: NETCOM On-line Communication Services (408 241-9760 guest)

One of the GMonde DTS snippets does gamma fades.  Mark Slot posted a 
gamma fade demo and a lib.  Cheese Toast 1.0 has the GMonde .c and.h 
(that's not suger) files in it.  Cheese Toast 1.1 does fades, too (and 
works on an LC).  There's a 'clut' fader demo on sumex.There are fade 
routines in Mark Pilgrim's MSG demo.  DarkSide fade sources are around.

There's a knob on your monitor that fades.	:)

Gee, I feel less mortal already!  Maybe in a couple lifetimes I may give 
up dying altogether!

-Ken-

+++++++++++++++++++++++++++

>From Carl R. Osterwald <carl_osterwald@nrel.gov>
Date: Thu, 24 Mar 94 16:21:01 GMT
Organization: National Renewable Energy Laboratory

In article <daniels-230394161807@mac1-tts.tts.lth.se> Daniel Sobirk,
daniels@tts.lth.se writes:
>I have played around a bit with the clut, but compared with the
>FadeAway module of AfterDark (which does exactly what I want) the clut
>method is very slow. 

One problem with clut manipulations is that they won't work on fixed-clut
GDevices, such as PowerBooks and Duos with LCD displays.  Considering the
number of these Macs out there, this is a serious limitation.  One of the
new tech notes on ftp.apple.com discusses this problem.

+++++++++++++++++++++++++++

>From kenlong@netcom.com (Ken Long)
Date: Fri, 25 Mar 1994 02:19:29 GMT
Organization: NETCOM On-line Communication Services (408 241-9760 guest)

That's MATT Slot, Ken!  "Mark-a-lot" is a pen!  Now, what's this 
"Shinola" stuff I've been hearing about (or is that 'smelling')?

-Ken- 

+++++++++++++++++++++++++++

>From danprice@delphi.com
Date: Fri, 25 Mar 94 22:52:46 -0500
Organization: Delphi (info@delphi.com email, 800-695-4005 voice)

 
Will the gamma or clut methods work with classic QDraw?  My Classic's monitor
can fade via a control panel and via after dark.  Any ideas?
 
	-dp

---------------------------

>From Peter Su <psu+@cs.cmu.edu>
Subject: Think Pascal tools for tracking down memory problems
Date: Tue, 22 Mar 1994 19:54:21 GMT
Organization: School of Computer Science, Carnegie Mellon

Are there any tools that could help one find memory leaks and/or
handle botches in THINK Pascal programs?

Thanks,
Pete

+++++++++++++++++++++++++++

>From ingemar@lysator.liu.se (Ingemar Ragnemalm)
Date: Thu, 24 Mar 1994 22:22:39 GMT
Organization: (none)

Peter Su <psu+@cs.cmu.edu> writes:

>Are there any tools that could help one find memory leaks and/or
>handle botches in THINK Pascal programs?

I just type FreeMem in the Observe window and see if it changes (signifi-
cantly), and if it does, step though the code to see when. Or did you have
something else in mind? (What are "botches?)

--
- -
Ingemar Ragnemalm, PhD
Image processing, Mac shareware games
E-mail address: ingemar@isy.liu.se or ingemar@lysator.liu.se

+++++++++++++++++++++++++++

>From omh@cs.brown.edu (Owen M. Hartnett)
Date: Fri, 25 Mar 1994 14:34:50 GMT
Organization: Brown University Department of Computer Science

In article <Cn6wts.1rH@lysator.liu.se> ingemar@lysator.liu.se (Ingemar Ragnemalm) writes:
>Peter Su <psu+@cs.cmu.edu> writes:
>
>>Are there any tools that could help one find memory leaks and/or
>>handle botches in THINK Pascal programs?
>
>I just type FreeMem in the Observe window and see if it changes (signifi-
>cantly), and if it does, step though the code to see when. Or did you have
>something else in mind? (What are "botches?)
>
>--
>---
>Ingemar Ragnemalm, PhD
>Image processing, Mac shareware games
>E-mail address: ingemar@isy.liu.se or ingemar@lysator.liu.se

Get the MacsBug dcmd "Leaks" from ftp.apple.com (I should be in there.)
You'll need somewhat of a knowledge of MacsBug to use it, but this is
good knowledge to have, anyway. Leaks does an excellent job of tracking
down memory leaks.

-Owen

-- 
Owen Hartnett				omh@cs.brown.edu
"FAITH, n. Belief without evidence in what is told by one who speaks
		without knowledge, of things without parallel."
			-Ambrose Bierce - The Devil's Dictionary

+++++++++++++++++++++++++++

>From pottier@goelette.ens.fr (Francois Pottier)
Date: 25 Mar 1994 19:40:47 GMT
Organization: Ecole Normale Superieure, PARIS, France

>Peter Su <psu+@cs.cmu.edu> writes:
>
>>Are there any tools that could help one find memory leaks and/or
>>handle botches in THINK Pascal programs?

I think that a wonderful tool for this is the 'Leaks' dcmd. It's very
simple to use: break into Macsbug, type 'Leaks On'. Then let your program
run for a while and do whatever it's supposed to do. Then break into
Macsbug again and type 'Leaks Off'. It will display a list of blocks that
have been allocated and not released, along with the names of the routines
which allocated them. It's incredibly efficient and useful. You can fix
memory leaks without even thinking. Just use Leaks, which tells you which
routine is broken, go fix the routine and it works.

-- 
- -----------------------------------------------------------------------------
Francois Pottier
pottier@dmi.ens.fr

---------------------------

>From John Delacour <JD@eremita.demon.co.uk>
Subject: WorldScript compatible Text Editors
Date: Sat, 19 Mar 1994 01:23:53 GMT
Organization: Eremita


I'm quite out of my depth in this newsgroup but it looks like the best 
place to ask the question.

Certain text-editors and word-processors for the Mac behave well with 
Chinese or a mixture of Chinese and single-byte characters but the majority 
do not.

Of the main wordprocessors only Nisus and WordPerfect (nearly) are designed 
to allow comfortable editing, and yet there are a few tiny and not so tiny 
text-editors (eg. MiniWriter, Tex-Edit, Joliwrite, Eudora) which behave 
perfectly and can delete, insert, cut, paste etc. and generally recognize a 
two-byte character when they see one.

Is there some standard code that can be incorporated into an application to 
make a text-editor "WorldScript aware"? (probably not the right 
terminology.

It puzzles me that an application like MiniWriter (39K on disk) can cope 
with mixed inputs whereas Word 5 and MacWrite Pro cannot.

Any information on this a question would be gratefully received, preferably 
by email, since as I said, I am not really a worthy denizen of this august 
newsgroup.

           John





--


+++++++++++++++++++++++++++

>From wbostow@hounix.org (Wayne Bostow)
Date: Sat, 19 Mar 1994 21:02:07 GMT
Organization: Houston UNIX Users Group (HOUNIX), Houston, TX


>there are a few tiny and not so tiny
text-editors (eg. MiniWriter, Tex-Edit, Joliwrite, Eudora) which behave
perfectly and can delete, insert, cut, paste etc. and generally recognize a

two-byte character when they see one.

  Can you give some info on these? I never heard that they were two-byte
compatible.

  What two-byte process do you use?

>It puzzles me that an application like MiniWriter (39K on disk) can cope
with mixed inputs whereas Word 5 and MacWrite Pro cannot.

  This aspect of processing occurs at a very low level. To take an
analogy, Suppose you wired a house for 1000 volts. That would become
increasingly difficult as you had more built-in appliances and larger
space.

  Developers who have tried to convert existing apps run into Excedrin+
headaches. Often the needed code is in a closed module licensed from
someone who never, or no longer worked in the company. The first 95% of
conversion might come easily, but how do you deal with command key entries,
file names, and keyboard input for font names and sizes?


-- 
__________________________________________________________
  Wayne Bostow "The HangulMan"
   10558 Alcott, Houston, TX 77043    ph. (713)468-6546
     wbostow@hounix.org

+++++++++++++++++++++++++++

>From mlanett@netcom.com (Mark Lanett)
Date: Sun, 20 Mar 1994 02:11:01 GMT
Organization: Etch-a-Sketch Analysis and Design

wbostow@hounix.org (Wayne Bostow) writes:

>>there are a few tiny and not so tiny
>text-editors (eg. MiniWriter, Tex-Edit, Joliwrite, Eudora) which behave
>perfectly and can delete, insert, cut, paste etc. and generally recognize a
>two-byte character when they see one.

>  Can you give some info on these? I never heard that they were two-byte
>compatible.

Setting a break on TENew and TEStylNew shows that...

Tex-Edit (112K) uses Styled TE and handles Japanese perfectly.

UsenEdit (24K) and one of the several thousand TeachText's on my HD
use mono TE and get escape codes when I type in Japanese.

BBEdit Lite (168K) doesn't use TE at all and can't (as expected anyway) handle
Japanese.

WASTE (a >32K styled text engine, 47K) doesn't use TE or STE but does use the
script manager and can handle mixed scripts to some degree (not 2-byte).

>>It puzzles me that an application like MiniWriter (39K on disk) can cope
>with mixed inputs whereas Word 5 and MacWrite Pro cannot.

One of the benefits of the Script Manager and TE's use of it. One of the few
benefits of TE come to think of it, although when WASTE gets finished it'll
be preferable.

The WASTE readme intro:
--
About WASTE
 
This archive contains an alpha version (1.0a2 of March 1994) of the WASTE text engine, currently in the form of a THINK Pascal library (compatible with MPW .o files), and a simple demo application using the engine.  The WASTE text engine is replacement for styled TextEdit which can handle text bigger than 32K.
A first draft of the documentation (still missing some pieces) is provided in Microsoft Word format.  Send comments and suggestions to the author at the following address:
 
Marco Piovanelli
Mail: 26, via del Sebino Ñ 25126 Brescia Ñ Italy
Internet: piovanel@dsi.unimi.it
 
PS: I read my Internet mail only once or twice a week, so don't expect prompt replies.

-- 
    Mark Lanett "...a bajillion brilliant Jobsian lithium licks"

+++++++++++++++++++++++++++

>From qsi@cnh.wlink.nl (Peter Kocourek)
Date: Sun, 20 Mar 1994 13:59:44 +0100
Organization: (none)

Mark Lanett wrote in a message on 20 Mar 94

>  Can you give some info on these? I never heard that they were two-byte
>compatible.

 ML>  Setting a break on TENew and TEStylNew shows that... 
 ML> Tex-Edit (112K) uses Styled TE and handles Japanese perfectly. 

[...]

Others include Edit7 (320K or so), which handles 2-byte scripts properly, and
muEdit, which is supposed to handle right-to-left scripts properly (I have not
tested it extensively yet, but it seems to work). Both are avaivable at your
favorite Info-Mac mirror site.


YHS:QSI!


+++++++++++++++++++++++++++

>From piovanel@hp4.sm.dsi.unimi.it (Marco Piovanelli)
Date: 21 Mar 1994 17:07:34 +0100
Organization: Computer Science Dep. - Milan University

mlanett@netcom.com (Mark Lanett) writes:

>WASTE (a >32K styled text engine, 47K) doesn't use TE or STE but does use the
>script manager and can handle mixed scripts to some degree (not 2-byte).
                                                             ^^^^^^^^^^

I beg to differ.
WASTE does handle double-byte scripts correctly (well, at least it tries...)
What WASTE doesn't do so far is bidirectional scripts.

					-- marco

--
You can prove just about anything with statistics -- even the truth.

+++++++++++++++++++++++++++

>From Dan Crevier <crevier@husc.harvard.edu>
Date: 21 Mar 1994 14:52:39 GMT
Organization: Harvard University

In article <mlanettCMxy2D.1yu@netcom.com> Mark Lanett, mlanett@netcom.com
writes:
>wbostow@hounix.org (Wayne Bostow) writes:
>
>>>there are a few tiny and not so tiny
>>text-editors (eg. MiniWriter, Tex-Edit, Joliwrite, Eudora) which behave
>>perfectly and can delete, insert, cut, paste etc. and generally
recognize a
>>two-byte character when they see one.
>
>>  Can you give some info on these? I never heard that they were two-byte
>>compatible.
>
>Setting a break on TENew and TEStylNew shows that...
>
>Tex-Edit (112K) uses Styled TE and handles Japanese perfectly.
>
>UsenEdit (24K) and one of the several thousand TeachText's on my HD
>use mono TE and get escape codes when I type in Japanese.
>
>BBEdit Lite (168K) doesn't use TE at all and can't (as expected anyway)
handle
>Japanese.
>
>WASTE (a >32K styled text engine, 47K) doesn't use TE or STE but does
use the
>script manager and can handle mixed scripts to some degree (not 2-byte).
>

	What do you mean WASTE can't handle 2-byte characters?  It handles them 
very well, including inline input.

>>>It puzzles me that an application like MiniWriter (39K on disk) can
cope
>>with mixed inputs whereas Word 5 and MacWrite Pro cannot.
>
>One of the benefits of the Script Manager and TE's use of it. One of the
few
>benefits of TE come to think of it, although when WASTE gets finished
it'll
>be preferable.
>

	If you use TE, you get two-byte character support automatically, since 
TE is written to handle two-byte characters.  Something like Word is not 
as well behaved because they write their own replacement for TE, since TE 
is slow, and can only handle 32K.  In their replacement, they make 
assumptions that each character is one-byte, which makes things easier, 
but of course breaks for two byte systems.

Dan

+++++++++++++++++++++++++++

>From mlanett@netcom.com (Mark Lanett)
Date: Tue, 22 Mar 1994 00:32:14 GMT
Organization: Etch-a-Sketch Analysis and Design

piovanel@hp4.sm.dsi.unimi.it (Marco Piovanelli) writes:

>mlanett@netcom.com (Mark Lanett) writes:

>>WASTE (a >32K styled text engine, 47K) doesn't use TE or STE but does use the
>>script manager and can handle mixed scripts to some degree (not 2-byte).
>                                                             ^^^^^^^^^^

>I beg to differ.
>WASTE does handle double-byte scripts correctly (well, at least it tries...)

[after a reboot to turn on the JLK]
Ack. So it does. And I should have remembered from reading the docs...
I think what confused me was the inline input instead of the floater that the
JLK TeachText is using. My mistake, poor testing.

Mark L
-- 
    Mark Lanett "...a bajillion brilliant Jobsian lithium licks"

+++++++++++++++++++++++++++

>From Steve Bryan <sbryan@maroon.tc.umn.edu>
Date: Tue, 22 Mar 1994 16:31:46 GMT
Organization: Sexton Software

In article <94031901235300102@eremita.demon.co.uk> John Delacour,
JD@eremita.demon.co.uk writes:
>Is there some standard code that can be incorporated into an application
to 
>make a text-editor "WorldScript aware"? (probably not the right 
>terminology.

All you might want to know on this topic and more is covered in the book
"Inside Macintosh: Text" published by Addison Wesley. Apple supports
multiple script systems at the system level so you can write a credible
Kanji version (among others) of your product simply by paying attention
(and finding someone to translate all the menus, dialogs, etc).
Steve Bryan                       sbryan@maroon.tc.umn.edu
Sexton Software                   CompuServe: 76545,527
Minneapolis, MN                   fax: (612) 929-1799

+++++++++++++++++++++++++++

>From paulcho@ionews.io.org (paulcho)
Date: 26 Mar 1994 11:35:06 -0500
Organization: Internex Online (io.org) Data: 416-363-4151  Voice: 416-363-8676


Article: 23166 of comp.sys.mac.programmer
 
qsi@cnh.wlink.nl (Peter Kocourek) wrote:
> 
> Mark Lanett wrote in a message on 20 Mar 94
> 
> >  Can you give some info on these? I never heard that they were two-byte
> >compatible.
> 
>  ML>  Setting a break on TENew and TEStylNew shows that... 
>  ML> Tex-Edit (112K) uses Styled TE and handles Japanese perfectly. 
> 
> [...]
> 
> Others include Edit7 (320K or so), which handles 2-byte scripts properly,
and
> muEdit, which is supposed to handle right-to-left scripts properly (I have
not
> tested it extensively yet, but it seems to work). Both are avaivable at your
> favorite Info-Mac mirror site.
> 
> 
> YHS:QSI!
 
Add my TextMovie to the list please! (part of MovieTrilogy available from 
sumex)
It use Styled TE and allowed you to use any color. (24bit Color Styled Edit!)
You can use it as a color text editor, and as a bonus you can save the text as

QuickTime text track movie! :-) I tested it in Chinese and worked ok. With the
rest of MovieTrilogy, now you can add English subtitle to Japanese anime or 
add Chinese subtitle to English movie etc...
 
________________________________________________________________
Paul C.H. Ho   paulcho@io.org         Pink Elephant Technologies
Paul_C.H._Ho@magic-bbs.corp.apple.com   74020.772@compuserve.com
 
 
 

---------------------------

End of C.S.M.P. Digest
**********************