# G4P: Duplicate method win\_draw1(PApplet, GWinData) in type

**URL:** <https://discourse.processing.org/t/g4p-duplicate-method-win-draw1-papplet-gwindata-in-type/16545>\
**Category:** Libraries\
**Created:** [December 21, 2019, 1:04pm UTC](https://discourse.processing.org/t/g4p-duplicate-method-win-draw1-papplet-gwindata-in-type/16545 "2019-12-21T13:04:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mark\_orion](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/mark_orion/32/7180_2.png) [@mark\_orion](https://discourse.processing.org/u/mark_orion)\
**Post date:** [December 21, 2019, 1:04pm UTC](https://discourse.processing.org/t/g4p-duplicate-method-win-draw1-papplet-gwindata-in-type/16545/1 "2019-12-21T13:04:25Z")

</div>

I think there is a bug in the G4P designer tool that when you use more than one secondary window a method with a wrong name is created:

This is what is created after adding another secondary window. This method is already present in gui.pde what creates the “Duplicate method” error.  
synchronized public void win\_draw1(PApplet appc, GWinData data) { //_CODE_:window2:307473:  
appc.background(230);  
} //_CODE_:window2:307473:

And this is how is should be. Changing win\_draw1 to win\_draw2 fixes the problem. However, whenever the G4P tool is used it revers to the old (wrong) method setting.  
synchronized public void win\_draw2(PApplet appc, GWinData data) { //_CODE_:window2:307473:  
appc.background(230);  
} //_CODE_:window2:307473:

---

<div class="post-metadata">

**Author:** ![kll](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/kll/32/964_2.png) [@kll](https://discourse.processing.org/u/kll)\
**Post date:** [December 21, 2019, 1:34pm UTC](https://discourse.processing.org/t/g4p-duplicate-method-win-draw1-papplet-gwindata-in-type/16545/2 "2019-12-21T13:34:36Z")

</div>

i try that here (win 10 / processing 3.5.3 / G4P GUI Builder 4.3 /  
make 2 add windows  
window1  
window2  
and got a win\_draw1 and win\_draw2

after deleting the windows and make again, got  
window1  
window2  
and got a win\_draw3 and win\_draw4

all works.

but i added in all 3 windows a label and got

```auto
// Variable declarations 
// autogenerated do not edit
GLabel label1; 
GWindow window1;
GLabel label1; 
GWindow window2;
GLabel label2; 

```

> Duplicate field \< sketch name \> .label1

so in main i need to rename the label1 to ‘label0’  
then it works.

BUT EDIT NOT IN THE CODE,  
only via the amazing GUI BUILDER Properties menu

---

<div class="post-metadata">

**Author:** ![quark](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/quark/32/26_2.png) [@quark](https://discourse.processing.org/u/quark)\
**Post date:** [December 21, 2019, 10:32pm UTC](https://discourse.processing.org/t/g4p-duplicate-method-win-draw1-papplet-gwindata-in-type/16545/3 "2019-12-21T22:32:40Z")

</div>

If you read the comments in the gui tab it states that the only code you are allowed to edit is _INSIDE_ the event handlers. Changing method, variable names etc must be done in GUI Builder window.
