s31
October 5, 2021, 9:20am
1
Hello,
I have been trying to use the built-in surface.setResizable function to disable the option to resize the processing sketch window in my sketches. However, when I attempt to use this method with the P2D renderer it does not remove the maximize button. I am on Windows 10 and using the latest version of processing. Below is an example that demonstrates my issue.
void settings() {
size(800,600,P2D);
}
void setup() {
colorMode(HSB, 10000, 10000, 10000);
surface.setResizable(false);
}
void draw() {
clear();
background(millis()%10000, 10000, 10000);
}
Hi @s31 ,
I don’t think it is possible to set resizable to false using P2D render.
opened 02:25PM - 11 Aug 18 UTC
opengl
## Description
P2D won't disable "maximize" button on `surface.setResizable(fal… se)` callback.
## Expected Behavior
Maximize/minimize button on the frame is disabled.
## Current Behavior
It won't let you resize by hand, but the maximize/minimize button is still there being enabled.
## Steps to Reproduce
1. Set renderer as P2D in `settings()` body
```java
public void settings() {
size(100, 100, P2D);
....
}
```
2. Use this as `setup()` body;
```java
public void setup() {
surface.setResizable(false);
....
}
```
3. You can see the maximize button enabled. Use it to fullscreen your frame.
## Your Environment
* Processing version: 3.4 (Stable)
* Operating System and OS version: Windows 7 Home Premium
There is another thread in the forum that might be helpful, but might not be the best solution
Hey, I don’t know if it’s the best solution, but it seems to work:
void setup() {
//for the background color
colorMode(HSB, 10000, 10000, 10000);
//Fullscreen "disables" the button
fullScreen(P2D);
//sets the size
surface.setSize(600, 600);
//And so that the window is not on the top left, we put it in the middle
surface.setLocation(displayWidth/2-width/2, displayHeight/2-height/2);
}
void draw() {
background(millis()%10000, 10000, 10000);
}
I hope I could help you …