We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProcessing DevelopmentLibraries,  Tool Development › A Simple Slider "Library" Implementation
Page Index Toggle Pages: 1
A Simple Slider "Library" Implementation (Read 1845 times)
A Simple Slider "Library" Implementation
Jun 1st, 2005, 10:30pm
 
All-

I ran into a need for a slider widget and wanted to produce something that was simple to use and reusable.  I've heared discussion of a GUI widget library, but none, to my knowledge, has materialized.  Anyway, I've given a library style slider widget a preliminary stab, and I wanted to share my results; maybe it'd be a helpfull example for others trying to do the same.  I'm also fishing for comments if something I've done is just out-and-out wrong.

One thing I noticed and totally took advantage of is that it's possible for any class in the sketch's folder to pretend that it's a library.  This let me get started quickly by simply creating a Slider.java tab.  All I have to do later to make this into a library is put it in a package and wrap it all up in a JAR file.

The big thing that's missing from this implementation is being able to create vertical as well as horizontal sliders.

Here's an applet and the source code.  Feel free to use it whole, or rip it off, or whatever.

http://www.ibiblio.org/joey/sketchbook/SliderSketch/index.html

Thanks!

-Joey
Page Index Toggle Pages: 1