Pages: [1]   Go Down
Author Topic: IDE weirdness - window does not always get repainted  (Read 1982 times)
0 Members and 1 Guest are viewing this topic.
Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I was just typing in a small, simple, sketch to help with a forum issue.

IDE 1.0. Mac version.

This sketch:

Code:
#include <iterator>
#include <string>
#include <pnew.cpp>
#

void setup ()
 {
   std::string foo = "Hello, world";
   
   Serial.begin (115200);
   Serial.println (foo.c_str ());
 }
 void loop () {}

Now, and this has happened before a few times suddenly the screen goes mostly blank, like this:



The cursor is down at the end (where I was typing) so I up-arrow a bit, and see this:



Up-arrow a bit more and see this:



No changes, just moving the cursor around.

Right now, as I type this, the window looks like the top screen dump, but I was able to hit copy, and paste the sketch into this message. So clearly the text is there, but it is not displaying it.

Oh yes, and in the error window at the bottom all this stuff appears:

Code:
java.lang.ArrayIndexOutOfBoundsException: 69
at processing.app.syntax.SyntaxUtilities.paintSyntaxLine(SyntaxUtilities.java:151)
at processing.app.syntax.TextAreaPainter.paintSyntaxLine(TextAreaPainter.java:644)
at processing.app.syntax.TextAreaPainter.paintLine(TextAreaPainter.java:603)
at processing.app.syntax.TextAreaPainter.paint(TextAreaPainter.java:415)
at javax.swing.JComponent.paintChildren(JComponent.java:862)
at javax.swing.JComponent.paint(JComponent.java:1038)
at javax.swing.JComponent.paintChildren(JComponent.java:862)
at javax.swing.JComponent.paint(JComponent.java:1038)
at javax.swing.JComponent.paintChildren(JComponent.java:862)
at javax.swing.JSplitPane.paintChildren(JSplitPane.java:1030)
at javax.swing.JComponent.paint(JComponent.java:1038)
at javax.swing.JComponent.paintChildren(JComponent.java:862)
at javax.swing.JComponent.paint(JComponent.java:1038)
at javax.swing.JComponent.paintChildren(JComponent.java:862)
at javax.swing.JComponent.paint(JComponent.java:1038)
at javax.swing.JComponent.paintChildren(JComponent.java:862)
at javax.swing.JComponent.paint(JComponent.java:1038)
at javax.swing.JComponent.paintChildren(JComponent.java:862)
at javax.swing.JComponent.paint(JComponent.java:1038)
at javax.swing.JLayeredPane.paint(JLayeredPane.java:567)
at javax.swing.JComponent.paintChildren(JComponent.java:862)
at javax.swing.JComponent.paint(JComponent.java:1038)
at javax.swing.JComponent._paintImmediately(JComponent.java:5098)
at javax.swing.JComponent.paintImmediately(JComponent.java:4882)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:812)
at javax.swing.RepaintManager.paintDirtyRegions(RepaintManager.java:714)
at javax.swing.RepaintManager.prePaintDirtyRegions(RepaintManager.java:694)
at javax.swing.RepaintManager.access$700(RepaintManager.java:41)
at javax.swing.RepaintManager$ProcessingRunnable.run(RepaintManager.java:1672)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:677)
at java.awt.EventQueue.access$000(EventQueue.java:85)
at java.awt.EventQueue$1.run(EventQueue.java:638)
at java.awt.EventQueue$1.run(EventQueue.java:636)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.AccessControlContext$1.doIntersectionPrivilege(AccessControlContext.java:87)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:647)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
Error repainting line range {0,47}:
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Further testing appears to indicate that typing a line like this triggers it:

Code:
#

Now, of course you will say "well don't do that".

But to be fair, I was planning to type:

Code:
#include <string>

It is kind of hard to type that when the window goes blank after the initial # is typed.

Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

So, no comments, huh?

Can anyone reproduce this at least?
Logged

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 200
Posts: 12768
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


I cannot reproduce it and I've never seen anything like it (Windows 7 64b and Vista 32b; Arduino 1.0).

Quote
Further testing appears to indicate that typing a line like this triggers it: #

Typing a # into an empty sketch causes triggers the symptom?

"string" is highlighted for you but is not for me.  But that does not appear to be relevant; this is fine here...
Code:
#include <loop>
#include <setup>
void setup( void ) { }
void loop( void ) { }
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

"string" is highlighted for you but is not for me.  But that does not appear to be relevant; this is fine here...
Code:
#include <loop>
#include <setup>
void setup( void ) { }
void loop( void ) { }

I entered your above sketch into Arduino 1.0 on Windows XP. So far so good. I typed a single "#" after the two include lines. Now I see this:



Clicking on the window appears to trigger the behaviour (ie. somewhere in the code).

On OS/X Lion with 1.0 of the IDE, identical behaviour:



The remaining lines have disappeared and a lot of Java errors occur.


I just downloaded it under Windows 7. The problem did not occur there.

Logged

Global Moderator
Dallas
Online Online
Shannon Member
*****
Karma: 200
Posts: 12768
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


Is there a way to check the Java version under the errant operating systems?  

On my Vista computer, "java -version" in a command shell returns this from the Arduino folder (I assume this is the version used by the Arduino IDE)...

  java version "1.6.0_16"
  Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
  Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode)


And this from the root of C...

  java version "1.6.0_31"
  Java(TM) SE Runtime Environment (build 1.6.0_31-b05)
  Java HotSpot(TM) Client VM (build 20.6-b01, mixed mode, sharing)

Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Mac:

Code:
java version "1.6.0_29"
Java(TM) SE Runtime Environment (build 1.6.0_29-b11-402-11D50b)
Java HotSpot(TM) 64-Bit Server VM (build 20.4-b02-402, mixed mode)

Windows XP (java in the java\bin folder of the Arduino install directory):

Code:
java version "1.6.0_16"
Java(TM) SE Runtime Environment (build 1.6.0_16-b01)
Java HotSpot(TM) Client VM (build 14.2-b01, mixed mode)

Ditto on Windows 7 of course, because it is the same downloaded files.

On Windows "java -version" returns:

Code:
'java' is not recognized as an internal or external command,
operable program or batch file.

So I guess it is using the one in the Arduino folder, but who knows for sure?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This is a bug in the IDE. I discovered it independently last week. Found your thread while searching for a place to report it.

Take a look at your libraries. I'm guessing you made some of your own? I suspect one has a keywords.txt with an error.

I can reproduce the behavior you explained by having a library including a keywords.txt where a keyword is defined as "KEYWORD" instead of "KEYWORD1" or "KEYWORD2" etc.
Logged

Anchorage, AK
Offline Offline
Edison Member
*
Karma: 42
Posts: 1176
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Anyone seen a case where the menus don't draw properly?

On my XP machine with dual monitors (on a relatively recent Radeon board), the menus are unusable on the primary monitor.  Clicking on them causes the labels to disappear, the menu background color to shift a little, and sluggish response.  I can usually move the mouse to where the option should be and sometimes it'll render that part of the menu long enough to see what I'm supposed to click on.  Sometimes it locks the window until I kill Java.

If I move the window to the secondary monitor, menus work fine.
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I haven't seen that, however I use a Mac usually. Sometimes the File -> Sketchbook menu can be slow to draw initially but that, I think, is because it scans the entire sketches folder to build up the list, and I'm starting to accumulate a lot of them.
Logged

Pages: [1]   Go Up
Jump to: