FB II Compiler







Disk I/O














Made with FB


Put correctly a DITL into a CDEV

<< I'm starting to write a control panel by modifying the shell that came with FB. So far I've tried to put my own DITL in place of the one that was there before. Now when I compile the cdev and double-click on it, the dialog items are displayed too far to the left. I've checked my nrct resource and it looks fine. Now I'm stumped. Any help would be appreciated. >>
<< Check wether coords are global, or window based... This sounds like a LOCALTOGLOBAL or GLOBALTOLOCAL problem >>

Good hypothesis, but the coords are specified in a resource. I did some peeking around some system control panels and it turns out that the -4064 DITL resource for control panels always has the items moved over to the right, leaving a substantial white space on the left. Seems like a workaround for a bug, and there appears to be no documentation for it. Anyways, I copied the technique and solved my problem.


Long long ago, there was a desk accessory named "Control Panel". This was basically an interface to the PRAM, allowing you to specify key repeat rates, mouse tracking, system clock, and other oddments.

As time went on, more gadgets crept into this cute little desk accessory, until it threatened to split the 512x342 bounds of an original Mac screen. What's more, third party developers were tired of writing entire DAs to configure things.

So Apple rewrote the Control Panel. It became a collection of modules, all viewed through the "Control Panel" desk accessory. You switched modules by clicking icons in a scrolling list on the left.

Control Panel managed its contents with the Dialog Manager's help. So each cdev specified its contents with a DITL resource. Whenever you switched modules, Control Panel cut off the end of the dialog item list (removing the old cdev's interface) and appended the contents of the new DITL (adding the new cdev's interface).

Since each interface was viewed within the Control Panel, these DITLs had to leave space on the left margin for the scrolling list.

Forward to System 7.0: the Control Panel was merged into the Finder. Instead of a scrolling list, the Finder had a folder containing cdev files. Each cdev got its own window. To make all the old cdevs compatible with the new system, Finder offset the cdev window's origin by the same number of pixels as the scrolling list had taken up.

And that's why items are moved over to the right, leaving a substantial whitespace on the left, in far more detail than you probably ever wanted to know.

Incidentally, there is a more elegant replacement for the whole kludgey system, starting with MacOS 7.5. Any app with file type 'APPC' is considered a control panel. This is a much easier and safer way to do a control panel than the old 'cdev' system.

You can use PG:PRO and the entire FB runtime, if you like.