TweetFollow Us on Twitter

Mar 90 Letters
Volume Number:6
Issue Number:3
Column Tag:Letters

Related Info: Resource Manager Dialog Manager Notification Mgr

PICT and FCMT Resources

By David E. Smith, Editor & Publisher, MacTutor

Dialog boxes in general and PICT resources in dialogs

Neil Ticktin, Truin Software

Letter to Tron in response to Mousehole report in January, 1990 issue

I ran into the same problem with pictures. The problem lies with ResEdit™’s term of “Send to Back”. It turns out that while editing the item (and this is any item, not just a PICT) in ResEdit, the item must be in front of the other items for the Dialog Manager to think of it as in back of those same items. In ResEdit, “Send to back” means make this item the lower item number, but the Dialog Manager thinks of the frontmost item with the lower number. If you just give your picture the higher item number, it should work fine.

Also, if you are using modal dialogs in either THINK or MPW Pascal or C, it would really pay for you to look into Extender DialogHandler™. It contains over 160 routines which significantly decrease the time required to write support code for completely functional modal dialogs. You can get it or product information from Invention Software (313) 996-8108, but if you call MacTutor’s Mail Order store maybe they’ll be able to get it for with their standard store discount. Also, there is a product review in the January, 1990 issue of MacTutor.

Amusing undocumented feature

Ken Manly

Buffalo Chip Software

Buffalo, NY

Your readers may be amused by an ‘undocumented feature’ that Forrest Tanaka (MacDTS) and I discovered. If you create an Apple menu using ResEdit, there are two ways you can type the apple symbol into the menu title field. If you type control-T, the value stored will be $14, and all will be well.

If you type shift-command-K (which is what Key Caps suggests) you will get a menu which looks and acts like an Apple menu, but it is not recognized by Notification Manager routines (in System 6.x). The first symptom is that when your alarm clock goes off while your application is running, the alarm icon (which should alternate with the apple) never appears. Thanks to Forrest for guessing there was something wrong with my apple, although he had no way of knowing what.

ADB??

Kirk Chase

Anaheim CA

It seems someone did not know what the acronym “ADB” meant in a recent article. “ADB” stands for “Apple’s Desktop Bus”. It was introduced with the new keyboard. It allows the chaining of serial devices such as keyboards, mice, tablets, and so on to the Mac.

If you would like more information on ADB, there is an article by Dave Kelly and David Smith in the March '89 issue. It explains some of the concepts. In their example , they demonstrate some simple communication with the ADB extended keyboard. It also references Tech Note #206. You can more find information on the Apple Desktop Bus in Inside Macintosh Vol. V.

MacFortran subroutines from MPW Assembler

Bob Robinson

Plainfield NJ 07060

One of the first things I needed after buying MPW was a way to get the files from the assembler into a format that could be used as a subroutine by Absoft MacFortran (chemists aren’t instructed in ‘C’ in college or grad school.) MacFortran subroutines can be speeded up dramatically (also true of other languages) by hand-tuning the compiler’s assembly language output. The Fortran program listed below strips out the unneeded bytes from the MPW assembler object file. The resulting file is callable from MacFortran as a subroutine, which can be loaded dynamically or linked in with the main program. Also listed below is a short assembly language Fortran function for compilation by MPW. The function locks down a Mac memory manager handle and returns a pointer. MacFortran expects function results to be returned in register D0, so the subroutine must save the result in D0 before exiting (the toolbox traps used here happen to use D0.) If it’s to be loaded dynamically by MacFortran, the subroutine must preserve A0. Note: makesub displays the subroutine name in the menu bar, to avoid the Fortran TTY window (compile with ‘O’ option.)

*****************************************************************************************
 program makesub

* R.S. Robinson 6/12/89
* Converts MPW Asm ‘.a.o’ files into MacFortran ‘.sub’ files.
* File name is obtained from clipboard.
* Removes 1st 36 bytes, and last 8 bytes (44 bytes smaller)
 implicit none   ! always a good idea
 include toolbx.par! MacFortran toolbox definitions
 integer i,j,toolbx,htoptr,length,scrap_h,scrapptr
 integer*1 subr(16384)  ! can make bigger if needed
 character*6 fname ! subroutine names always ¾ 6 chars long plus ‘.sub’
 logical*4 exists! error checking
 scrap_h=toolbx(NEWHANDLE,0)! needs a dummy handle
 length=toolbx(GETSCRAP,scrap_h,”TEXT”,i)    ! we don’t use i

* funct ‘htoptr’ locks handle & returns 32bit comptble ptr;
* or use toolbox calls: call toolbx(HLOCK,scrap_h);scrapptr=LONG(scrap_h)
 scrapptr=htoptr(scrap_h)
 fname=’’;if (length>6) length=6
 do (i=1,length);fname(i:i)=CHAR(BYTE(scrapptr+i-1));repeat
 call toolbx(HUNLOCK,scrap_h) ! finished with the scrap, release the 
handle
 inquire (file=TRIM(fname)//’.a.o’,exist=exists)
 if (.NOT.exists) stop
 call toolbx(INSERTMENU,toolbx(NEWMENU,20,char(length)//fname),0)
 call toolbx(DRAWMENUBAR) ! show that we found the file
 open(20,file=fname//’.a.o’,form=’unformatted’,recl=1)
 do (i=1,36);read(20,end=100) subr(i);repeat ! skip 1st 36 bytes
 do (i=1,16384);read(20,end=100) subr(i);repeat ! read the ‘.a.o’ file
100close(20);i=i-9 ! ignore last 8 bytes plus loop overrun
 open(20,file=fname//’.sub’,status=’new’,form=’unformatted’,recl=1)
 do (j=1,i);write(20) subr(j);repeat;close(20) ! write ‘.sub’ file
 end

*****************************************************************************************

* Assemble the code below with MPW Asm, then run ‘makesub’ after copying 
‘htoptr’
* to the clipboard in MPW. The ‘makesub’ program will produce a MacFortran-compatible
* subroutine from the MPW ‘a.o’ file. As set up here, ‘makesub’ must 
be in the same
* folder as the ‘.a.o’ file. The MPW command sequence is:
*
*(copy ‘htoptr’ to clipboard, then)
*Asm [pathname:]htoptr.a
*[pathname:]makesub (must remove ‘ apl’ extension from Fortran program)
*
;integer*4 function htoptr(handle)
; R.S. Robinson 6/12/89
; Takes ‘handle’ as argument, returns locked pointer as function result.
; Function results are obtained by MacFortran from register D0.
;
 INCLUDE ‘Traps.a’ ; MPW equates
Start PROC; needed for MPW
HTOPTR: MOVE.L A0,A2 ; preserve A0 for MacFortran
 MOVEA.L4(A7),A0 ; load pointer to ‘handle’ argument
 MOVE.L (A0),A0  ; load ‘handle’
 _MoveHHi ; move handle to top of heap zone
 _HLock ; lock it
 MOVE.L (A0),D0  ; convert to pointer, ready to strip
 _StripAddress   ; it’s now ’32-bit clean;’ result is in D0
 MOVE.L A2,A0    ; restore A0
 RTS    ; all done; return to Fortran
 END

File Comments

John I. Prugh

Tucson, AZ

First of all, I would like to thank you for providing a really informative and high quality journal to those of us interested in using and programming on the Mac. Thanks to you (and people like Richard Clark and Chuck Rusch) all the keys on my Mac’s keyboard work again and the flicker is gone from the screen, and some things make a lot more sense now

Secondly, I have a couple of questions you might be able to answer for me or redirect to someone who can. I would like to write a routine that would enable me to insert new information into the comment field of a file’s Get Info window. As far as I can tell, this data is maintained in resources in the DeskTop file called FCMTs. I can’t find any information regarding FCMTs in Apple’s Inside Macintosh.

Can you tell, me how the DeskTop knows which FCMT belongs to which file? How would I go about updating the FCMT for an arbitrary file without invoking Get Info from the standard Finder File menu.

I also have a question about Desk Accessories. Is it possible for a desk accessory to close itself, or does it always require the user to click on the DA window’s close box? If a DA can close itself, how does it do it?

Once again, thank-you for a good magazine and the worthwhile information you pack into it. (You probably think people say these nice things just so they’ll get a reply )

[Ok, a DA can close itself. As to when, that is up to the DA- Close box, menu selection, etc. You then send a CloseDriver() passing it the driver reference number (This message is passed automatically when the close box is clicked). This will then send your driver a close message. If you are using THINK C, this means the entry point selector will be 4. You then need to close any files, release any memory you may have allocated, delete and dispose of any menu you may of put up (redraw the menu bar afterwards), and dispose of any window you created.

On FCMTs, I will refer you to Technical Note #29. In it, they say the resource are for “reading” only for the Finder’s sake. But they also say that the comments are not preloaded when the DeskTop is opened, so I imagine you might not cause too much trouble. On HFS volumes you call PBGetCatInfo (Read Inside Macintosh Vol. IV, page 155 and Tech Note #69). The comment ID for a file is kept in ioFlXFndrInfo.fdComment and for a folder it is in ioDrFndrInfo.frComment. Then with the Resource Manager, you can open up the desktop file and get the FCMT with that ID. It is just a Pascal string. Typecast it, change it, and follow the procedure outlined in the resource manager to change it. I believe this will change the file comment.-ed]

Speeding Up Development

MacAnalyst 2.0 and MacDesigner 3.0

Excel Software

Excel Software has released upgraded versions of their CASE tools for the Macintosh. MacDesigner can be used to automate the structured design process or document existing software. MacAnalyst automates the process of analyzing complex systems by expressing it in graphic notations. Some of their new features include additions for designing object oriented structure, and an advanced global rename capability. For more information, contact Excel Software at:

P.O. Box 1414

Marshalltown, IA 50158

(515) 752-5359

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Aether Gazer unveils Chapter 16 of its m...
After a bit of maintenance, Aether Gazer has released Chapter 16 of its main storyline, titled Night Parade of the Beasts. This big update brings a new character, a special outfit, some special limited-time events, and, of course, an engaging... | Read more »
Challenge those pesky wyverns to a dance...
After recently having you do battle against your foes by wildly flailing Hello Kitty and friends at them, GungHo Online has whipped out another surprising collaboration for Puzzle & Dragons. It is now time to beat your opponents by cha-cha... | Read more »
Pack a magnifying glass and practice you...
Somehow it has already been a year since Torchlight: Infinite launched, and XD Games is celebrating by blending in what sounds like a truly fantastic new update. Fans of Cthulhu rejoice, as Whispering Mist brings some horror elements, and tests... | Read more »
Summon your guild and prepare for war in...
Netmarble is making some pretty big moves with their latest update for Seven Knights Idle Adventure, with a bunch of interesting additions. Two new heroes enter the battle, there are events and bosses abound, and perhaps most interesting, a huge... | Read more »
Make the passage of time your plaything...
While some of us are still waiting for a chance to get our hands on Ash Prime - yes, don’t remind me I could currently buy him this month I’m barely hanging on - Digital Extremes has announced its next anticipated Prime Form for Warframe. Starting... | Read more »
If you can find it and fit through the d...
The holy trinity of amazing company names have come together, to release their equally amazing and adorable mobile game, Hamster Inn. Published by HyperBeard Games, and co-developed by Mum Not Proud and Little Sasquatch Studios, it's time to... | Read more »
Amikin Survival opens for pre-orders on...
Join me on the wonderful trip down the inspiration rabbit hole; much as Palworld seemingly “borrowed” many aspects from the hit Pokemon franchise, it is time for the heavily armed animal survival to also spawn some illegitimate children as Helio... | Read more »
PUBG Mobile teams up with global phenome...
Since launching in 2019, SpyxFamily has exploded to damn near catastrophic popularity, so it was only a matter of time before a mobile game snapped up a collaboration. Enter PUBG Mobile. Until May 12th, players will be able to collect a host of... | Read more »
Embark into the frozen tundra of certain...
Chucklefish, developers of hit action-adventure sandbox game Starbound and owner of one of the cutest logos in gaming, has released their roguelike deck-builder Wildfrost. Created alongside developers Gaziter and Deadpan Games, Wildfrost will... | Read more »
MoreFun Studios has announced Season 4,...
Tension has escalated in the ever-volatile world of Arena Breakout, as your old pal Randall Fisher and bosses Fred and Perrero continue to lob insults and explosives at each other, bringing us to a new phase of warfare. Season 4, Into The Fog of... | Read more »

Price Scanner via MacPrices.net

Boost Mobile will sell you an iPhone 11 for $...
Boost Mobile, an MVNO using AT&T and T-Mobile’s networks, is offering an iPhone 11 for $149.99 when purchased with their $40 Unlimited service plan (12GB of premium data). No trade-in is required... Read more
Free iPhone 15 plus Unlimited service for $60...
Boost Infinite, part of MVNO Boost Mobile using AT&T and T-Mobile’s networks, is offering a free 128GB iPhone 15 for $60 per month including their Unlimited service plan (30GB of premium data).... Read more
$300 off any new iPhone with service at Red P...
Red Pocket Mobile has new Apple iPhones on sale for $300 off MSRP when you switch and open up a new line of service. Red Pocket Mobile is a nationwide MVNO using all the major wireless carrier... Read more
Clearance 13-inch M1 MacBook Airs available a...
Apple has clearance 13″ M1 MacBook Airs, Certified Refurbished, available for $759 for 8-Core CPU/7-Core GPU/256GB models and $929 for 8-Core CPU/8-Core GPU/512GB models. Apple’s one-year warranty is... Read more
Updated Apple MacBook Price Trackers
Our Apple award-winning MacBook Price Trackers are continually updated with the latest information on prices, bundles, and availability for 16″ and 14″ MacBook Pros along with 13″ and 15″ MacBook... Read more
Every model of Apple’s 13-inch M3 MacBook Air...
Best Buy has Apple 13″ MacBook Airs with M3 CPUs in stock and on sale today for $100 off MSRP. Prices start at $999. Their prices are the lowest currently available for new 13″ M3 MacBook Airs among... Read more
Sunday Sale: Apple iPad Magic Keyboards for 1...
Walmart has Apple Magic Keyboards for 12.9″ iPad Pros, in Black, on sale for $150 off MSRP on their online store. Sale price for online orders only, in-store price may vary. Order online and choose... Read more
Apple Watch Ultra 2 now available at Apple fo...
Apple has, for the first time, begun offering Certified Refurbished Apple Watch Ultra 2 models in their online store for $679, or $120 off MSRP. Each Watch includes Apple’s standard one-year warranty... Read more
AT&T has the iPhone 14 on sale for only $...
AT&T has the 128GB Apple iPhone 14 available for only $5.99 per month for new and existing customers when you activate unlimited service and use AT&T’s 36 month installment plan. The fine... Read more
Amazon is offering a $100 discount on every M...
Amazon is offering a $100 instant discount on each configuration of Apple’s new 13″ M3 MacBook Air, in Midnight, this weekend. These are the lowest prices currently available for new 13″ M3 MacBook... Read more

Jobs Board

Omnichannel Associate - *Apple* Blossom Mal...
Omnichannel Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Operations Associate - *Apple* Blossom Mall...
Operations Associate - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Read more
Cashier - *Apple* Blossom Mall - JCPenney (...
Cashier - Apple Blossom Mall Location:Winchester, VA, United States (https://jobs.jcp.com/jobs/location/191170/winchester-va-united-states) - Apple Blossom Mall Read more
IT Systems Engineer ( *Apple* Platforms) - S...
IT Systems Engineer ( Apple Platforms) at SpaceX Hawthorne, CA SpaceX was founded under the belief that a future where humanity is out exploring the stars is Read more
*Apple* Systems Administrator - JAMF - Activ...
…**Public Trust/Other Required:** None **Job Family:** Systems Administration **Skills:** Apple Platforms,Computer Servers,Jamf Pro **Experience:** 3 + years of Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.