clearButton

clearButton( )

Description
clear button widjet

Syntax
clearButton(id) 


Parameters
  id : id of button widjet

Usages
clearButton(1)


Examples in arduino

#include "AppGosu.h"
AppGosu app;


void setup() {    
    app.start();
    app.setDelayCmd(20);  // max speed 20ms

    myStart();
}

void loop() {
  
 
} // end of loop

//---------------------------------------------------------
void serialEvent() {
      app.serialMessage();
      EventLoop();
}
void EventLoop() {
    if( app.btConnected()) {   // for auto starting
        myStart();
    }
  
    // user event code here
      
        if( app.eventButton(1)) {    // event handler

             app.text("button 1 cleared", 100,400);
             app.clearButton(1);                
        }
        if( app.eventButton(2)) {
            app.text("button 2 clicked", 100,500);                
        }

}
//---------------------------------------------------------
void myStart(void) {
    // user starting code here
 
    app.clearAll();
    app.background(0,0,0);
    app.textSize(50);
    app.fill(255,255,255);
    app.text("-- clear Button --", 50, 50);
  
    // make button

    app.button("button 1",10,100,150, 80, 1);
   app.button("button 2",200,100,150, 80, 2);
}








by AppGosu
-----------------------------------------

No comments: