Code Monkey home page Code Monkey logo

itsidebar's Introduction

ITSidebar

ITSidebar is a very lightweight control for Mac OS X. You can create sidebars similar to the one of Sparrow.

Why would I want to use this?

ITSidebar is:

  • Highly customizable
  • Lightning-fast
  • Completly free to use

Usage

Copy files

Copy the following files:

  • ITSidebar.h
  • ITSidebar.m
  • ITSidebarItemCell.h
  • ITSidebarItemCell.m
  • ITLeakWarningHelper.h

Make sure to copy them to the project, and to add them to the target. Please use your own images for the button cells.

Use in a project

Make sure to check out the sample project. First, drag a NSScrollView onto your window. Then, select the document view, and set its custom class to ITSidebar.

Now you can connect an outlet to it, and use the following methods:

// Add/Remove Cells
- (ITSidebarItemCell *)addItemWithImage:(NSImage *)image target:(id)target action:(SEL)action;
- (ITSidebarItemCell *)addItemWithImage:(NSImage *)image alternateImage:(NSImage *)alternateImage target:(id)target action:(SEL)action;

- (ITSidebarItemCell *)addItemWithImage:(NSImage *)image;
- (ITSidebarItemCell *)addItemWithImage:(NSImage *)image alternateImage:(NSImage *)alternateImage;

- (void)removeRow:(NSInteger)row;

// Select Cells
- (void)setSelectedIndex:(int)selectedIndex;
- (void)deselectAllItems;

// Customisation
- (void)setCellSize:(NSSize)cellSize;
- (void)setBackgroundColor:(NSColor *)backgroundColor;
- (void)setScrollerKnobStyle:(NSScrollerKnobStyle)knobStyle;

- (ITSidebarItemCell *)selectedItem;
- (int)selectedIndex;

+ (Class)sidebarItemCellClass;

For subclassing and customisation, check out the example.

License

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 
Version 2, December 2004 

Copyright (C) 2013 Ilija Tovilo <[email protected]> 

Everyone is permitted to copy and distribute verbatim or modified 
copies of this license document, and changing it is allowed as long 
as the name is changed. 

DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE 
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 

0. You just DO WHAT THE FUCK YOU WANT TO.

Help

If you have any questions, feel free to let me know at [email protected]

itsidebar's People

Contributors

iluuu1994 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.