[comp.sys.mac.programmer] MacApp question

d83_sven_a@tekn01.chalmers.se (Sven (Sciz) Axelsson) (10/12/88)

I am fairly new to MacApp programming, so I am encountering all sorts
of problems (mostly my own fault). Here is one I would like some help
with.

I have an application in which I want one document that is open all
the time, like the Worksheet in MPW. This should also have a fixed
name. So I call OpenNew in my applications IApplication method which
eventually leads to a call to DoMakeWindows with a window template
with a fixed name (no <<<>>>:s). This sets the window title all right,
but the documents name is still Untitled-1 as can be seen when I try
to save it. Question: Am I missing something simple or is this the
way things are supposed to happen?
	I am grateful of any input on this one.

	Sven Axelsson, Gothenburg, Sweden

lsr@Apple.COM (Larry Rosenstein) (10/13/88)

In article <250@tekn01.chalmers.se> d83_sven_a@tekn01.chalmers.se (Sven (Sciz) Axelsson) writes:
>
>I have an application in which I want one document that is open all
>the time, like the Worksheet in MPW. This should also have a fixed
>name. So I call OpenNew in my applications IApplication method which
>eventually leads to a call to DoMakeWindows with a window template
>with a fixed name (no <<<>>>:s). This sets the window title all right,
>but the documents name is still Untitled-1 as can be seen when I try
>to save it. Question: Am I missing something simple or is this the
>way things are supposed to happen?

It is the way things are supposed to happen.  The default behavior isto give
new documents the Untitled name (although the exact name is in a resource).
There is a method called TDocument.UntitledName that is used to generate the
name.  You could override this for your "Worksheet" document class.

If it was just like MPW, then you would want to call OpenOld and pass it the
name of the Worksheet file.  It sounds like you do have a file that you want
to save and reopen.  If the file might not exist, then you can still call
OpenOld, but can catch the failure that would result and call OpenNew
instead.

Finally, the document object can override the default name used in the
SFPutFile dialog, but overriding TDocument.SFPutParms.

Let me know if this answers your question.

		 Larry Rosenstein,  Object Specialist
 Apple Computer, Inc.  20525 Mariani Ave, MS 46-B  Cupertino, CA 95014
	    AppleLink:Rosenstein1    domain:lsr@Apple.COM
		UUCP:{sun,voder,nsc,decwrl}!apple!lsr

rdominy@palantir.gsfc.nasa.gov (Robert Dominy) (02/03/90)

In article <131035@sun.Eng.Sun.COM> nano%urbina@Sun.COM (Fernando Urbina) 
writes:
> I created a view (fReceiveView) from a 'view' resource.
> This view is used as a status window of the communication
> that I'm doing through the serial port).  I want to update
> some static text on the fReceiveView (that is being 
> PoseModally'd at the time) depending on what the
> state of the communication is, i.e.  Dialing, logging in,
> verifying password, etc.  I also would like to have a 
> cancel button, so that the user could abort the communication
> at any time.  In essence, what I want to do is perform other
> tasks while my view is being PoseModally'd.  What's the
> right way of doing this?

I have two suggestions:

1) Break your connect method into several functions/methods that 
correspond to the steps of the process of your logging in.

2) Rather than overriding PoseModally, override the dialog's Idle method 
and do the processing (of connecting) at Idle time.  You will probably need a
field variable to keep track of your connection state.  The main advantage
of this is that when the Cancel button is clicked,  IT can handle the process
of cancelling and you don't have to put a bunch of checks for this event into
your code.

lsr@Apple.COM (Larry Rosenstein) (02/06/90)

In article <131035@sun.Eng.Sun.COM> nano%urbina@Sun.COM (Fernando Urbina) 
writes:

>         BringToFront(fReceiveView.GetWindow.fWMgrWindow);

I would use fReceiveView.GetWindow.Open here.

> 3.  In order to "update" the fReceiveView's TStaticText
>         that contains the communication status, I override
>         PoseModally.  

You could install a co-handler when you bring up the dialog (using 
TApplication.InstallCoHandler).  Cohandlers are subclasses of TEvtHandler 
and if you set their fIdleFreq field, their DoIdle method will get called 
when the application is idle.  (The fIdleFreq is that minimum time between 
calls to DoIdle.)

TApplication.PollEvent calls TApplication.Idle, which gives idle time to 
all objects that need it.

You can also do this processing in your dialog view, by making a subclass 
of TDialogView.  Then you don't have to install a cohandler; as long as 
the dialog is active it's DoIdle method will get called.


Larry Rosenstein, Apple Computer, Inc.
Object Specialist

Internet: lsr@Apple.com   UUCP: {nsc, sun}!apple!lsr
AppleLink: Rosenstein1

kg1a+@andrew.cmu.edu (Kevin Michael Goldsmith) (11/15/90)

Is MacApp available to non-developers?  If not, how do I become a developer?

Thanks,
  Kevin Goldsmith
kg1a+@andrew.cmu.edu
kmg@isl1.ri.cmu.edu

Disclaimer: Disclaimer, I don't need no stinkin disclaimer.

ech@cbnewsk.att.com (ned.horvath) (11/15/90)

From article <YbENMEW00Vox08AlVJ@andrew.cmu.edu>, by kg1a+@andrew.cmu.edu (Kevin Michael Goldsmith):
> Is MacApp available to non-developers?  If not, how do I become a developer?

MacApp is available to anyone with a phone and a credit card...

Use the phone to call APDA, 800.282.2732.

Use the credit card to order
	MacApp				M7022/D		 275
but you'll also need:
	MPW Object Pascal Bundle	B0030LL/E	$400
or
	MPW C Bundle			B0031LL/E	$400
	MPW C++				M0346LL/A	 175
or
	MPW C & Object Pascal Bundle	B0032LL/E	$525
	MPW C++				M0346LL/A	 175

As you can see, it ain't cheap.  However, if you buy the high-priced 
spread (Pascal, C++, and MacApp, total $975), you can also subscribe to
ETO for only another $300/year, to protect your investment.  (ETO is
distributed on CDROM only.)  This is actually an IMPROVEMENT on the old
scheme, which required you to buy the beta versions as they came out,
and still had to buy the release version.  It was easier to sell my
managment on the idea of a fixed-cost subscription, your mileage may vary.
If you haven't a CDROM drive, you can just buy the updates as they emerge.

BTW, before you ask, these prices are for everybody -- partners,
associates, APDA members, or anybody off the street.  And the updates 
aren't all that costly once you've paid off the original mortgage.

There are those who claim that C++/MacApp also requires a ][fx and 20Mb
of RAM, but perhaps you're more patient.

=Ned Horvath=

c89andma@odalix.ida.liu.se (Andreas Magnusson) (11/19/90)

ech@cbnewsk.att.com (ned.horvath) writes:

>From article <YbENMEW00Vox08AlVJ@andrew.cmu.edu>, by kg1a+@andrew.cmu.edu (Kevin Michael Goldsmith):
>> Is MacApp available to non-developers?  If not, how do I become a developer?

>MacApp is available to anyone with a phone and a credit card...

>=Ned Horvath=

Yepp, that's right. But I have THINK Pascal 3.0 and it say's in the manual
that you can use MacApp with it. 

Don't forget the alternatives!

Andreas Magnusson	Student of Computer Science Linkoping Sweden
Internet	c89andma@odalix.ida.liu.se