We are about to switch to a new forum software. Until then we have removed the registration on this forum.
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
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)
orthis.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
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. ;;)
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
@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.