Coder Social home page Coder Social logo

ladslider's Introduction

LADSlider: Customizable NSSlider

LADSlider offers quick and easy customization on NSSlider. Simply set the knob, minimum, and maximum image attributes and let LADSlider do the rest. No subclassing of cells required!

SliderImage

How to use

Please note that this slider requires Mac OS 10.10+ (Yosemite)

With xib or storyboard

Create an NSSlider in your xib or storyboard file and change its class to LADSlider under the "Custom Class" heading. Set the images directly in Interface Builder from the Attributes Inspector or programmatically on the LADSlider class.

That's it!

From code

Create LADSlider with one of the init methods:

- (id)initWithKnobImage:(NSImage *)knob;
- (id)initWithKnobImage:(NSImage *)knob minimumValueImage:(NSImage *)minImage maximumValueImage:(NSImage *)maxImage;

If you prefer code, you can set the images for your slider like this:

slider.knobImage = [NSImage imageNamed:@"knob"];

You may set only the knob image if you want, or customize the min and max images as well.

slider.minimumValueImage = [NSImage imageNamed:@"leftEdge"];
slider.maximumValueImage = [NSImage imageNamed:@"rightEdge"];

ladslider's People

Contributors

doshipak avatar lucasderraugh avatar

Stargazers

Hyungsung Kim avatar Daniele Maddaluno avatar holybin avatar  avatar  avatar Jeff Zhao avatar Ryan Francesconi avatar Kashee Ram Kushwaha avatar aU*id*me avatar  avatar  avatar Gao Peng avatar  avatar  avatar lee zg avatar  avatar Stoo Sepp avatar Chien-Ming (Derek) Lee avatar  avatar Mark Godfrey avatar  avatar  avatar Eric D. avatar  avatar Nishanth Shanmugham avatar  avatar Vahagn Mkrtchyan avatar David DelMonte avatar Alexey Bromot avatar

Watchers

 avatar David DelMonte avatar Sadik avatar  avatar

ladslider's Issues

some warnings

Your project bad works in Maverics(10.9).
It has warnings:

LADSliderExample[2389:303] *** WARNING: -[NSImage compositeToPoint:operation:] is deprecated in MacOSX 10.8 and later. Please use -[NSImage drawAtPoint:fromRect:operation:fraction:] instead.
2014-01-15 02:00:36.313 LADSliderExample[2389:303] *** WARNING: -[NSImage compositeToPoint:fromRect:operation:] is deprecated in MacOSX 10.8 and later. Please use -[NSImage drawAtPoint:fromRect:operation:fraction:] instead.

When I hide/unhide your slider, it is crashing.

Thank you, your project is very helpful!

Programming error

File: LADSliderCell

Line: [self drawInteriorWithFrame:controlView.bounds inView:controlView];

result: It does not make sense to draw an image when [NSGraphicsContext currentContext] is nil. This is a programming error.

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.