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.
IndexProcessing DevelopmentLibraries,  Tool Development › napplet: Embedded & windowed sub-sketches (v0.3.0)
Pages: 1 2 3 
napplet: Embedded & windowed sub-sketches (v0.3.0) (Read 14974 times)
Re: napplet: Embedded & windowed sub-sketches (v0.3.0)
Reply #30 - May 26th, 2010, 3:03am
 
now I add another problem I've already added yesterday but in another thread.. It's almost the same thing like with the boolean-variable..

if I want to program a resizable window with two napplets, the actual width and height isn't the same in another napplet.. so is there a possibility to program this? I've worked with a main tab that is resizable and a fixed napplet that has got a very big width and a constat height, so that if I resize the window you can't see that the napplet hasn't been resized.. but with a third napplet, it isn't possible anymore.
And I would like to make the third napplet resizable, but if I set frame.setResizable(true) in the void setup of the third tab, there's an error.. what I want to program in fact is similiar to geogebra.. there are three frames, the upper in the height fixed in the width resizable with the main frame. the second frame on the left side is resizable in the width and fixed in the height (height of the main frame - height of the upper frame).. Is there an easy possibility to program that? or a more difficult possibility? I'm stuck with it.. Angry
Re: napplet: Embedded & windowed sub-sketches (v0.3.0)
Reply #31 - May 26th, 2010, 9:47am
 
Okay, let me look into this and see what I can figure out.
Re: napplet: Embedded & windowed sub-sketches (v0.3.0)
Reply #32 - May 26th, 2010, 9:54am
 
About the first issue, here's a sketch I wrote.  The black bar at the top is the "TopPane" napplet, and clicking on it will change the color of the main sketch's background.  It works fine for me without needing a resize.

Code:
import napplet.*;

NAppletManager nappletManager;

int backColor = 255;

void setup() {
 size(400, 400);
 nappletManager = new NAppletManager(this);
 
 nappletManager.createEmbeddedNApplet("TopPane", 0, 0);
}

void draw() {
 background(backColor);
}

Code:
public class TopPane extends NApplet {

 void setup() {
   size(parentPApplet.width, 100);
 }

 void draw() {
   background(0);
 }
 
 void mouseClicked() {
    if (backColor==255);
backColor = 100;
   else backColor = 255;
 }
}


I'm still working on the second issue, so I'll try to get back to you on that soon.
Re: napplet: Embedded & windowed sub-sketches (v0.3.0)
Reply #33 - Jun 11th, 2010, 6:28am
 
Hi, nice Library.

It's working like a charm in processing. But i can't get it running under Eclipse. I imported your library. And the inital sketch is running fine but as soon as i try to add another sketch via the NAppletManager i run into problems:

1. He tells me that there is no "<init>" function within the sub Applets so i added an init function named like the sub-applet itself to all sub Applets. Problem solved. (not sure)

2. Exception in thread "Animation Thread" java.lang.NoSuchFieldError: screenWidth
Re: napplet: Embedded & windowed sub-sketches (v0.3.0)
Reply #34 - Jun 11th, 2010, 7:11am
 
Not sure why missed the release of this library. Really great. this is useful for a lot of things
Re: napplet: Embedded & windowed sub-sketches (v0.3.0)
Reply #35 - Jun 11th, 2010, 10:14am
 
Cedric: Thanks for the kind words!

juli:  Glad to hear it's working in processing at least.
juli84 wrote on Jun 11th, 2010, 6:28am:
1. He tells me that there is no "<init>" function within the sub Applets so i added an init function named like the sub-applet itself to all sub Applets. Problem solved. (not sure)

2. Exception in thread "Animation Thread" java.lang.NoSuchFieldError: screenWidth

Hmm, I haven't run into either of these errors, and from your description I'm not sure how you'd be running into them.

Here is the code for the test classes I've used and run from Eclipse.  The simplest example is probably the  Animator napplet and the AnimatorTest sketch.  (These are also in the "src/napplet/test" folder of the napplet library install.)  Look at those and see if maybe they give you a clue what's not working with your code.

If not, try compiling and running them yourself within Eclipse; if they don't run for you then at least we can narrow down the problem.

Finally, if nothing else works, post some code here that gives the error you're getting and I'll see if it makes sense to me.

Thanks!
Pages: 1 2 3