Signal 1.1.5

March 15th, 2009

A quick fix for Windows users, Signal 1.1.5 resolves a media library compatibility issue with Winamp 5.55 and later.

Sizing a Preference Pane Dynamically

March 10th, 2009

If you’ve tried to develop a system preference pane on the Mac that works across both Tiger and Leopard you may have run into a small but annoying problem: although the System Preferences window is resized to the height of your view it has a fixed width and does not resize your view to fit within that width. This renders any autoresizing rules applied to your view useless, so you end up with a preference pane that is either clipped on 10.4 and earlier or too small on 10.5 and later.

The Apple examples for handling this situation recommend creating two separate views sets: one set for 10.4 and earlier and another set for 10.5 and later. Unless your layout is significantly altered between the two OS versions this has some drawbacks. You now have two sets of views to build and maintain, and if a future version of OS X alters the System Preferences window size again you’re going to need yet another set.

Luckily there is a simple solution. Although System Preferences does not resize the width of our view for us we can do this ourselves quite easily by matching the content width of the System Preferences window.


- (void)mainViewDidLoad {
    NSRect rect = [[self mainView] frame];
    NSWindow *systemPrefsWindow = [[NSApplication sharedApplication] mainWindow];
    rect.size.width = [systemPrefsWindow contentRectForFrameRect:[systemPrefsWindow frame]].size.width;
    [[self mainView] setFrame:rect];
}

We could simplify this code a bit by using the superview’s frame or the contentView of systemPrefsWindow, but contentRectForFrameRect: is used for a couple of reasons. We need to resize the view before it is first displayed, but the superview will not have valid size information until didSelect, at which point our view is already on the screen. In addition, by obtaining the content rect from the window rather than the frame of the contentView we are making no assumptions about the size of whatever contentView currently represents.

This simple change sizes our main view to the width of the System Preferences window, our autoresizing rules are now applied, and viola: a single set of views that scales to a System Preferences window of any width.

Disable the Windows and Menu Keys in a VM

March 5th, 2009

If you use Windows in VMware Fusion or Parallels Desktop on your Mac you may have run into a small but annoying issue – pressing the left or right ⌘ key brings up the start menu or right-click menu even if the key is unbound in the virtual machine application.

To work around this issue I made a modification to John Haller’s excellent registry tweak for disabling the Windows key to create a single file that disables both the Windows and context menu keys in one go:

Registry Patch: Disable Windows and Menu Keys

One caveat: This file does make a change to the Windows registry, so use at your own risk. You can open the file in a text editor to see exactly what it modifies.

To install, download the .reg file into the guest OS, double-click it, approve the prompts, then restart Windows. The keys should now be ignored by Windows and you can ⌘-Tab or ⌘-Function Key without any more annoying menus.

We Have Crossed Some Strange Boundary

March 5th, 2009

For a while now I’ve thought about expanding the blog to include some posts on programming and the general business of writing and selling software, and after a lot of thought I’ve decided to ahead and do it.

I considered splitting off a personal blog for this kind of thing so that the Alloysoft site could be kept nice and clean, free from rants or indecipherable technical posts. But the more I thought about what I wanted to write the more I realized that a lot of it might well be of interest to customers. Even discussion of a technical topic can give insight into how a developer approaches their products and what they care about. It also helps to keep the site active, showing that work is ongoing and possibly giving a preview or two about what’s coming next.

I hope that some of what starts to show up here proves useful, and as always look forward to hearing your feedback. The beautiful thing about software is that if something doesn’t work out it’s usually not too hard to change back.

Signal 1.1.4

December 21st, 2008

Signal 1.1.4 is now available, this one is a Windows-only release that addresses an iTunes 8 compatibility issue with multiple speaker selection when more than 3 speakers are present. This issue is not present in the Mac version of Signal, so for OS X users the current version remains 1.1.3.