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 › location of new PApplet
Page Index Toggle Pages: 1
location of new PApplet (Read 325 times)
location of new PApplet
Jul 28th, 2009, 7:00am
 
hi everyone,

for a multiscreen-app, i am creating a couple of PApplet Objects by extending the PApplet class. now i have the problem that those applets can't find my data folder.
println(sketchPath) tells me that the application lies in /Applications, but this is sort of annoying.
is there a way to tell the new applet upon creation where to store the executable?

i am using the following code:
public class EApplet extends PApplet
{
     PFont stdFont;
       public void setup()
     {
           size(640,480,OPENGL);
               stdFont = loadFont("Garamond-Bold-30.vlw");
     }
     
     ...
}

and then

public class EFrame extends Frame
{
     public EFrame(int x, int y, int w, int h, EApplet a)
     {
           setBounds(x,y,w,h);
           setUndecorated(true);
           a = new EApplet();
           add(a);
           a.init();
           show();
     }
}


best,
phil.
Re: location of new PApplet
Reply #1 - Jul 28th, 2009, 9:33am
 
ok, sometimes it's just too obvious…  Tongue

sketchPath is not read only as i expected. you can set it immediately after creating the applet

a = new EApplet();
a.sketchPath = "/Path/To/Applet/Folder";
Page Index Toggle Pages: 1