Resize window

edited February 2017 in Python Mode

Hi There,

I am using Python (Jython) in processing. Is there a function to resize the size of the window like 'frame.resize(600,400);'

Cheers

Answers

  • In java, you can check previous posts: https://forum.processing.org/two/search?Search=setresizable

    However, I don't know how to do that in python. I let other forum goers comment about this.

    Kf

  • edited February 2017 Answer ✓

    Everything available in Java Mode is also available in Python Mode. ~O)

    If something seems unavailable, we can always prefix it w/ global variable this: *-:)
    this.getSurface().setSize(600, 400) or this.surface.setSize(600, 400)

    As an alternative w/o this, ye olde faithful frame global variable doesn't need it at all: :ar!
    frame.setSize(600, 400)

  • Is there a standard reference link for python mode?

    @GoToLoop Is frame always available for all renders? Is surface something relatively new from recent releases? Would it also be compatible for different renders?

    Kf

  • edited February 2017

    In Processing 3, variable frame isn't an instance of class JFrame as in previous versions anymore. :-<
    Now it's merely a @Deprecated, incomplete, botched up surface. :-&
    But it still works for most basic functionality. ;;)

  • Is there a standard reference link for Python Mode?

    http://py.Processing.org/reference/

  • The python reference seems to be the same reference for java Processing. There are no python examples available as yet.

    Kf

  • edited February 2017

    @kfrajer -- that's not quite right. The Python reference pages still contain some broken example code, but they also contains a lot of Python mode-specific documentation and code samples -- including keywords not available in Processing (Java mode) -- see for example def, Dictionary, Tuple etc.

Sign In or Register to comment.