# Allow User to Resize the Window

**URL:** <https://discourse.processing.org/t/allow-user-to-resize-the-window/31212>\
**Category:** Coding Questions\
**Created:** [July 12, 2021, 7:07pm UTC](https://discourse.processing.org/t/allow-user-to-resize-the-window/31212 "2021-07-12T19:07:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![dtools22](https://avatars.discourse-cdn.com/v4/letter/d/f19dbf/32.png) [@dtools22](https://discourse.processing.org/u/dtools22)\
**Post date:** [July 12, 2021, 7:07pm UTC](https://discourse.processing.org/t/allow-user-to-resize-the-window/31212/1 "2021-07-12T19:07:10Z")

</div>

Hello All,

I’m creating a program and I would like the user to be able to resize the screen at their convenience. I understand the basics of how to do this with objects and their positioning on the screen but I’m a little unclear how I can make the program itself have a customizable screen size.

I know about the settings() function, but is there a way to use that to give the user the ability to resize the screen while using a program?

Thank you all as always for the help.

---

<div class="post-metadata">

**Author:** ![Flolo](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/flolo/32/13874_2.png) [@Flolo](https://discourse.processing.org/u/Flolo)\
**Post date:** [July 12, 2021, 8:07pm UTC](https://discourse.processing.org/t/allow-user-to-resize-the-window/31212/2 "2021-07-12T20:07:44Z")

</div>

Hey I think the function you are looking for is this:

```auto
surface.setResizable(true);

```

I have already make a little example 😄

```auto
//previous Width/Height
float pWidth, pHeight;

void setup() {
  size(600, 600);
  surface.setResizable(true);
}
void draw() {
  background(0);
  updateWindowResized();
}
void updateWindowResized() {
  if (width != pWidth || height != pHeight) {
    pWidth = width;
    pHeight = height;
    windowResized();
  }
}
//called when the window was resized 
void windowResized() {
  println("Window resized");
}

```

---

<div class="post-metadata">

**Author:** ![dtools22](https://avatars.discourse-cdn.com/v4/letter/d/f19dbf/32.png) [@dtools22](https://discourse.processing.org/u/dtools22)\
**Post date:** [July 13, 2021, 5:41pm UTC](https://discourse.processing.org/t/allow-user-to-resize-the-window/31212/3 "2021-07-13T17:41:17Z")

</div>

This looks great, thank you very much for the help!
