<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
      <title>Tagged with getframe() - Processing 2.x and 3.x Forum</title>
      <link>https://forum.processing.org/two/discussions/tagged/feed.rss?Tag=getframe%28%29</link>
      <pubDate>Sun, 08 Aug 2021 21:25:00 +0000</pubDate>
         <description>Tagged with getframe() - Processing 2.x and 3.x Forum</description>
   <language>en-CA</language>
   <atom:link href="/two/discussions/taggedgetframe%28%29/feed.rss" rel="self" type="application/rss+xml" />
   <item>
      <title>Disable maximize button?</title>
      <link>https://forum.processing.org/two/discussion/27736/disable-maximize-button</link>
      <pubDate>Tue, 10 Apr 2018 21:45:18 +0000</pubDate>
      <dc:creator>lmccandless</dc:creator>
      <guid isPermaLink="false">27736@/two/discussions</guid>
      <description><![CDATA[<p>I want a fixed window size, I don't want the maximize button to make the window full screen.</p>

<p>setResizable does nothing.
Calling size() every frame breaks sketch.</p>
]]></description>
   </item>
   <item>
      <title>Running matlab code from within Processing</title>
      <link>https://forum.processing.org/two/discussion/26618/running-matlab-code-from-within-processing</link>
      <pubDate>Fri, 02 Mar 2018 23:46:42 +0000</pubDate>
      <dc:creator>daddydean</dc:creator>
      <guid isPermaLink="false">26618@/two/discussions</guid>
      <description><![CDATA[<p>Hi there, I would like to know if there is way to run a matlab code from within Processing...
The code I am interested in using is: <a href="http://ceng.anadolu.edu.tr/cv/EDPF/" target="_blank" rel="nofollow">http://ceng.anadolu.edu.tr/cv/EDPF/</a><br />
Which is C++ as far as I am aware.<br />
I've heard of a thing called "javabuilder" for matlab, but im not sure how I could use it in this situation. 
Can it be done?
Cheers</p>
]]></description>
   </item>
   <item>
      <title>startup focus not recognizing keystrokes (P3 only?)</title>
      <link>https://forum.processing.org/two/discussion/25363/startup-focus-not-recognizing-keystrokes-p3-only</link>
      <pubDate>Sun, 03 Dec 2017 21:54:18 +0000</pubDate>
      <dc:creator>ottenm</dc:creator>
      <guid isPermaLink="false">25363@/two/discussions</guid>
      <description><![CDATA[<p>Whenever I launch a sketch, either from the P3 pde or from Eclipse, the sketch always becomes the top app in my system (Windows, so the title bar is highlighted, and the task bar and task manager both show the sketch app on top).  But more and more, I have to click inside the sketch window to get it to recognize keyboard input (i.e., the keypressed() handler is not getting called).  And, the problem is intermittent.  While working on a sketch, say I run it 20 times, about half the time it recognizes the keyboard directly, and half the time I have to click inside the window first.  Clicking on the title bar has no effect, the app just stays on top, but no keystroke response.  Also, not changing any significant stuff (settings(), setup(), draw(), mouse/key handlers) just random code changes and keypressed() working/not working.</p>

<p>I've spent a few hours wading through focus management tutorials and posts and at one point I thought I had nailed it with:</p>

<pre><code>frame.requestFocus(); // had no effect on it's own, but thenn seemed to work with toFront() and repaint()
frame.toFront();
frame.repaint();
</code></pre>

<p>But after that started failing intermittently I came across the switch from 'frame' to 'surface' in 3.0 and switched to:</p>

<pre><code>surface.setAlwaysOnTop(true); // no requestFocus(), toFront(), or repaint() for surface
</code></pre>

<p>Again, seemed to help at first but now back to never knowing if the keyboard will work or if I need to click first with the mouse.</p>

<p>I put the following code inside draw() to try and see who/what was getting the focus:</p>

<pre><code>if (KeyboardFocusManager.getCurrentKeyboardFocusManager() != null)
    println(millis() + ": " + KeyboardFocusManager.getCurrentKeyboardFocusManager().getFocusOwner());
</code></pre>

<p>It seems like the keystrokes fail when the focus owner shows JFrame or null, and the keystrokes work when the focus starts on the JFrame but then switches to processing.awt.PSurfaceAWT:$SmoothCanvas.  Sometimes it switches on it's own (highly desirable, the whole point of this post) or as the result of a mouse click.</p>

<p>Any suggestions for helping manage the startup focus?  I don't recall having this problem over the last 5-10 years, just over the past year or so (P3 issue?), but no definitive start date due to the intermittency.</p>
]]></description>
   </item>
   <item>
      <title>frame.xxxx Where can i find defintive source of frame. settings?</title>
      <link>https://forum.processing.org/two/discussion/24907/frame-xxxx-where-can-i-find-defintive-source-of-frame-settings</link>
      <pubDate>Tue, 07 Nov 2017 21:53:54 +0000</pubDate>
      <dc:creator>jeffmarc</dc:creator>
      <guid isPermaLink="false">24907@/two/discussions</guid>
      <description><![CDATA[<p>I use fame,addNotify();
frame.setTitle('xxx");</p>

<p>But now see frame.requestFocus()
and others.
What can I do with frame. and where can I find a list of what frame. settings are available and what hey do?
Have searched frame. with no help.
Thanks</p>
]]></description>
   </item>
   <item>
      <title>Moving a translucent window around the screen</title>
      <link>https://forum.processing.org/two/discussion/20499/moving-a-translucent-window-around-the-screen</link>
      <pubDate>Fri, 27 Jan 2017 14:38:15 +0000</pubDate>
      <dc:creator>Bird</dc:creator>
      <guid isPermaLink="false">20499@/two/discussions</guid>
      <description><![CDATA[<p>I have made the window translucent, but that removes the ability to grab the outside of the window to move it (maybe there is a way to allow that?). I get the location of surface and relocate it with the mouse coordinates, but I need the location of the mouse in relationship to the monitor screen. Any ideas on this?</p>

<pre><code>import processing.awt.PSurfaceAWT;
import javax.swing.JFrame;

JFrame frame;

void setup() {
  size(250, 140);
  frame = getJFrame();
  frame.removeNotify();
  frame.setUndecorated(true);
  frame.setOpacity(0.5f);
  frame.addNotify();
}

void draw() {
} 

void keyPressed() {
  if (keyCode == 112) { //F1
    frame.setOpacity(1.0f);
  }
  if (keyCode == 113) { //F2
    frame.setOpacity(0.5f);
  }
}

void mousePressed() {
  if (mouseButton == LEFT) {
    fill(0);
    ellipse(mouseX, mouseY, 5, 5);
  } else if (mouseButton == RIGHT) {
    surface.setLocation(mouseX, mouseY);
  }
}

void mouseDragged() {
  if (mouseButton == LEFT) {
    ellipse(mouseX, mouseY, 5, 5);
  } else if (mouseButton == RIGHT) {
    surface.setLocation(mouseX, mouseY);
  }
}

JFrame getJFrame() {
  PSurfaceAWT surf = (PSurfaceAWT) getSurface();
  PSurfaceAWT.SmoothCanvas canvas = (PSurfaceAWT.SmoothCanvas) surf.getNative();
  return (JFrame) canvas.getFrame();
}
</code></pre>
]]></description>
   </item>
   <item>
      <title>how to do ArrayList of saved images + display and update them when a new image is saved?</title>
      <link>https://forum.processing.org/two/discussion/23892/how-to-do-arraylist-of-saved-images-display-and-update-them-when-a-new-image-is-saved</link>
      <pubDate>Tue, 22 Aug 2017 16:47:13 +0000</pubDate>
      <dc:creator>polispace</dc:creator>
      <guid isPermaLink="false">23892@/two/discussions</guid>
      <description><![CDATA[<p>Hi Good Folks;</p>

<p>I'm pretty principiant with processing and I need some hints for this project, please.</p>

<p>I'm using a PS3 Eye webcam and with a "key pressed" function it saves the frame/image in a folder;</p>

<p>I need to visualize the last 4 images saved which are located in that the folder: from the most recent to the oldest.</p>

<p>Each time a new capture has been taken it should be also displayed in the first image up left and the other one decrease position.</p>

<p>I hope is clear,
Thank you for any supports</p>

<p>Here the code:</p>

<pre><code>import java.util.ArrayList;

import com.thomasdiewald.ps3eye.PS3Eye;
import com.thomasdiewald.ps3eye.PS3EyeP5;

PS3EyeP5 ps3eye;

int startTime;
int counter = 0;
final int FLASH_DURATION = 70;

boolean Flash;

int imageIndex = 0; // Initial image to be displayed is the first
PImage[] microbes = new PImage[4]; // The image array


void setup() {
  size(640, 480);
  smooth(0);
  ps3eye = PS3EyeP5.getDevice(this);
  ps3eye.init(60, PS3Eye.Resolution.VGA);
  ps3eye.start();
  frameRate(1000);
}

void draw() { 

  if (ps3eye !=null) { 
    ps3eye.start();
    image(ps3eye.getFrame(), 0, 160, width, height);
  }


  for (int i = 0; i &lt; 4; i++) {
   microbes[i] = loadImage("print/" + "microbe" +  nf(counter, 4) + ".jpg");
  } 

  image(microbes[3],   0, 0, 160, 160); 
  image(microbes[2], 160, 0, 160, 160); 
  image(microbes[1], 320, 0, 160, 160); 
  image(microbes[0], 480, 0, 160, 160);

  imageIndex = (imageIndex + 1) % 4; // ---&gt; back to zero

  if (Flash) {
    image(loadImage("white.jpg"), -5, 0);
    ps3eye.stop();
  }
  if (millis() - startTime &gt; FLASH_DURATION) {
    Flash = false;
  } else {
    ps3eye.start();
  }
}

void keyPressed() { 

  if ( key == 's' ) {
    PImage s = get(0, 160, 640, 320);
    s.save("print/" + "microbe" + nf(counter, 4) +".jpg");
    counter++;
    imageIndex = int(microbes.length); //--&gt; I don't get what this line one exactly do
    Flash = true;
    startTime = millis();
  }
}
</code></pre>
]]></description>
   </item>
   <item>
      <title>How to access smoothCanvas.getFrame().setUndecorated in Python Mode</title>
      <link>https://forum.processing.org/two/discussion/23716/how-to-access-smoothcanvas-getframe-setundecorated-in-python-mode</link>
      <pubDate>Sat, 05 Aug 2017 09:36:33 +0000</pubDate>
      <dc:creator>megohannes</dc:creator>
      <guid isPermaLink="false">23716@/two/discussions</guid>
      <description><![CDATA[<p>I would like to use this Code I found on the forum, but in Python mode. I just can't figure out how to wirte this in Python:</p>

<pre><code>import processing.awt.PSurfaceAWT;

void setup(){
    PSurfaceAWT awtSurface = (PSurfaceAWT)surface;
    PSurfaceAWT.SmoothCanvas smoothCanvas = (PSurfaceAWT.SmoothCanvas)awtSurface.getNative();
    smoothCanvas.getFrame().setAlwaysOnTop(true);
    smoothCanvas.getFrame().removeNotify();
    smoothCanvas.getFrame().setUndecorated(true);
    smoothCanvas.getFrame().setLocation(200, 200);
    smoothCanvas.getFrame().addNotify();
}
</code></pre>

<p>I would be thankfull for any help!</p>
]]></description>
   </item>
   <item>
      <title>Check visible state</title>
      <link>https://forum.processing.org/two/discussion/22433/check-visible-state</link>
      <pubDate>Sun, 07 May 2017 08:26:15 +0000</pubDate>
      <dc:creator>Fenestron</dc:creator>
      <guid isPermaLink="false">22433@/two/discussions</guid>
      <description><![CDATA[<p>Is it possible to check the visibility state?</p>

<p>For example, I have this code:</p>

<pre lang="java">
void draw() {
  if (!isVisible()) {
    surface.setVisible(true);
  }
}

/**
 * <a href="/two/profile/return">@return</a> true if visible, false otherwise
 */
boolean isVisible() {
  
}
</pre>

<p>What should the <code>isVisible()</code> method look like?</p>
]]></description>
   </item>
   <item>
      <title>About sketch size and position</title>
      <link>https://forum.processing.org/two/discussion/21830/about-sketch-size-and-position</link>
      <pubDate>Wed, 05 Apr 2017 16:34:06 +0000</pubDate>
      <dc:creator>linuxman</dc:creator>
      <guid isPermaLink="false">21830@/two/discussions</guid>
      <description><![CDATA[<p>There are a lot of questions about how to manage the sketch dimensions. It doesn't help that Processing 3 makes a lot of (not so) old solutions useless.
Thanks to <a href="/two/profile/gotoloop">@gotoloop</a>, <a href="/two/profile/quark">@quark</a> and others experts some of us can still get what we want. That's my case.
I know that surface provide setSize and setLocation, but sometimes I like to know the sketch or a G4P window location.
So I wrote this helpers. I'm posting in search of approval/criticism of those who knows a lot more then I do.</p>

<pre><code>import processing.awt.PSurfaceAWT.SmoothCanvas;
import com.jogamp.newt.opengl.GLWindow;

PVector getSize() {
  try {
    if(getGraphics().isGL())
      return new PVector(
        ((GLWindow) surface.getNative()).getWidth(),
        ((GLWindow) surface.getNative()).getHeight()
      );
    else
      return new PVector(
        ((SmoothCanvas) surface.getNative()).getFrame().getWidth(),
        ((SmoothCanvas) surface.getNative()).getFrame().getHeight()
      );
  }
  catch (Exception e)
  {
    return new PVector(0, 0);
  }
}

PVector getSize(PApplet applet) {
  try {
    if(applet.getGraphics().isGL())
      return new PVector(
        ((GLWindow) applet.getSurface().getNative()).getWidth(),
        ((GLWindow) applet.getSurface().getNative()).getHeight()
      );
    else
      return new PVector(
        ((SmoothCanvas) applet.getSurface().getNative()).getFrame().getWidth(),
        ((SmoothCanvas) applet.getSurface().getNative()).getFrame().getHeight()
      );
  }
  catch (Exception e)
  {
    return new PVector(0, 0);
  }
}

PVector getLocation() {
  try {
    if(getGraphics().isGL())
      return new PVector(
        ((GLWindow) getSurface().getNative()).getX(),
        ((GLWindow) getSurface().getNative()).getY()
      );
    else
      return new PVector(
        ((SmoothCanvas) getSurface().getNative()).getFrame().getX(),
        ((SmoothCanvas) getSurface().getNative()).getFrame().getY()
      );
  }
  catch (Exception e) {
    return new PVector(0, 0);
  }
}

PVector getLocation(PApplet applet) {
  try {
    if(applet.getGraphics().isGL())
      return new PVector(
        ((GLWindow) applet.getSurface().getNative()).getX(),
        ((GLWindow) applet.getSurface().getNative()).getY()
      );
    else
      return new PVector(
        ((SmoothCanvas) applet.getSurface().getNative()).getFrame().getX(),
        ((SmoothCanvas) applet.getSurface().getNative()).getFrame().getY()
      );
  }
  catch (Exception e) {
    return new PVector(0, 0);
  }
}
</code></pre>
]]></description>
   </item>
   <item>
      <title>Why this.getX() method is missing in Processing 3.1.1 ?</title>
      <link>https://forum.processing.org/two/discussion/17270/why-this-getx-method-is-missing-in-processing-3-1-1</link>
      <pubDate>Wed, 22 Jun 2016 17:31:42 +0000</pubDate>
      <dc:creator>Zina3575</dc:creator>
      <guid isPermaLink="false">17270@/two/discussions</guid>
      <description><![CDATA[<p>Is there an alternative to this method?
<code>this.getX()</code></p>
]]></description>
   </item>
   <item>
      <title>Changing the Icon of a G4P Window</title>
      <link>https://forum.processing.org/two/discussion/21571/changing-the-icon-of-a-g4p-window</link>
      <pubDate>Fri, 24 Mar 2017 08:32:05 +0000</pubDate>
      <dc:creator>cygig</dc:creator>
      <guid isPermaLink="false">21571@/two/discussions</guid>
      <description><![CDATA[<p><img src="http://i.imgur.com/H9pf97x.png" alt="" /></p>

<p><a href="/two/profile/quark">@quark</a>
Quick question, how do you change the icon of a secondary window created using G4P?</p>
]]></description>
   </item>
   <item>
      <title>Getting Window's Position</title>
      <link>https://forum.processing.org/two/discussion/20453/getting-window-s-position</link>
      <pubDate>Tue, 24 Jan 2017 18:17:02 +0000</pubDate>
      <dc:creator>cygig</dc:creator>
      <guid isPermaLink="false">20453@/two/discussions</guid>
      <description><![CDATA[<p>Another quick question: How do I get the current sketch window's X and Y position? I searched through the forums and tried frame.getX() and frame.getLocationOnScreen().x, but they do not seem to work. frame.getX always return 0, even when it is obviously not. Thanks!</p>
]]></description>
   </item>
   <item>
      <title>Java getToolkit() question</title>
      <link>https://forum.processing.org/two/discussion/18456/java-gettoolkit-question</link>
      <pubDate>Sat, 08 Oct 2016 09:47:29 +0000</pubDate>
      <dc:creator>shawnlau</dc:creator>
      <guid isPermaLink="false">18456@/two/discussions</guid>
      <description><![CDATA[<p>I'm trying to update a program I wrote in Processing 2.2.1 to Processing 3.2.1.</p>

<p>The following code runs fine in Processing 2. In processing 3 it throws an error that "getToolkit() does not exist."
I have to use "Toolkit.getDefaulToolkit().getSystemClipboard()." Why does this break in Processing 3?</p>

<pre><code>import java.awt.datatransfer.Clipboard;
import java.awt.datatransfer.Transferable;
import java.awt.datatransfer.DataFlavor;
import java.awt.datatransfer.UnsupportedFlavorException;


Object GetFromClipboard(DataFlavor flavor)
{
  Clipboard clipboard = getToolkit().getSystemClipboard();
  Transferable contents = clipboard.getContents(null);
  Object obj = null;
  if (contents != null &amp;&amp; contents.isDataFlavorSupported(flavor))
  {
    try
    {
     obj = contents.getTransferData(flavor);
    }
    catch (UnsupportedFlavorException exu) // Unlikely but we must catch it
    {
     println("Unsupported flavor: " + exu);
//~      exu.printStackTrace();
    }
    catch (java.io.IOException exi)
    {
     println("Unavailable data: " + exi);
//~      exi.printStackTrace();
    }
  }
  return obj;
} 
</code></pre>
]]></description>
   </item>
   <item>
      <title>embedding PApplet in Java JFrame</title>
      <link>https://forum.processing.org/two/discussion/12774/embedding-papplet-in-java-jframe</link>
      <pubDate>Thu, 01 Oct 2015 14:35:54 +0000</pubDate>
      <dc:creator>akenaton</dc:creator>
      <guid isPermaLink="false">12774@/two/discussions</guid>
      <description><![CDATA[<p>till processing 3 i have often made that successfully. Yesterday, answering to some question that you can see here 
<a rel="nofollow" href="http://forum.processing.org/two/discussion/12624/can-i-launch-an-instance-of-processing-inside-of-a-control-on-a-sketch#latest">forum.processing.org/two/discussion/12624/can-i-launch-an-instance-of-processing-inside-of-a-control-on-a-sketch#latest</a>
i posted the code you can see at the same url. This code works, i have used it many times and tested the snippet i put. Yet theOP said me "this code does not work, it fires that the applet.init() method does not exist" and he added that he was using processing 3. So, i went to the docs / changes &amp;&amp; found that:</p>

<p>"As of Processing 3.0, we have removed Applet as the base class for PApplet. This means that we can remove lots of legacy code, however one downside is that it's no longer possible (without extra code) to embed a PApplet into another Java application"</p>

<p>ok. But i would be very happy to understand by an example what kind of "extra code" i could use...
thanks in advance</p>
]]></description>
   </item>
   <item>
      <title>this is GoToLoop 's code,how to make it work in P3D ? (JFrame)</title>
      <link>https://forum.processing.org/two/discussion/17309/this-is-gotoloop-s-code-how-to-make-it-work-in-p3d-jframe</link>
      <pubDate>Sun, 26 Jun 2016 11:12:11 +0000</pubDate>
      <dc:creator>venitable</dc:creator>
      <guid isPermaLink="false">17309@/two/discussions</guid>
      <description><![CDATA[<pre><code>        // forum.Processing.org/two/discussion/17270/
        // why-this-getx-method-is-missing-in-processing-3-1-1#Item_5

        // GoToLoop (2016-Jun-24)
      void setup() {
         //size(200,200,P3D);  
          println(getJFrame(getSurface()).getX());
          exit();
        }

        static final javax.swing.JFrame getJFrame(final PSurface surf) {
          return
            (javax.swing.JFrame)
            ((processing.awt.PSurfaceAWT.SmoothCanvas)
            surf.getNative()).getFrame();
        }
</code></pre>

<p>I got cast error in P3D mode</p>
]]></description>
   </item>
   <item>
      <title>Limiting window resize to a certain minimum</title>
      <link>https://forum.processing.org/two/discussion/15398/limiting-window-resize-to-a-certain-minimum</link>
      <pubDate>Thu, 10 Mar 2016 04:40:45 +0000</pubDate>
      <dc:creator>jmusther</dc:creator>
      <guid isPermaLink="false">15398@/two/discussions</guid>
      <description><![CDATA[<p>I'm trying to provide a minimum window size for a window that can be resized.  Currently, I'm achieving this with the following:</p>

<pre><code>void setup() {
  size(400, 300);
  pixelDensity(displayDensity());
  frameRate(20);
  surface.setResizable(true);
}

void draw() {
  // Deal with window size:
  if (width &lt; 400) {
    surface.setSize(400, height);
  }
  if (height &lt; 300) {
    surface.setSize(width, 300);
  }
}
</code></pre>

<p>While this does work, it's gittery as you'd expect.  If you drag the corner or edge of the window to make it smaller than the lower limit, it looks very unpleasant.</p>

<p>I've done plenty of googling and there are lots of examples of how to do this in Processing 2 and oder, perhaps the cleanest uses frame.setMinimumSize(); but of course in P3 this is no longer available - there is no similar PSurface method.</p>

<p>Does anyone know how this 'should' be done now?</p>
]]></description>
   </item>
   <item>
      <title>Processing 3 OpenGL in a Java app</title>
      <link>https://forum.processing.org/two/discussion/13883/processing-3-opengl-in-a-java-app</link>
      <pubDate>Thu, 10 Dec 2015 21:05:38 +0000</pubDate>
      <dc:creator>jfred1979</dc:creator>
      <guid isPermaLink="false">13883@/two/discussions</guid>
      <description><![CDATA[<p>I'm trying to figure out how to get Processing 3 to play nicely as a library in a Java app. The app might potentially have Swing and/or AWT components somewhere in its lifecycle. I don't necessarily need the Swing and AWT stuff to be on screen AT THE SAME TIME as the Processing rendered stuff, but they need to at least be in the same window or full screen display. Using the Java2D renderer I can sort of do this like so (as referenced in some other threads):</p>

<p>in my PApplet based class:</p>

<pre><code>public SmoothCanvas getCanvas() {
  PSurfaceAWT awtSurface = (PSurfaceAWT)surface;
  PSurfaceAWT.SmoothCanvas smoothCanvas = (PSurfaceAWT.SmoothCanvas)awtSurface.getNative();
  return smoothCanvas;
}
</code></pre>

<p>In my main class, which extends JFrame:</p>

<pre><code>String[] args = {TestApplet.class.getName()};
ControlApplet app = new TestApplet();
TestApplet.runSketch(args, app);

JFrame pFrame = (JFrame) app.getCanvas().getFrame();
pFrame.setVisible(false);
getContentPane().add(app.getCanvas());
pFrame.dispose(); 
</code></pre>

<p>That achieves the goal, however there are two problems: it still pops up the initial Processing window for a brief second until I am able to gab the Frame and attach it to the base JFrame, and it only works in Java2D.</p>

<p>I'm trying to get my head around the hierarchy of JOGL and how I can grab ahold of a container somewhere that I might be able to attach to a "regular" Java container of some sort. Any insights on how I might do this?</p>
]]></description>
   </item>
   <item>
      <title>How to start sketch fullscreen or windowed with v3.0 depending on start command ?</title>
      <link>https://forum.processing.org/two/discussion/13012/how-to-start-sketch-fullscreen-or-windowed-with-v3-0-depending-on-start-command</link>
      <pubDate>Wed, 14 Oct 2015 13:46:23 +0000</pubDate>
      <dc:creator>martinSteiger</dc:creator>
      <guid isPermaLink="false">13012@/two/discussions</guid>
      <description><![CDATA[<p>There are 2 possibilities to start a sketch:</p>

<ul>
<li><p>Sketch Run     (Ctrl-R)          run windowed</p></li>
<li><p>Sketch Present (Ctrl-Shift-R)    run fullscreen</p></li>
</ul>

<p>In case of sketch is started with 'Run' command, a window with defined size should be opened.
    e.g.:  size(800, 480, P3D);</p>

<p>On the other hand, it should be startet fullscreen!
    e.g.:  size(displayWidth, displayHeight, P3D);</p>

<p>This will result e.g. to this coding:</p>

<pre><code>// fullScreen should become a global variable provided by Processing! 
boolean fullScreen = false; // true if started with Ctrl-Shift-R
                            // false if startet with Ctrl-R 
void setup()
{ if (fullScreen)
     size(displayWidth, displayHeight);  // start full screen
  if (!fullScreen)
    size(800, 480);                  // start windowed
}
void draw()
{ background(111);
  textSize(60);
  textAlign(CENTER, CENTER);
  text ("drawing size: " + width + "*" + height, width/2, height/2-60);
  text ("screen size: " + displayWidth + "*" + displayHeight, width/2, height/2+60);
}     // this example works with processing v2.2.1.
</code></pre>

<p>But with processing v3.0 it's not allowed to use size(x,y,mode) twice.
  See <a href="https://processing.org/reference/size_.html" target="_blank" rel="nofollow">https://processing.org/reference/size_.html</a></p>

<p>Now some questions about this starting problem:</p>

<ul>
<li><p>Can I get an information on how the sketch was started?</p></li>
<li><p>Is it possible to start a sketch with defined window size
or fullscreen depending on the start command?</p></li>
<li><p>If mode=JavaScript, sketch should start with a defined window size.
If mode=Android, sketch should always be started fullscreen.
How can this be made?</p></li>
</ul>

<p>ps. Some infos about it</p>

<p><a href="https://github.com/processing/processing/wiki/Window-Size-and-Full-Screen" target="_blank" rel="nofollow">https://github.com/processing/processing/wiki/Window-Size-and-Full-Screen</a></p>
]]></description>
   </item>
   <item>
      <title>Processing 3: init() disappearance</title>
      <link>https://forum.processing.org/two/discussion/12260/processing-3-init-disappearance</link>
      <pubDate>Wed, 26 Aug 2015 09:42:08 +0000</pubDate>
      <dc:creator>PeterP</dc:creator>
      <guid isPermaLink="false">12260@/two/discussions</guid>
      <description><![CDATA[<p>I used to do some stuff in init() to create an undecorated (non-full-screen), always on top window at a specific position like this:</p>

<p><code>public void init() {
      frame.setAlwaysOnTop(true);
      frame.removeNotify();
      frame.setUndecorated(true);
      frame.setLocation(0, 0);
      super.init();
    }</code></p>

<p>Since init() has disappeared (and frame stuff is deprecated), how is this still possible. I browsed the PApplet and the PSurface code, but I'm not getting it... Only found solutions for full-screen...</p>

<p>Regards,
Peter</p>
]]></description>
   </item>
   <item>
      <title>Prevent closing all frames</title>
      <link>https://forum.processing.org/two/discussion/11562/prevent-closing-all-frames</link>
      <pubDate>Sat, 04 Jul 2015 14:45:13 +0000</pubDate>
      <dc:creator>clankill3r</dc:creator>
      <guid isPermaLink="false">11562@/two/discussions</guid>
      <description><![CDATA[<p>I want to make a sketch that can open other sketches.
So far it goes good but I can't change the behaviour of the sketches that are opened on runtime.</p>

<p>Why has the setDefaultCloseOperation no effect?</p>

<p>(Also, it should be DISPOSE_ON_CLOSE but I'm using DO_NOTHING_ON_CLOSE for testing).</p>

<pre><code>public class AllSketches extends PApplet {

    public static void main(String[] args) {
        PApplet.main("forMyself.AllSketches", args);
    }

    P5_BackFaceCulling backFaceCulling;

    public void setup() {


        // works
        ((JFrame)getFrame()).setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);

    }

    public void draw() {

    }

    public void keyPressed() {
        if (key == '1') {
            println("test");

            Frame f = backFaceCulling.getFrame();

            if (f instanceof JFrame) {
                // why has this no effect?
                ((JFrame)f).setDefaultCloseOperation(JFrame.DO_NOTHING_ON_CLOSE);
                println("changed setDefaultCloseOperation");
            }

        }
    }

}
</code></pre>
]]></description>
   </item>
   </channel>
</rss>