Visitar URL original
Misleading error message when using size() or fullScreen() outside setup · Issue #161 · processing/processing4 · GitHub
The Wayback Machine - https://web.archive.org/web/20260606011603/https://github.com/processing/processing4/issues/161
Skip to content

Misleading error message when using size() or fullScreen() outside setup #161

@processing-bot

Description

@processing-bot

Created by: PixelCatalyst

Description

Given size() or fullScreen() invoked outside setup() (e.g. in draw()) IllegalStateException is rightfully thrown. However, when using the Processing Development Environment additional advice message "When not using the PDE..." is displayed. This message might be misleading to inexperienced users as it refers to advanced use case of running Processing in external IDE.

The same error happens in both Processing 3 and 4, even after the the fresh installation

Code to replicate:

void setup() {
 size(500, 500);
}
void draw() {
 background(255);
 
 size(400, 400); //can also be fullScreen()
}

Your Environment

  • Processing version: Processing4 built up to commit e96622d
  • Operating System and OS version: Windows 10 build 19042.685

Possible Causes / Solutions

Looks like PApplet has an external field that should determine if processing-core is run from PDE or IDE. The condition to display the error message appears to have unnecessary negation, but I don't fully understand how that variable is calculated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions