#include "ginteractors.h"

class GSlider : public GInteractor

This interactor subclass represents an onscreen slider. Dragging the slider control generates an ActionEvent if the slider has a nonempty action command.

The display image of a slider is machine-dependent, but the declaration

    GSlider *slider = new GSlider();
typically produces a slider that looks something like this:

GSlider
Constructor
GSlider()
GSlider(min, max, value) 
Creates a horizontal GSlider.
Methods
getValue() Returns the current value of the slider.
setValue(value) Sets the current value of the slider.

Constructor detail


GSlider();
GSlider(int min, int max, int value);
Creates a horizontal GSlider. The second form allows the client to specify the minimum value, maximum value, and current value of the slider. The first form is equivalent to calling GSlider(0, 100, 50). Assigning an action command to the slider causes the slider to generate an action event whenever the slider value changes.

Usage:

GSlider *slider = new GSlider();
GSlider *slider = new GSlider(min, max, value);

Method detail


void setValue(int value);
Sets the current value of the slider.

Usage:

slider->setValue(value);

int getValue();
Returns the current value of the slider.

Usage:

int value = slider->getValue();