TweetFollow Us on Twitter

Dec 97 - Macintosh Q and A

Volume Number: 13 (1997)
Issue Number: 12
Column Tag: develop

Macintosh Q & A

by Apple Developer Support Center

White Backgrounds for Dialog editText Items

Q. I would like to have a colored background for my dialog box but I would like the TextEdit fields in my dialog box to be white. Is this possible to do? Is there some sample code available?

A. Generally speaking, this coloring is achieved via resources, not code. In addition to the dctb' resource, you need to create an 'ictb' resource.

To download a sample of an application using this kind of resource go to http://devworld.apple.com/dev/qa/tb/tb3.html.

The 'ictb' resource is documented on page 6-76 and starting again on page 6-158 of Inside Macintosh: Macintosh Toolbox Essentials. The best way I know of to create and edit 'ictb' resources is with Resorcerer, but you can also create them with a '.r' file compiled by either MPW's Rez or the Metrowerks CodeWarrior equivalent.

Here are some references to web sites for the aforementioned tools:

Resorcerer:
http://www.mathemaesthetics.com/
ETO (incl. Rez):
http://www.devtools.apple.com/eto/
CodeWarrior:
http://www.metrowerks.com/

If this response has failed to adequately address a question or has raised more questions than it answered, please feel free to let us know and we'll try again.

Pete Gontier


OTScheduleDeferredTask When Task Running

Q. What happens when you use OTScheduleDeferredTask to schedule a task that is running?

A. The "Open Transport Client Note" mentions that OTScheduleDeferredTask returns false when you attempt to schedule a task that is already scheduled, but it doesn't say anything about what happens if the task is running. It turns out that a task that is running is not consider to be scheduled, so OTScheduleDeferredTask will successfully reschedule it.

Quinn "The Eskimo!"


Gestalt Values for Recent Macintosh Models

Q. What are the 'mach' gestalt values for the recent Macintosh models?

A. Recently, we announced the following new Macintosh models:

PowerBook 2400

The following list includes the 'mach' gestalt selectors for these and other Macintosh systems which are not included in the Gestalt.h header file which is part of the "Universal Interfaces 2.1 in MPW Latest" on ETO #22.

  • gestaltPerforma5300 = 41; { Macintosh Performa 53xx }
  • gestaltPowerMac5260 = 41; { Power Macintosh 5260/100 }
  • gestaltPerforma6300 = 42; { Macintosh Performa 63xx, except 6360 }
  • gestaltPerforma6360 = 58; { Performa 6360 }
  • gestaltPerforma6400 = 58; { Performa 6400 }
  • gestaltPowerMac9600 = 67; { Power Macintosh 9600
  • gestaltPowerMac7600 = 68; { Power Macintosh 7600 }
  • gestaltPowerMac8600 = 69; { Power Macintosh 8600 }
  • gestaltPowerMac5400 = 74; { Power Macintosh 5400/120}
  • gestaltMacLC580 = 99; { Macintosh LC 580 }
  • gestaltPerforma580 = 99; { Macintosh Performa 580 }
  • gestaltPowerMacLC475 = 104; { Mac LC 475 & PPC Processor Upgrade Card }
  • gestaltPowerMacPerforma47x = 104; { Performa 47x & PPC Proc Upgrade Card }
  • gestaltPowerMacLC575 = 105; { Mac LC 575 & PPC Processor Upgrade Card }
  • gestaltPowerMacPerforma57x = 105; { Performa 57x & PPC Proc Upgrade Card }
  • gestaltPowerMacQuadra630 = 106; { Quadra 630 & PPC Processor Upgrade Card }
  • gestaltPowerMacLC630 = 106; { Mac LC 630 & PPC Processor Upgrade Card }
  • gestaltPowerMac7300 = 109; { Power Macintosh 7300 }
  • gestaltPowerMacQuadra700 = 116; { Quadra 700 & Power PC Upgrade Card }
  • gestaltPowerMacQuadra900 = 117; { Quadra 900 & Power PC Upgrade Card }
  • gestaltPowerMacQuadra950 = 118; { Quadra 950 & Power PC Upgrade Card }
  • gestaltPowerMacCentris610 = 119; { Centris 610 & Power PC Upgrade Card }
  • gestaltPowerMacCentris650 = 120; { Centris 650 & Power PC Upgrade Card }
  • gestaltPowerMacQuadra610 = 121; { Quadra 610 & Power PC Upgrade Card }
  • gestaltPowerMacQuadra650 = 122; { Quadra 650 & Power PC Upgrade Card }
  • gestaltPowerMacQuadra800 = 123; { Quadra 800 & Power PC Upgrade Card }
  • gestaltPowerBook3400 = 306; { Macintosh PowerBook 3400 }
  • gestaltPowerBook2400 = 307; { Macintosh PowerBook 2400 }
  • gestaltPowerBook1400 = 310; { Macintosh PowerBook 1400 }
  • gestaltPowerMac5500 = 512; { Power Macintosh 5500 }
  • gestalt20thAnnivMac = 512; { Twentieth Anniversary Macintosh }
  • gestaltPowerMac5500 = 512; { Power Macintosh 5500 }
  • gestaltPowerMac6500 = 513; { Power Macintosh 6500 }
  • gestaltPowerMac4400 = 515; { Power Macintosh 4400 }

Note: To distinguish the Twentieth Anniversary Macintosh from the Power Macintosh 5500, make a secondary Gestalt selector call to the selector 'bxid'. The response for a Twentieth Anniversary Macintosh will be 0x0000302B

Rich Kubota


Find Desktop Folder

Q. The General control panel (GCP) in 7.6, 7.6.1 and 8.0 has the document options: Last folder, Application set folder, and Documents folder. How can my application determine where this folder is?

A. The General control panel (GCP) patches FindFolder so it will return the correct document folder given the current GCP options. Pass FindFolder a folderType of 'docs'. One quick note: Because the GCP patches FindFolder, the createFolder option doesn't work. If the folder doesn't exist you won't get an error and it won't be created. You have to write code to determine if the folder actually exist: if it doesn't, you'll have to create it yourself.

George Warner


MemError

Q. When I am debugging my application MemError() always returns noErr. What's wrong with MemError()?

A. Nothing, if you are debugging your application with a high level debugger. High level debuggers often call Memory Manager routines while stepping through your code. When a Memory Manager routine is called, it sets MemError() and in this case, the debugger's memory request was successful (it returned noErr) and cleared your application's MemError() result.

The solution to this problem is often just to not step over Memory Manager calls and the call to MemError(). If you put a break point just after the MemError() call, you usually get the correct error -- the one your application would see if it wasn't running in the debugger.

The other option is to use a low level debugger such as MacsBug to debug your memory allocation problems.

As a general rule your application should check the value of the handle or pointer returned by NewHandle, NewPtr, etc: and if it is nil, you should call MemError() for an error number. Just calling MemError() without checking the value of the handle/pointer is not a good idea.

Mark Cookson

 

Community Search:
MacTech Search:

Software Updates via MacUpdate

Latest Forum Discussions

See All

Top Hat Studios unveils a new gameplay t...
There are a lot of big games coming that you might be excited about, but one of those I am most interested in is Athenian Rhapsody because it looks delightfully silly. The developers behind this project, the rather fancy-sounding Top Hat Studios,... | Read more »
Bound through time on the hunt for sneak...
Have you ever sat down and wondered what would happen if Dr Who and Sherlock Holmes went on an adventure? Well, besides probably being the best mash-up of English fiction, you'd get the Hidden Through Time series, and now Rogueside has announced... | Read more »
The secrets of Penacony might soon come...
Version 2.2 of Honkai: Star Rail is on the horizon and brings the culmination of the Penacony adventure after quite the escalation in the latest story quests. To help you through this new expansion is the introduction of two powerful new... | Read more »
The Legend of Heroes: Trails of Cold Ste...
I adore game series that have connecting lore and stories, which of course means the Legend of Heroes is very dear to me, Trails lore has been building for two decades. Excitedly, the next stage is upon us as Userjoy has announced the upcoming... | Read more »
Go from lowly lizard to wicked Wyvern in...
Do you like questing, and do you like dragons? If not then boy is this not the announcement for you, as Loongcheer Game has unveiled Quest Dragon: Idle Mobile Game. Yes, it is amazing Square Enix hasn’t sued them for copyright infringement, but... | Read more »
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 »

Price Scanner via MacPrices.net

Save $300 at Apple on 14-inch M3 MacBook Pros...
Apple has 14″ M3 MacBook Pros with 16GB of RAM, Certified Refurbished, available for $270-$300 off MSRP. Each model features a new outer case, shipping is free, and an Apple 1-year warranty is... Read more
Apple continues to offer 14-inch M3 MacBook P...
Apple has 14″ M3 MacBook Pros, Certified Refurbished, available starting at only $1359 and ranging up to $270 off MSRP. Each model features a new outer case, shipping is free, and an Apple 1-year... Read more
Apple AirPods Pro with USB-C return to all-ti...
Amazon has Apple’s AirPods Pro with USB-C in stock and on sale for $179.99 including free shipping. Their price is $70 (28%) off MSRP, and it’s currently the lowest price available for new AirPods... Read more
Apple Magic Keyboards for iPads are on sale f...
Amazon has Apple Magic Keyboards for iPads on sale today for up to $70 off MSRP, shipping included: – Magic Keyboard for 10th-generation Apple iPad: $199, save $50 – Magic Keyboard for 11″ iPad Pro/... Read more
Apple’s 13-inch M2 MacBook Airs return to rec...
Apple retailers have 13″ MacBook Airs with M2 CPUs in stock and on sale this weekend starting at only $849 in Space Gray, Silver, Starlight, and Midnight colors. These are the lowest prices currently... Read more
Best Buy is clearing out iPad Airs for up to...
In advance of next week’s probably release of new and updated iPad Airs, Best Buy has 10.9″ M1 WiFi iPad Airs on record-low sale prices for up to $200 off Apple’s MSRP, starting at $399. Sale prices... Read more
Every version of Apple Pencil is on sale toda...
Best Buy has all Apple Pencils on sale today for $79, ranging up to 39% off MSRP for some models. Sale prices for online orders only, in-store prices may vary. Order online and choose free shipping... Read more
Sunday Sale: Apple Studio Display with Standa...
Amazon has the standard-glass Apple Studio Display on sale for $300 off MSRP for a limited time. Shipping is free: – Studio Display (Standard glass): $1299.97 $300 off MSRP For the latest prices and... Read more
Apple is offering significant discounts on 16...
Apple has a full line of 16″ M3 Pro and M3 Max MacBook Pros available, Certified Refurbished, starting at $2119 and ranging up to $600 off MSRP. Each model features a new outer case, shipping is free... Read more
Apple HomePods on sale for $30-$50 off MSRP t...
Best Buy is offering a $30-$50 discount on Apple HomePods this weekend on their online store. The HomePod mini is on sale for $69.99, $30 off MSRP, while Best Buy has the full-size HomePod on sale... Read more

Jobs Board

*Apple* App Developer - Datrose (United Stat...
…year experiencein programming and have computer knowledge with SWIFT. Job Responsibilites: Apple App Developer is expected to support essential tasks for the RxASL Read more
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
*Apple* Software Engineer - HP Inc. (United...
…Mobile, Windows and Mac applications. We are seeking a high energy Senior Apple mobile engineer who can lead and drive application development while also enabling Read more
All contents are Copyright 1984-2011 by Xplain Corporation. All rights reserved. Theme designed by Icreon.