We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › how to run windowless application
Page Index Toggle Pages: 1
how to run windowless application? (Read 750 times)
how to run windowless application?
Sep 5th, 2007, 3:46pm
 
Hello all,

I work on linux and I have an application that creates and saves a picture file, built with command-line calls in mind. However, I have no idea how to get rid of the window during the script run. I did try running the application with Java headless mode on, but without success.

Any help will be greatly appreciated.
Re: how to run windowless application?
Reply #1 - Sep 5th, 2007, 4:04pm
 
processing is not designed to run in headless mode, sorry.

it might someday be possible using a java application along with createGraphics() and/or a fake awt implementation, but it's not currently a priority.
Re: how to run windowless application?
Reply #2 - Sep 5th, 2007, 4:19pm
 
Ben, thanks a lot for the quick answer.

If the Processing cannot do it, maybe I'll try an old hack with Xserver emulation (like Xvfb).
Re: how to run windowless application?
Reply #3 - Sep 5th, 2007, 6:03pm
 
could set the sketch to output to pdf.. should keep the window from displaying

update: i tested this code, and it seems to work:
Code:

// processing without a window
// - seltar
import processing.pdf.*;

void setup()
{
size(200,200,PDF,"file.pdf");
noLoop();
}

void draw()
{
noStroke();
fill(255,0,0);
ellipse(100,100,100,100);
exit();
}
Re: how to run windowless application?
Reply #4 - Sep 5th, 2007, 6:48pm
 
Thanks Seltar! That indeed works.

Documentation doesn't mention PDF as a valid mode for size(). Are there any other available? DXF works only with simple graphics.
Re: how to run windowless application?
Reply #5 - Sep 5th, 2007, 8:42pm
 
that's because PDF is a library, not part of the core. see the libraries reference:
http://processing.org/reference/libraries/

but even though the window does not appear, it will not work in headless mode, e.g. from the command line on a *nix machine that doesn't have X running.
Page Index Toggle Pages: 1