Multiple Monitors
Volume Number: 10
Issue Number: 7
Column Tag: There’s a right way...
Related Info: Window Manager Dialog Manager Standard File
Quickdraw
Multiple Monitors vs. Your Application
Assume one monitor, go to jail...
By Eric Shapiro, Rock Ridge Enterprises
Note: Source code files accompanying article are located on MacTech CD-ROM or
source code disks.
About the author
Eric earned fame with his big-hit, glam-hack VideoBeep, first shown at MacHack
as a prize-winning entry in the MacHax™ Best Hack contest. When he’s not busy
writing his next hack for MacHack, Eric is president of Rock Ridge Enterprises, a
Macintosh consulting firm. His other smash hits include Spectator, EzTape, Business
Simulator, and (the now illegal) The Grouch.
Eric is currently working on course materials for Apple Developer University’s
OpenDoc seminar. He has taught Macintosh Programming Fundamentals and Macintosh
Device Drivers seminars for Apple as well. Eric has degrees in both Computer and
Electrical Engineering from the University of Michigan and is a past president of
MacTechnics Users Group.
You can reach Eric at Shapiro@aol.com
[Eric, otherwise way-too-busy-to-write-an-article, found a reason to sound
off. The result? A stream-of-consciousness gripe piece with some useful
information. If you’d like to see more of these kinds of articles, please let us know.
Better yet, pick your favorite gripe about software done the wrong way, and write up
your own “There’s a right way” article. - Ed stb]
I am writing this article because I’ve recently come across 5 new Mac programs
in the last few weeks that don’t support multiple monitors correctly. I’m getting sick
of rebooting, and of explaining the various problems to the companies involved, so I’m
going to send them a copy of this article instead.
Like many programmers, my main screen is a 2-page b&w display while my
second screen is a 13” color display. Several of the programs I’ve been running have
problems with all 2 monitor systems. Other programs run properly on some 2
monitor setups, but get confused when the main device has a lower depth than the
second one.
Here’s a checklist for writing well-behaved Macintosh software:
Open windows on the proper screen
New document windows should be opened on the same screen as the parent
window. If there is no parent window, use the main screen (or, if you want to be
really cool, use whichever screen was most recently used for a document).
It is easiest to create windows invisibly, add controls and other items to the
window, position and resize it, and then make it visible. A new version of one popular