<?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 setlocation() - Processing 2.x and 3.x Forum</title>
      <link>https://forum.processing.org/two/discussions/tagged/feed.rss?Tag=setlocation%28%29</link>
      <pubDate>Sun, 08 Aug 2021 19:43:05 +0000</pubDate>
         <description>Tagged with setlocation() - Processing 2.x and 3.x Forum</description>
   <language>en-CA</language>
   <atom:link href="/two/discussions/taggedsetlocation%28%29/feed.rss" rel="self" type="application/rss+xml" />
   <item>
      <title>How to pick the place in the screen when run the sketch</title>
      <link>https://forum.processing.org/two/discussion/28040/how-to-pick-the-place-in-the-screen-when-run-the-sketch</link>
      <pubDate>Tue, 05 Jun 2018 04:08:27 +0000</pubDate>
      <dc:creator>vjjv</dc:creator>
      <guid isPermaLink="false">28040@/two/discussions</guid>
      <description><![CDATA[<p>hello. at this time when i run my sketch 3 differents windows (PAplets) are opening, to controll different parameters of objects. but all of them open in the same place (the center of the screen), so i need to move it to see it. is there any way to pick the place of the windows when the sketch is ejecute? e.x one next to the other.</p>
]]></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>How to set the initial location of the canva relative to screen display ?</title>
      <link>https://forum.processing.org/two/discussion/14138/how-to-set-the-initial-location-of-the-canva-relative-to-screen-display</link>
      <pubDate>Thu, 24 Dec 2015 18:20:50 +0000</pubDate>
      <dc:creator>Furrane</dc:creator>
      <guid isPermaLink="false">14138@/two/discussions</guid>
      <description><![CDATA[<p>Hello guys !</p>

<p>I think the title says it all : I'm working on a widget that auto run when the pc boots, and I really need to be able to control where it's gonna pop ( and why not if you guys now, if possible to lock it in place ).</p>

<p>After some research on google I found the " frame.setLocation(x,y) " command but it doesn't seem to work. Do I need a specific library loaded before using this ?</p>

<p>Thanks anyone for help =)</p>
]]></description>
   </item>
   <item>
      <title>.setLocation() doesn't seem to work (used in draw method) (Eclipse)</title>
      <link>https://forum.processing.org/two/discussion/22308/setlocation-doesn-t-seem-to-work-used-in-draw-method-eclipse</link>
      <pubDate>Sun, 30 Apr 2017 20:12:53 +0000</pubDate>
      <dc:creator>TPRammus</dc:creator>
      <guid isPermaLink="false">22308@/two/discussions</guid>
      <description><![CDATA[<p>Hey!</p>

<p>I cant seem to get this .setLocation() to work. <strong>.setTitle()</strong> works just fine btw.
I tried surface.setLocation() as well as frame.setLocation(). Either doesn't work.
Could it be that its a specific issue with Eclipse somehow?
Here's some code:</p>

<pre><code>public static boolean firstTimeDraw = true;
//...
public void draw() {
    if (firstTimeDraw) {
        frame.setLocation(990, 512);
        firstTimeDraw = false;
    }
}
//...
</code></pre>

<p>regards, TPRammus</p>
]]></description>
   </item>
   <item>
      <title>Exit sketch but preserve parent process</title>
      <link>https://forum.processing.org/two/discussion/13467/exit-sketch-but-preserve-parent-process</link>
      <pubDate>Tue, 10 Nov 2015 11:54:38 +0000</pubDate>
      <dc:creator>munkey</dc:creator>
      <guid isPermaLink="false">13467@/two/discussions</guid>
      <description><![CDATA[<p>Hi,
Im new to processing and I have just got started using it with java. At the minute I have a java swing application which spawns a separate sketch window using PApplet.runSketch(). When the window is closed either by pressing escape, pressing the X or calling .exit() on the PApplet, the entire program including the swing main program closes with it.</p>

<p>Is there a way I can make it so when sketch is closed it does not kill off my entire program and just closes the sketch window?</p>

<p>Thanks.</p>
]]></description>
   </item>
   <item>
      <title>Two windows in Eclipse</title>
      <link>https://forum.processing.org/two/discussion/17498/two-windows-in-eclipse</link>
      <pubDate>Tue, 12 Jul 2016 14:33:06 +0000</pubDate>
      <dc:creator>CharlesDesign</dc:creator>
      <guid isPermaLink="false">17498@/two/discussions</guid>
      <description><![CDATA[<p>Hi there,</p>

<p>Following the "frame" example from the CP5 library I tried to implement two windows in my Eclipse project.
I've managed to get it running but three out of four times I get the following error message  which I believe is being caused by this line but I may be wrong.</p>

<pre><code>p.runSketch(new String[] { this.getClass().getName() }, this);
</code></pre>

<p>It also gives me this message but I doubt it has anything to do with the error.</p>

<blockquote class="Quote">
  <p>The static method runSketch(String[], PApplet) from the type PApplet should be accessed in a static way</p>
</blockquote>

<p>Thanks in advance :)
Charles</p>

<p>Ps: The sketch runs fine in processing just not in Eclipse</p>

<pre><code>import peasy.PeasyCam;
import processing.core.PApplet;
import processing.core.PConstants;
import processing.core.PImage;

public class MAIN extends PApplet {

  PeasyCam cam;
  ControlFrame cf;

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

  public void settings() {
    size((int) (1366 * 0.7f), 730, P3D);
  }

  public void setup() {
    colorMode(PConstants.HSB);
    surface.setLocation((int) (1366 * 0.3), 0);
    cf = new ControlFrame(this, (int) (1366 * 0.3), 730, "Controls");
  }

  public void draw() {

    background(Ui.gradient);
    surface.setTitle(nf(frameRate, 2, 2) + " .fps");
  }
}

import controlP5.ControlP5;
import processing.core.PApplet;
import processing.core.PConstants;
import processing.core.PImage;

class ControlFrame extends PApplet {

  int w, h;
  PApplet p;
  static ControlP5 cp5;

  public ControlFrame(PApplet _p, int _w, int _h, String _name) {
    super();
    p = _p;
    w = _w;
    h = _h;
    p.runSketch(new String[] { this.getClass().getName() }, this);
  }

  public void settings() {
    size(w, h);
  }

  public void setup() {
    surface.setLocation(0, 0);
    surface.setTitle("PHEET - Controls | V3.0");
    frameRate(50);
    colorMode(HSB);

    cp5.addToggle("orth").setPosition((int) (width * 0.01), (int) (height * 0.2)).setSize(50, 15).setValue(true)
      .setMode(ControlP5.SWITCH).plugTo(p, "orth");
    ;
  }

  public void draw() {
    background(245);
  }
}

 RunnableTask.run(): A caught exception occured on thread main-Display-.macosx_nil-1-EDT-1: RunnableTask[enqueued true[executed false, flushed false], tTotal 0 ms, tExec 0 ms, tQueue 0 ms, attachment null, throwable java.lang.RuntimeException: Waited 5000ms for: &lt;18f5617, ec6eb5b&gt;[count 2, qsz 0, owner &lt;main-FPSAWTAnimator#00-Timer0&gt;] - &lt;main-Display-.macosx_nil-1-EDT-1&gt;]
 java.lang.RuntimeException: Waited 5000ms for: &lt;18f5617, ec6eb5b&gt;[count 2, qsz 0, owner &lt;main-FPSAWTAnimator#00-Timer0&gt;] - &lt;main-Display-.macosx_nil-1-EDT-1&gt;
 at jogamp.common.util.locks.RecursiveLockImpl01Unfairish.lock(RecursiveLockImpl01Unfairish.java:198)
 at jogamp.newt.WindowImpl$SetPositionAction.run(WindowImpl.java:2884)
 at jogamp.newt.DisplayImpl.runOnEDTIfAvail(DisplayImpl.java:450)
 at jogamp.newt.WindowImpl.runOnEDTIfAvail(WindowImpl.java:2782)
 at jogamp.newt.WindowImpl.setPosition(WindowImpl.java:2911)
 at jogamp.newt.WindowImpl.setTopLevelPosition(WindowImpl.java:2917)
 at com.jogamp.newt.opengl.GLWindow.setTopLevelPosition(GLWindow.java:514)
 at processing.opengl.PSurfaceJOGL$7.run(PSurfaceJOGL.java:767)
 at com.jogamp.common.util.RunnableTask.run(RunnableTask.java:127)
 at jogamp.newt.DefaultEDTUtil$NEDT.run(DefaultEDTUtil.java:375)
 DefaultEDT.run(): Caught exception occured on thread main-Display-.macosx_nil-1-EDT-1: RunnableTask[enqueued false[executed true, flushed false], tTotal 5002 ms, tExec 5002 ms, tQueue 0 ms, attachment null, throwable java.lang.RuntimeException: Waited 5000ms for: &lt;18f5617, ec6eb5b&gt;[count 2, qsz 0, owner &lt;main-FPSAWTAnimator#00-Timer0&gt;] - &lt;main-Display-.macosx_nil-1-EDT-1&gt;]
 java.lang.RuntimeException: Waited 5000ms for: &lt;18f5617, ec6eb5b&gt;[count 2, qsz 0, owner &lt;main-FPSAWTAnimator#00-Timer0&gt;] - &lt;main-Display-.macosx_nil-1-EDT-1&gt;
 at jogamp.common.util.locks.RecursiveLockImpl01Unfairish.lock(RecursiveLockImpl01Unfairish.java:198)
 at jogamp.newt.WindowImpl$SetPositionAction.run(WindowImpl.java:2884)
 at jogamp.newt.DisplayImpl.runOnEDTIfAvail(DisplayImpl.java:450)
 at jogamp.newt.WindowImpl.runOnEDTIfAvail(WindowImpl.java:2782)
 at jogamp.newt.WindowImpl.setPosition(WindowImpl.java:2911)
 at jogamp.newt.WindowImpl.setTopLevelPosition(WindowImpl.java:2917)
 at com.jogamp.newt.opengl.GLWindow.setTopLevelPosition(GLWindow.java:514)
 at processing.opengl.PSurfaceJOGL$7.run(PSurfaceJOGL.java:767)
 at com.jogamp.common.util.RunnableTask.run(RunnableTask.java:127)
 at jogamp.newt.DefaultEDTUtil$NEDT.run(DefaultEDTUtil.java:375)
</code></pre>
]]></description>
   </item>
   <item>
      <title>Processing 3: How to setUndecorated(true)</title>
      <link>https://forum.processing.org/two/discussion/12200/processing-3-how-to-setundecorated-true</link>
      <pubDate>Sat, 22 Aug 2015 00:12:34 +0000</pubDate>
      <dc:creator>IcyIcicle</dc:creator>
      <guid isPermaLink="false">12200@/two/discussions</guid>
      <description><![CDATA[<p>As a reference for other people who need help in the transition from Processing 2 to 3:</p>

<p>Processing 2:</p>

<pre><code>void init() {
    frame.removeNotify();
    frame.setUndecorated(true);
    frame.addNotify();
    super.init();
}
</code></pre>

<p>Processing 3:</p>

<pre><code>void settings() {
    fullScreen();
}
void setup() {
    surface.setSize(500,500);
}
</code></pre>

<p>Hope this helps!</p>

<p>-Icy</p>
]]></description>
   </item>
   <item>
      <title>positioning a window other than centered from an exported exe</title>
      <link>https://forum.processing.org/two/discussion/14559/positioning-a-window-other-than-centered-from-an-exported-exe</link>
      <pubDate>Wed, 20 Jan 2016 18:26:51 +0000</pubDate>
      <dc:creator>flyguyg</dc:creator>
      <guid isPermaLink="false">14559@/two/discussions</guid>
      <description><![CDATA[<p>First post. Thanks for the opportunity.
Want to show dots representing births and deaths of individuals over several generations on 3 maps (Scotland/France/Canada). The sketch part is under way, one for each map but I would like to be able to position the 3 exe results on the presentation space. How can I define window origin?</p>
]]></description>
   </item>
   <item>
      <title>Change which display in code, not in settings?</title>
      <link>https://forum.processing.org/two/discussion/12243/change-which-display-in-code-not-in-settings</link>
      <pubDate>Tue, 25 Aug 2015 07:29:40 +0000</pubDate>
      <dc:creator>MrPumpernickel</dc:creator>
      <guid isPermaLink="false">12243@/two/discussions</guid>
      <description><![CDATA[<p>I'm back, with another conundrum!</p>

<p>I always have an external monitor attached, and I consistently run sketches on both my main and external monitor, often time in present mode. Is there a way to, in code, tell which monitor to run the sketch on, rather than having to tediously change it in the settings each time?</p>

<p>I know you can do frame.setLocation(x,y), but is that the only way to define where the window ends up? What does the setting in preferences actually do behind the scenes, and can I access that in code?</p>
]]></description>
   </item>
   <item>
      <title>how do I set  SetUndecorated to true after  after Processing launches?</title>
      <link>https://forum.processing.org/two/discussion/11752/how-do-i-set-setundecorated-to-true-after-after-processing-launches</link>
      <pubDate>Sat, 18 Jul 2015 17:45:48 +0000</pubDate>
      <dc:creator>evilhatter</dc:creator>
      <guid isPermaLink="false">11752@/two/discussions</guid>
      <description><![CDATA[<p>I want to be able to remove the window frame and re-enable the window frame. When I try to remove the frame do it I lose all Mouse and key control  for the sketch. So I am definitely unable to add the frame back in.</p>

<pre><code>void setup(){
size(830, 650 );

}



void draw(){
background(0,0,255);

}

void mousePressed(){
exit();

}

int window = 1;

void keyPressed() {


  if (key=='f') {
    if (window==1) {

      // to make a frame not displayable, you can
      // use frame.removeNotify()
     frame.removeNotify();
      frame.setUndecorated(true);

      // addNotify, here i am not sure if you have 
      // to add notify again.  
      frame.addNotify();
      super.init();
      frame.setLocation(0, 0);
      size(830, 650);

      window=2;

    } else if(window ==2) {

      // to make a frame not displayable, you can
      // use frame.removeNotify()
      frame.removeNotify();
      frame.setUndecorated(false);
      // addNotify, here i am not sure if you have 
      // to add notify again.  
      frame.addNotify();
      super.init();
      size(500,500);
      window=1;
    }
  }
}
</code></pre>
]]></description>
   </item>
   <item>
      <title>Is it possible to have my desktop background as an interactive processing program ?</title>
      <link>https://forum.processing.org/two/discussion/11637/is-it-possible-to-have-my-desktop-background-as-an-interactive-processing-program</link>
      <pubDate>Thu, 09 Jul 2015 23:22:02 +0000</pubDate>
      <dc:creator>PlzHelp</dc:creator>
      <guid isPermaLink="false">11637@/two/discussions</guid>
      <description><![CDATA[<p>Could I make my wallpaper an active processing application?</p>

<p>if so how ?</p>
]]></description>
   </item>
   </channel>
</rss>