# G4P controls not working in diferrent windows

**URL:** <https://discourse.processing.org/t/g4p-controls-not-working-in-diferrent-windows/35705>\
**Category:** Libraries\
**Created:** [March 12, 2022, 9:31pm UTC](https://discourse.processing.org/t/g4p-controls-not-working-in-diferrent-windows/35705 "2022-03-12T21:31:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Alan](https://avatars.discourse-cdn.com/v4/letter/a/a87d85/32.png) [@Alan](https://discourse.processing.org/u/Alan)\
**Post date:** [March 12, 2022, 9:31pm UTC](https://discourse.processing.org/t/g4p-controls-not-working-in-diferrent-windows/35705/1 "2022-03-12T21:31:07Z")

</div>

just wanted to add G4P controls into different windows (PApplet s) ,  
no error found , but the problem is that the controls does not work at all !!!  
meaning …  
for example if i add a **GButton** to the main window or the primary PApplet and the mouse is over the button , the button background color changes , although its not changing in another window .  
here is the code …

```auto
import g4p_controls.*;

GButton btn1;

void setup(){

  size(600,600);
  background(255,0,0);
  
  btn1 = new GButton(this,0,0,width/2,height/2,"test");

}
void draw(){

  
}

void mousePressed(){

  new Screen();
}
class Screen extends PApplet{

  GButton btn2;

  Screen(){
    super();
    PApplet.runSketch(new String[] {this.getClass().getSimpleName()},this);
  }
  
  void settings(){
    size(600,600);
  }
  
  
  void setup(){
    background(255,255,0);
    btn2 = new GButton(this, 0,0,width/2,height/2,"test1");
    btn2.draw();
  }
  
  void draw(){
    btn2.draw();
  }
}

```

also i tried to use **forceBufferUpdate()** but didn’t work .

note : i don’t want to use **GWindow** control from the G4P library .
