How to extract values from a G4P slider using the GUI tool?

edited November 2013 in Library Questions

I want to set it up so I have a slider with two ticks, one value being 0 and the other being 1 but am unsure of how to extract the 0 and 1 int values in the actual code?

    public void slider1_change1(GSlider source, GEvent event) { //_CODE_:slider1:298857:
      println("slider1 - GSlider event occured " + System.currentTimeMillis()%10000000 );
      int a = source.getValue();
    } //_CODE_:slider1:298857:

I assume it will be something like this except the getValue() method doesn't work. Thanks.

Answers

  • getValueI().. worked it out.

  • getValueI() // will return the slider position as an integer

    getValueF() // will return the slider position as a floating point number

    getValueS() // will return the slider position as a string (uses precision for number of decimal places)

Sign In or Register to comment.