Path: utzoo!utgpu!watmath!att!tut.cis.ohio-state.edu!cica!ctrsol!ginosko!uunet!mcvax!hp4nl!eutrc3!rcbaem
From: rcbaem@eutrc3.urc.tue.nl (Ernst Mulder)
Newsgroups: comp.sys.mac.programmer
Subject: Can anyone answer these Questions?
Message-ID: <840@eutrc3.urc.tue.nl>
Date: 14 Aug 89 11:21:59 GMT
Organization: Eindhoven University of Technology, The Netherlands
Lines: 68

After 3 years of owning an Apple Macintosh I finally overtook the barrier
a Mac programmer has to take. I started to program it. I used to program a
lot before I had a Mac, but I looked up to Mac programmers, especially
when I saw how immensely complex the IM routines (seemed to be) where.
Well, now I started myself, and my first program is already getting rather
complex.

I'm writing a program to do IFS. (Read Barnsley for more info) It supports
multiple Windows, is MF compatible, and fully IM compatible :)

A few questions:

1) I draw my picture(s) in an offscreen Grafport, and the picture's Window
   displays it (or a part of it). When I copy the offscreen port's picture
   to the Window I use CopyBits. The IM (1) however tells me not to
   CopyBit more than 3K at the time. Is this still so with newer ROMs?
   I CopyBits the whole picture at update times, and the picture is about
   20K bytes large! I always have enough Stack space available, so I
   can't figure where the 3K limit is needed for...

2) The user can select a part of the picture to copy it to the clipboard.
   MacPaint and HyperCard have a nice option, when you press Command while
   selecting graphics, the selection rectangle is schrinked to fit the
   picture you selected. I couldn't find any IM routines to do this
   for me. Do I have to write my own Assembly code to do this? Or is
   there a higher level solution?

3) What is the best way to update the default button's outline in a
   dialogbox? (For when a screensaver or so makes it disappear)

4) When the user selects About... I put a dialog on the screen (GetNewDialog)
   and DisposDialog it after the user clicked the mouse. I remove the 
   mousedown event from the eventqueue. After the dialog is disposed of
   my current front window gets a deactivate and an activate events, and
   even though it's not disasterous, it still doesn't look nice. How
   can I solve this? (Strange enough, another (modal) dialog in my program
   uses ModalDialog and a filter, and when Disposing of that dialog the
   frontWindow gets an activate event only...)

5) When a file is selected with Open... (or by doubleclicking it/them from
   the Finder) I read my DATA from it and close it again (Remembering its
   name and vRefNum) because I don't like to leave files open. However, 
   when the user moves the file into another folder using MultiFinder, 
   there's no way for me to know that. When the file is saved again, you
   get two copies, one in the folder and one where it was in the first
   place. Recognising this problem I checked some other Applications on
   it. And apparently I'm not the only one having this problem... The
   solution seems to be to leave the file open and refering it by the
   reference number returned by FSOpen for the rest of the program, or
   shouldn't I be bothered?

6) I use Str2Num (SANE) to read a number typed in a TEItem in a Dialog
   box. How can I detect the number is valid? (jshgjs) is detected
   not being a number my SANE, returning a NaN code. (12.23.1) however
   returns (12.23) and isn't detected as being wrong... Solution?

These are my questions so far. Answers may be posted on this newsgroup
or sent to me directly. You will see the program when I think it's
ready enough. I'm very proud having fittet all it can do for now into
26K bytes of Application. Not that anyone seems to care about the size
of an Application anymore, but last time I programmed was on a 64K
byte Apple //, and every byte counted. Think I still use that principle.
:)))

 Any help appreciated. I want my first Mac programm to be a very good one. :)

 Ernst.
   >