Archive

ctools Modals and Vertical Tabs

The Chaos tool suite (ctools) is collection of useful methods intended to help Drupal developers create complex interfaces without duplicating too much effort.

Drupal 7 introduced a new Form API element: Vertical Tabs. When you set a parent element as this Form API type, then any child elements that are of type fieldset are displayed as vertical tabs instead of as in the traditional fieldset. Unfortunately for us developers, the documentation does not provide an example of how to use Vertical Tabs properly, but with some trial and error you can do it.

However, this new Vertical Tab Form API element doesn’t work in modal multistep wizard forms created with ctools.

Apple Radar vs. Time

I recently filed an Apple Bug Report, which was marked as a duplicate. The actual bug isn’t terribly important, but the difference between the serial number of the bug I filed (10426480) and the serial number of its alleged duplicate (3323328) – about 7 million – surprised me. Just how old was this still-unfixed bug?

I slogged through the lists.apple.com archives and the bugs users have manually posted on openradar.appspot.com to compile a list of Radar Numbers and the dates they were filed, and ended up with this:

Reusable Views in iOS

Say you want to create a UIView that you’re going to display in multiple places in your app.

Maybe you want to design a custom UITableViewCell or AQGridViewCell. Or maybe you want to create a view controller that can be displayed by several different view controllers in your app. Or maybe you want to create a custom UI widget that shows up multiple times in a view.

Does this mean you have to make the view programmatically? Is it time to break out the setFrame and the addSubview and the setTextColor and the addTarget:action:forControlEvents:?

Nope! You can still design your views in Interface Builder. Here’s how.

Git-ing Drupal contrib patches done

In not-so-recent news, Drupal migrated the drupal.org project repository from CVS to Git in late February, 2011. My experience with Git previous to this has been as a user fetching source code of x.org, mesa, dri, and other various Linux and Unix projects.

As a user, not a developer, I found the Git work flow confusing. I did not need to make local commits and it was hard to wrap my head around bringing in changes from multiple remote repositories.

As a PHP developer, I first grasped the work flow at Columbus GiveCamp 2010 when I needed to make a github account for the branch of the Audio module we hacked on. As well, some Ruby guy had a nice Git work flow diagram, which I promptly forgot all about until the not-so-recent event above.

Are you sure you want to localize?

It’s a wonderful fact about the world that humans have thousands of living languages. And a wonderful fact about many software development environments that they provide ways to create versions of applications localized into the most common of those languages. But before localization (or should I say world-readiness) sweeps you off your feet, let me tell you about some unexpected difficulties with Kineme’s first localized application.

When did Firebug get so terrible?

Firebug is one of those vital extensions for web developers and designers who use Firefox. I have been faithfully updating it whenever it whines at me to update it, which is usually every minor version, and it pretty much just works. Firebug and I have a romance of debugging HTML, CSS, and more recently the Javascript and JQuery that I use in Select Other, Processing, and some more recent custom development for Slight High.

The honeymoon ended recently…

Example of IOSurfaceCreateMachPort and IOSurfaceLookupFromMachPort

The IOSurface framework lets you pass a reference to an IOSurface — a kind of pixel buffer — from one process to another. Here’s an example of how to pass an IOSurface through a mach port using the functions IOSurfaceCreateMachPort and IOSurfaceLookupFromMachPort.

mach_port_t for inter-process communication

Mach ports are a way for processes to communicate in Mac OS X. (Other mechanisms for inter-process communication include distributed objects and sockets.) A mach port is an endpoint of a communication channel. If 2 processes hold endpoints to the same communication channel, then one process can send messages to the other.

Mac OS X provides wrappers around mach ports — NSMachPort and CFMachPort. But sometimes you have to drop down to the native mach_port_t API.

Don’t do this on whim.