From 7650738b04bf835e6bedb8815858c7e8642f84b1 Mon Sep 17 00:00:00 2001 From: benfry Date: Mon, 24 Nov 2008 01:34:15 +0000 Subject: [PATCH] trying to figure out what's going on with sketch placement --- core/src/processing/core/PApplet.java | 47 +++++++++++++++++++++++---- 1 file changed, 41 insertions(+), 6 deletions(-) diff --git a/core/src/processing/core/PApplet.java b/core/src/processing/core/PApplet.java index 0b789665c..365432787 100644 --- a/core/src/processing/core/PApplet.java +++ b/core/src/processing/core/PApplet.java @@ -6318,7 +6318,7 @@ public class PApplet extends Applet * see the FAQ on information for capturing the ESC * key when running in presentation mode. * - * --stop-color color of the 'stop' text used to quit an + * --stop-color=#xxxxxx color of the 'stop' text used to quit an * sketch when it's in present mode. * * --bgcolor=#xxxxxx background color of the window. @@ -6483,7 +6483,7 @@ public class PApplet extends Applet // Class c = Class.forName(name); Class c = Thread.currentThread().getContextClassLoader().loadClass(name); - PApplet applet = (PApplet) c.newInstance(); + final PApplet applet = (PApplet) c.newInstance(); // these are needed before init/start applet.frame = frame; @@ -6518,8 +6518,8 @@ public class PApplet extends Applet } frame.setLayout(null); frame.add(applet); - //frame.pack(); - frame.validate(); + frame.pack(); + //frame.validate(); applet.init(); @@ -6649,8 +6649,43 @@ public class PApplet extends Applet } } - //System.out.println("showing frame"); - //System.out.println("applet requesting focus"); +// frame.addWindowListener(new WindowListener() { +// +// public void windowActivated(WindowEvent e) { +// applet.requestFocus(); +// } +// +// public void windowClosed(WindowEvent e) { +// // TODO Auto-generated method stub +// +// } +// +// public void windowClosing(WindowEvent e) { +// // TODO Auto-generated method stub +// +// } +// +// public void windowDeactivated(WindowEvent e) { +// // TODO Auto-generated method stub +// +// } +// +// public void windowDeiconified(WindowEvent e) { +// // TODO Auto-generated method stub +// +// } +// +// public void windowIconified(WindowEvent e) { +// // TODO Auto-generated method stub +// +// } +// +// public void windowOpened(WindowEvent e) { +// // TODO Auto-generated method stub +// +// } +// +// }); applet.requestFocus(); // ask for keydowns //System.out.println("exiting main()");