mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
Merge branch 'master' of https://github.com/processing/processing
This commit is contained in:
@@ -10018,11 +10018,9 @@ public class PApplet implements PConstants {
|
||||
final String td = "processing.core.ThinkDifferent";
|
||||
Class<?> thinkDifferent =
|
||||
Thread.currentThread().getContextClassLoader().loadClass(td);
|
||||
|
||||
Method method =
|
||||
thinkDifferent.getMethod("init", new Class[] { PApplet.class });
|
||||
method.invoke(null, new Object[] { sketch });
|
||||
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace(); // That's unfortunate
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import java.awt.geom.Rectangle2D;
|
||||
import java.awt.image.*;
|
||||
import java.lang.reflect.Method;
|
||||
import java.net.URL;
|
||||
import java.util.ArrayList;
|
||||
|
||||
@@ -1029,7 +1030,19 @@ public class PSurfaceAWT extends PSurfaceNone {
|
||||
// On OS X, set this for AWT surfaces, which handles the dock image
|
||||
// as well as the cmd-tab image that's shown. Just one size, I guess.
|
||||
URL url = PApplet.class.getResource("/icon/icon-512.png");
|
||||
ThinkDifferent.setIconImage(Toolkit.getDefaultToolkit().getImage(url));
|
||||
// Seems dangerous to have this in code instead of using reflection, no?
|
||||
//ThinkDifferent.setIconImage(Toolkit.getDefaultToolkit().getImage(url));
|
||||
try {
|
||||
final String td = "processing.core.ThinkDifferent";
|
||||
Class<?> thinkDifferent =
|
||||
Thread.currentThread().getContextClassLoader().loadClass(td);
|
||||
Method method =
|
||||
thinkDifferent.getMethod("setIconImage", new Class[] { java.awt.Image.class });
|
||||
method.invoke(null, new Object[] { Toolkit.getDefaultToolkit().getImage(url) });
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace(); // That's unfortunate
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user