# I don't understand why when I use surface.setResizable(true); my draw stops working.

**URL:** <https://discourse.processing.org/t/i-dont-understand-why-when-i-use-surface-setresizable-true-my-draw-stops-working/43080>\
**Category:** Processing\
**Created:** [October 28, 2023, 9:00am UTC](https://discourse.processing.org/t/i-dont-understand-why-when-i-use-surface-setresizable-true-my-draw-stops-working/43080 "2023-10-28T09:00:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nokuraion](https://avatars.discourse-cdn.com/v4/letter/n/a88e4f/32.png) [@Nokuraion](https://discourse.processing.org/u/Nokuraion)\
**Post date:** [October 28, 2023, 9:00am UTC](https://discourse.processing.org/t/i-dont-understand-why-when-i-use-surface-setresizable-true-my-draw-stops-working/43080/1 "2023-10-28T09:00:43Z")

</div>

Here’s my code.

```auto
int canvasWidth = 800;
int canvasHeight = 600;
int i=0;
void setup() {

    surface.setResizable(true);
}

void draw() {
  circle(100,100,100);
  i++;
  println(i);
}

void settings() {
  size(canvasWidth, canvasHeight);
}

```

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [October 28, 2023, 11:06am UTC](https://discourse.processing.org/t/i-dont-understand-why-when-i-use-surface-setresizable-true-my-draw-stops-working/43080/2 "2023-10-28T11:06:39Z")

</div>

Hello @Nokuraion,

Your _draw()_ is working! Windows 10 and Processing 4.3 used here.

For each cycle of draw() you are:

- drawing a circle with a fixed size and location painting over the last one
- updating _i_ and printing it to the console. This means it is working!

An excellent resource for beginners:

> [@Introducing a New Free and Beginner-friendly Introductory Course on Processing!](https://discourse.processing.org/t/introducing-a-new-free-and-beginner-friendly-introductory-course-on-processing/42876):
>
> Hello everyone, I’m thrilled to share an exciting new resource for our community. Dan @shiffman has just launched a free 5-hour long introductory course on Processing, tailored specifically for complete beginners. If you’ve ever been curious about dipping your toes into the world of creative coding (or know someone who has) this is an excellent starting point. Here’s what Dan has to say about the course: Choo choo! Welcome aboard to the world of creative coding! Join me in this beginner-frie…

There are also resources (tutorials, references, examples, etc.) here:

> **[Welcome to Processing!](https://processing.org/)**
>
> Processing is a flexible software sketchbook and a language for learning how to code. Since 2001, Processing has promoted software literacy within the visual arts and visual literacy within technology…

I suggest you look at the references for each element of your code; _draw(), settings(), setup(), circle()_, etc. and also some working examples from the references provided.

`:)`

---

<div class="post-metadata">

**Author:** ![Nokuraion](https://avatars.discourse-cdn.com/v4/letter/n/a88e4f/32.png) [@Nokuraion](https://discourse.processing.org/u/Nokuraion)\
**Post date:** [October 28, 2023, 12:35pm UTC](https://discourse.processing.org/t/i-dont-understand-why-when-i-use-surface-setresizable-true-my-draw-stops-working/43080/3 "2023-10-28T12:35:12Z")

</div>

Hello thank for you reply but that don’t work when i resize my window my background stop drawing and my println also.

---

<div class="post-metadata">

**Author:** ![glv](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/glv/32/18785_2.png) [@glv](https://discourse.processing.org/u/glv)\
**Post date:** [October 28, 2023, 1:00pm UTC](https://discourse.processing.org/t/i-dont-understand-why-when-i-use-surface-setresizable-true-my-draw-stops-working/43080/4 "2023-10-28T13:00:37Z")

</div>

Your code works as is here with Windows 10 Pro and Processing 4.3

Please provide more information:

Operating system?  
Version of Processing?

Does the example in the reference work?

> **[setResizable() / Reference](https://processing.org/reference/setResizable_.html)**
>
> By default, Processing sketches can't be resized. When surface.setResizable(true) is used within a sketch, the window can be resized while it's running. There are more features of …

`:)`

---

<div class="post-metadata">

**Author:** ![Nokuraion](https://avatars.discourse-cdn.com/v4/letter/n/a88e4f/32.png) [@Nokuraion](https://discourse.processing.org/u/Nokuraion)\
**Post date:** [October 28, 2023, 3:43pm UTC](https://discourse.processing.org/t/i-dont-understand-why-when-i-use-surface-setresizable-true-my-draw-stops-working/43080/5 "2023-10-28T15:43:42Z")

</div>

i have Windows 10 Family and Processing 4.3 and the example work while i don’t resize the window
