[Top]

SMDoubleSlider Getting Started


Installation

The SMDoubleSlider distribution consists of an Xcode 3 project file (SMDoubleSliderIB3.xcodeproj), an Xcode 2.x project file (SMDoubleSlider.xcodeproj), the source code itself, this documentation, and the source code to a sample application.

Interface Builder 3.0+

A pre-built Interface Builder 3.0+ plugin is included with the distribution. You can copy this plugin to your hard drive, then have IB use this plugin so you can include SMDoubleSlider objects in your nib/xib files. Within IB, use the Preferences window (Plug-ins pane) to add the SMDoubleSlider.ibplugin from your hard drive.

That's it! The double slider classes should show up in the IB Library window. You can drag a double slider object from the Library into your own nib files. You can hook up your target action objects in Interface Builder, just like with using a standard NSSlider object. When you show the attributes of a selected double slider object in Interface Builder, you'll see an inspector that lets you change most of the settings of the object. You can also change any of these settings at run time.

One of the nice things about the Interface Builder plugin is that the double slider code is built directly into it. This means that the double slider will work perfectly when using Interface Builder's Test Interface command.

Interface Builder 2

A pre-built Interface Builder 2.0 palette is included with the distribution. You can copy this palette to your hard drive (preferably in the /Developers/Palettes/ folder, then have IB use this palette so you can include SMDoubleSlider objects in your nib/xib files. Within IB, use the Preferences window (Palettes pane) to add the SMDoubleSlider.palette from your hard drive.

If you're running Mac OS X 10.3 or earlier, you'll need to install the source code (see below) and build it to produce an Interface Builder palette that will load on your system. The bindings support in SMDoubleSlider will need to be either conditionally compiled or commented out as bindings will cause the binary to be unable to load with IB on 10.3 or earlier.

That's it! The double slider palette icon should show up in the palettes window. You can drag a double slider object from that palette into your own nib files. You can hook up your target action objects in Interface Builder, just like with using a standard NSSlider object. When you show the attributes of a selected double slider object in Interface Builder, you'll see an inspector that lets you change most of the settings of the object. You can also change any of these settings at run time.

One of the nice things about the Interface Builder palette is that the double slider code is built directly into it. This means that the double slider will work perfectly when using Interface Builder's Test Interface command.

Xcode

You can simply include the SMDoubleSlider.h/.m and SMDoubleSliderCell.h/.m files directly in your application. The benefit of doing this is that the classes will be compiled with your project's options such as whether or not to use garbage collection and what architectures to build for (32/64bit, PowerPC/Intel). This also makes them easier to debug if you run into problems.

If you prefer, you can build the SMDoubleSlider.framework which builds the two needed classes into their own framework. Then link this framework into your application. Be sure to copy the framework into your application's Frameworks folder as well so that end users who get your application will have the needed binaries.

The Source Code

Copy the contents of the distribution to your hard drive in a location where you have write access. You can place it in your ~/Documents folder, in your /Developer folder, or elsewhere. After you build the framework, palette and/or sample app (see below) you may need to copy some of the files to other locations on your computer.

You must have the source code installed in a place where you have write access. If you're using Xcode 3 or later, open either of the .xcodeproj files. If you're using Xcode 2.x, open the SMDoubleSlider.xcodeproj file.

SMDoubleSliderIB3.xcodeproj

There are three targets in the project; you can build any of the targets although the All target is probably the best.

  1. All - Builds both the framework and the Interface Builder 3 plugin.
  2. SMDoubleSliderIB3 - Builds the Interface Builder 3 plugin within the SMDoubleSlider framework.
  3. SMDoubleSliderIB3Framework - Builds the SMDoubleSlider framework.

SMDoubleSlider.xcodeproj

There are two targets in the project; you can build either of the targets.

  1. IB Palette - Builds the Interface Builder 2 palette.
  2. Sample App - Builds the sample application showing off some of the capabilities of the double slider.

General Usage - how to make use of this class


© 2003-2010 Snowmint Creative Solutions LLC (Last Updated 2010-11-15)