Archive for November, 2008

KTUIKit 0.9.0

Wednesday, November 12th, 2008

I’m pleased to (finally!) introduce KTUIKit, an open source framework and Interface Builder plug-in project. The goal of the project is to address some of the issues that I’ve brought up in previous posts on this blog:

  • Incorporating NSViewController into Cocoa’s controller system
  • Replacing NSView’s Autoresizing mechanism for the layout of views and controls
  • Styling of views (not controls, i wish…)
  • KTUIKit currently includes the XS-Controllers, KTView, subclasses of many of the standard Cocoa controls, KTLayoutManager and KTStyleManager. The Interface Builder plug-in provides a GUI for the layout manager and style manager.

    This is still very much a work-in-progress. Don’t try to use it in your own project yet! There are bugs - especially in the Interface Builder ‘Style’ inspector, which is basically still unusable for anyone other than the person that programmed it… Nevertheless, I thought I’d go ahead and put the project out there - incomplete, with bugs and all.

    If you want to check it out in action, you can download an example project. The project shows how to use the layout and style managers in the view controller classes as well as in Interface Builder. If you want to open the nib files, you’ll have to do a little bit of work to get Interface Builder to load the plug-in:

  • Build the KTUIKit Xcode project that came with the example project
  • Copy the framework, which is located in a directory called “Uninstalled Products” in the Xcode project’s build directory, into your ~Library/Frameworks directory
  • Launch Interface Builder and go to its Preferences window
  • Go to the “Plug-ins” tab and hit the Add (+) button
  • Navigate IB to the copy of the framework in your ~Library/Frameworks directory
  • Hit ‘Open’
  • KATI will show up in your list of plug-ins and its library objects will show up in your library.
  • The Example Project

    ExampleApp.jpg

    This example is very similar to the view controller example projects I’ve posted in the past. It’s basically a window composed of several nib files, pieced together by several view controllers. The difference is that it uses KTUIKit’s views and their layout and style managers.

    The main thing to notice is how durable the layout is. Make the window as small as you can and as big as you can - drag the split view dividers all the way to zero and back. Nothing breaks. Everything is where it should be. There are also examples in the code of using the layout manager’s relative layout configurations - like “filling” and “floating”. There is no extra layout calculation code in the view controllers and KTView is never subclassed in the example project.

    I’ve created a page dedicated to KTUIKit. It contains information about how to get it from Google Code and about using the framework in an Xcode project.

    If you have comments or feedback or if you’re interested in contributing to its development please feel free to email me. Here’s to a quick move to 1.0!