[futurebasic] About Window

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : March 2008 : Group Archive : Group : All Groups

From: Ken Shmidheiser <kshmidheiser@...>
Date: Mon, 3 Mar 2008 20:00:41 -0500
Bob asked:

> I've borrowed Ken S's code form the Scripts in FB to made
> an AutoMacFormat About Window. Problem is I can't get it
> to close from the close box. Suspect it is something to do with
> window i.d.'s. My main program window is MAFWnd = 3


Are you sure I wrote that code?!??!   :-)

At any rate, declare the following when building your first window,  
and that will set the default for each window build there after.

/*
_kWindowCenterOnMainScreen
_kWindowCascadeOnMainScreen

_kWindowAlertPositionOnMainScreen

*/
  Def NewWindowPositionMethod( _kWindowAlertPositionOnMainScreen )



To later reposition a window, use the following on each subsequential  
window as it's built, if you desire it's location to be other than  
that declared by  Def NewWindowPositionMethod.

Note that the second parameter of this function, parentRefNum&, can  
be set to 0 if the window to be repositioned is not being positioned  
in relation to any other window.

/*

_kWindowCenterOnMainScreen

_kWindowCenterOnParentWindow
_kWindowCenterOnParentWindowScreen
_kWindowCascadeOnMainScreen
_kWindowCascadeOnParentWindow
_kWindowCascadeOnParentWindowScreen
_kWindowAlertPositionOnMainScreen
_kWindowAlertPositionOnParentWindow
_kWindowAlertPositionOnParentWindowScreen

*/

Def WindowReposition( wRefNum& , parentRefNum&, positionMethod )



> Also I presume I have to add a timed out routine if the user
> doesn't click close box.


Under OS X, it's considered good from to allow the user to quit the  
About Window using the window close button, rather than timing it.

Some programs display a Splash Screen when launched-- sometimes the  
same window as the About Window, but not necessarily so-- and Splash  
Screen open duration is usually controlled with a timer.

Please note there are much better ways to do this nowadays, but they  
can be a little more complicated with nibs and Carbon Events.

That said, I fully understand the gratification of seeing your Splash  
and About windows in action.

Ken