The week of Mac bugs
This week has been mostly about making the Mac build of Scribe more polished. It's always lagged behind the Windows build. And now it's catching up fast:

1) HIViewSetFrame inside kEventControlDraw is bad

For many years I couldn't work out why some calls to HIViewSetFrame wouldn't work inside some application I was writing. It turns out that called that inside the kEventControlDraw callback is actually bad. It leaves lots of the controls half painted of showing the previous contents of the screen. And no amount of calling HIViewSetNeedsDisplay is going fix it. The compositor thinks the old position of the control is up to date and won't repaint it.

Ultimately if you find you need to move a control during the re-paint you have to send a message to yourself and do it after that particular repaint has finished.

2) Apple Event handling

After 4 years I finally found the reason why Lgi apps wouldn't respond to AppleEvents that were passed to them on startup. I answered my own stack overflow question today.

3) Editing the Application Menu

The Scribe Application menu, that sits between the Apple menu and File menu has never had the normal "About" and "Preferences" items. And while there is a lot of discussion on how to do that for Cocoa apps, there is little to no information for Carbon apps. And yes, Scribe is still a Carbon app, although it does use a bunch of modern APIs for text and so on. I tried mixing some Cocoa calls to get at the right menu, but that didn't work. Then after hours of searching the internet I finally stumbled on to a mailing list post that describes how to do it. So it seems it's possible, just really obscure.

Tags: mac carbon | (0) Comments | Add Comment

Core Text LOL

Sometimes you just have to laugh.

I let XCode 7 install. And now I get the choice of the 10.11 SDK or the 10.11 SDK. Apple have finally removed the ATSUI API I was using to draw text in my Mac ports, causing compilation errors. So time to pull out the partially complete CoreText implementation and get that working.

Not quite there yet ;)

Tags: scribe mac | (1) Comment | Add Comment

XCode: error from debugger: the program being debugged is not being run.
If you are getting this in your XCode run log:
No executable file specified.
Use the "file" or "exec-file" command.
No executable file specified.
Use the "file" or "exec-file" command.
The program being debugged is not being run.
The program being debugged is not being run.
After copying a project and renaming everything... then you missed the "executable name" on the target. Click your Target, and "Get Info", then click the Properties tab, and rename the Executable to the same name as the Product Name in the Build settings.

Tags: mac xcode | (0) Comments | Add Comment

Mac OS X Software Update fails to update installed application.
I've just managed to "fix" an issue that I was seeing on 10.6 where Software Update would not update Logic Express. According to Software Update, Logic wasn't even installed, however the app was there in /Applications and would run fine.

It seems that getting Software Update to re-scan that app is as simple as renaming the app. I changed the name of Logic Express from "Logic Express 9.0.1" to just "Logic Express", ran Software Update again and the latest release for Logic magically appeared. Hmmm.

So the next time Software Update is ignoring your installed apps you know what to do!

Tags: macosx | (0) Comments | Add Comment

Mac Mini RAM Upgrade
I found this guide nailed upgrading the RAM in a Mac mini. Tonight I took out the paltry 1GB and replaced it with 4GB for about $33 AUD. Not bad... not bad ;) The mini runs all the servers (imap, svn, http) in the house, because at 14w it's the cheapest computer to run 24/7. The iMac is 70w at idle, and the PC up around 110w. Yay for minis!

Tags: mac upgrade | (0) Comments | Add Comment

Scribe/Mac unified toolbar
I got this working today:
Looks a little more native eh? I think the icons are still a little blurry, but to fix that I'll have to create full resolution source icons, which are 128x128. Currently they are 24x24, and they are getting scaled somewhat for display on the toolbar. First x4 to fill the 128x128 source image and then down to whatever size the HIToolbar wants to display them as.

I've been playing for years now with getting native scrollbars working. But thats proven too difficult so far for this little black duck.

Tags: mac code | (0) Comments | Add Comment