guido gui library not working with eclipse?
in
Contributed Library Questions
•
17 days ago
hi *,
i am trying to get a slider running in eclipse with the slider demo code out of the guido library.
result so far: no slider visible. the constructor gets called. the draw-function of the slider never gets called.
if i use the processing ide everything works fine.
processing version is 2.0.3
has anyone ever used guido out of eclipse?
am i missing something?
- import de.bezier.guido.Interactive;
- import processing.core.*;
- public class Main extends PApplet {
- Slider slider;
- public static void main(String args[]) {
- PApplet.main(new String[] { "--present", "Main" });
- }
- public void setup() {
- size(1680, 1050);
- Interactive.make( this );
- slider = new Slider( this, 2, 20, width-4, 16);
- }
- public void draw() {
- background(0);
- }
- }
- import de.bezier.guido.Interactive;
- import processing.core.PApplet;
- public class Slider
- {
- float x, y, width, height;
- float valueX = 0, value;
- float min, max;
- PApplet parent;
- Slider ( PApplet _parent, float xx, float yy, float ww, float hh)
- {
- parent = _parent;
- x = xx;
- y = yy;
- width = ww;
- height = hh;
- valueX = x;
- // register it
- Interactive.add( this );
- }
- // called from manager
- void mouseDragged ( float mx, float my )
- {
- valueX = mx - height/2;
- if ( valueX < x ) valueX = x;
- if ( valueX > x+width-height ) valueX = x+width-height;
- value = parent.map( valueX, x, x+width-height, 0, 1 );
- }
- void draw ()
- {
- System.out.println("draw is called");
- parent.noStroke();
- parent.fill( 100 );
- parent.rect(x, y, width, height);
- parent.fill( 120 );
- parent.rect( valueX, y, height, height );
- }
- }
1