Interface Builder Tip
January 10th, 2007It’s easy to beat up on Interface Builder, which until 10.5 ships, still feels a little crufty. It’s lagged behind Xcode in the major overhaul department. But sometimes I discover features that suprise me, like this tidbit from Apple’s Technical Q&A:
Q&A 1323: Interface element identification in Interface Builder
(Link compliments of Justin Anderson)
What the Q&A describes is a way to quickly identify the UI corresponding with any UI instance in IB’s hierarchical instance view. Just hold down control-shift and click an item:
Before learning of this feature, I’d just double-click items in the list to see where they were. A clunkier and less precise mechanism for browsing the whole nib quickly. Note: I had trouble getting this to work, but it seemed to me that if I just tried a few times it “cleaned out IB’s pipes” or something. Or maybe I was just doing it wrong at first.
Combined with Scott Stevenson’s recent bindings visualization discoveries, there seem to be a heap of features that I simply haven’t noticed. I guess I better keep my mouth shut before lambasting it too hard… nah!
January 10th, 2007 at 12:51 pm
Thanks, that’s a neat tip.
For some reason IB doesn’t highlight custom views not attached to a window this way (e.g. if you dragged a custom view directly into the nib instead of into a window). It’ll highlight UI elements inside the custom view, but not the view itself.
Still pretty cool, even if the floating blue arrow is a little weird.
January 11th, 2007 at 2:18 pm
Another nice one I found recently- select something in a window and hold option while mousing over other things to see the number of pixels between the 2 objects. It also works with multiple selections. I wonder if it will change to inches when resolution independence kicks in…
January 15th, 2007 at 2:01 pm
Ok, this doesn’t really fit here but…
Hey, can you give an example on how to make python work with IB? :)
Or, you know where there might be examples already?
Thanks
Eric
January 15th, 2007 at 2:02 pm
Eric, I’m not particularly experienced with building complete applications with Python, but this tutorial might get you started?
http://pyobjc.sourceforge.net/doc/tutorial.php