# I can't drag my G4P GWindows - Help!

**URL:** <https://discourse.processing.org/t/i-cant-drag-my-g4p-gwindows-help/40142>\
**Category:** Libraries\
**Created:** [December 12, 2022, 11:06pm UTC](https://discourse.processing.org/t/i-cant-drag-my-g4p-gwindows-help/40142 "2022-12-12T23:06:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![charlielamus](https://avatars.discourse-cdn.com/v4/letter/c/b2d939/32.png) [@charlielamus](https://discourse.processing.org/u/charlielamus)\
**Post date:** [December 12, 2022, 11:06pm UTC](https://discourse.processing.org/t/i-cant-drag-my-g4p-gwindows-help/40142/1 "2022-12-12T23:06:19Z")

</div>

OK, I am a total newvie, and I am using Processing 3.5.4 with the G4P library. When I say newbie, I _really, really_ mean it. A week ago I thought a class was a room full of kids, and I still have no clue what a handler is. But…

I am writing (and by “writing”, I mean “stealing someone else’s code and trying to work out what the hell it all means”) a little app that has a main window and some G4P-created GWindows.

The Gwindows are created like this:

First by defining the windows:

```auto
GWindow patterningWindow,
        knitWindow,
        configWindow;

```

Then by calling them in void setup:

```auto
void setup() {
  dh = new DisposeHandler(this);
  
  visualpassapSettings = new JSONObject();

  size(1080, 800);
  noSmooth();
  surface.setTitle("Visual Passap");
  UsedFont = loadFont("GillSansMT-48.vlw"); 
  textFont(UsedFont);

  //load Logo
  visualpassapLogoImage = loadImage("VP_logo_80px.gif");
  displayButtonsGUI(); //GUI tab
  drop = new SDrop(this);
  //load BasicSettings
  visualpassapSettingsName = "data/BasicVPSettings.json";
  loadvisualpassapSettingsFile();
  
   // create Windows
  createConfigWindow();
  configWindow.setVisible(false);
  createPatterningWindow();
  patterningWindow.setVisible(false);
  createKnitWindow();
  knitWindow.setVisible(false);
}

```

And then by creating my own void-thingy (is that a class?) to actually create it:

```auto
public void createKnitWindow() {
  knitWindow = GWindow.getWindow(this, "Knit", 0, 0, 200, 400, JAVA2D);
    displayButtonsKnit();
    knitWindow.setAlwaysOnTop(true);
    knitWindow.addDrawHandler(this, "knitDraw");
    knitWindow.addMouseHandler(this, "knitMouse");
}

```

but they are fixed firmly in place and I can’t drag them around with my mouse. How can I make this be possible? I know that it is possible because it works in one of the examples but I am blowed if I can see where my code is different…

Please can you explain slowly and carefully for the hard of thinking? Thank you!

---

<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 14, 2022, 5:12pm UTC](https://discourse.processing.org/t/i-cant-drag-my-g4p-gwindows-help/40142/2 "2022-12-14T17:12:37Z")

</div>

So the library examples that come with G4P work but your code doesn’t. I can see no obvious error but it is impossible to test your code because

1. it is incomplete
2. uses assets (images and fonts not available to me)

I suggest that you create a _small_ sketch (without external assets) that demonstrates the problem and post that.

BTW if you are going to use G4P a lot then you might try the [GUI Builder](http://lagers.org.uk/g4ptool/index.html) tool.
