Re: [kaffe] kaffe and AWT on MIPS with multiple windows

2005-10-06 Thread Gianluca Moro
 
 --- Gianluca Moro [EMAIL PROTECTED] wrote:
 
  Hi all,
  
  I'm working on the porting of KAFFE on MIPS platform, with
  AWT and Nano-X interface.
  
  My current problem is a helloworld program with
  multiple frames: the problem is that all the drawing
  is done on the first created frame: it seems thar AWT
  do not keep the id of the various frame, or do not update it
  or something so ...
  (the code on Kaffe on PC works OK)
  
  Anyone already found something similar?
 
 
 Looking around in the code, I noted in file
 libraries/clib/awt/nano-X/graphics.c, function
 Java_java_awt_Toolkit_graInitGraphics
 the following code
 
 if ( graphicsP == NULL ) {
 graphicsP = (TLKGraphics*) TLK_MALLOC( sizeof(TLKGraphics));
 graphicsP-gc = GrNewGC();
 graphicsP-region = 0;
 graphicsP-target = (GR_ID)target;
 graphicsP-targetType = targetType;
 graphicsP-gid = (TLK_GRAPHICS_ID)graphicsP;
 graphicsP-magicNo = TLK_GRAPHICS_MAGIC_NO;
 }
 
 which do not update target if graphicsP is already initialized
 I think the code should be
 
 if ( graphicsP == NULL ) {
 graphicsP = (TLKGraphics*) TLK_MALLOC( sizeof(TLKGraphics));
 graphicsP-gc = GrNewGC();
 graphicsP-region = 0;
 graphicsP-gid = (TLK_GRAPHICS_ID)graphicsP;
 graphicsP-magicNo = TLK_GRAPHICS_MAGIC_NO;
 }
 graphicsP-target = (GR_ID)target;
 graphicsP-targetType = targetType;
 
 where target is always initialized (this draw all the windows)
 Now the problem is that a background windows is not refreshed :-(
 
 bye
 giammy


--
Gianluca Moro Visit  http://ilpinguino.altervista.org/
[EMAIL PROTECTED]  MyBlog http://blog.libero.it/giangiammy/



__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

___
kaffe mailing list
kaffe@kaffe.org
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe


[kaffe] kaffe and AWT on MIPS with multiple windows

2005-10-05 Thread Gianluca Moro
Hi all,

I'm working on the porting of KAFFE on MIPS platform, with
AWT and Nano-X interface.

My current problem is a helloworld program with
multiple frames: the problem is that all the drawing
is done on the first created frame: it seems thar AWT
do not keep the id of the various frame, or do not update it
or something so ...
(the code on Kaffe on PC works OK)

Anyone already found something similar?

thanks
giammy


Here the example code

import java.awt.*;
import java.awt.event.*;

public class HelloWorld extends Frame {

String str;

public HelloWorld (String s) {
str = s;
}

public static void main(String[] args) throws Exception {
final Frame frame = new HelloWorld(Hello1);
final Frame frame2 = new HelloWorld(Hello2);
final Frame frame3 = new HelloWorld(Hello3);
frame.setSize(400, 200);
frame2.setBounds(400, 200, 400,200);
frame3.setBounds(200, 400, 400,200);

frame.setTitle(1);
frame2.setTitle(2);
frame3.setTitle(3);

frame.setVisible(true);
frame2.setVisible(true);
frame3.setVisible(true);
}

public void paint(Graphics g) {

System.out.println(demo: paint + this);

g.drawLine(10,10,200,200);

g.setFont(new Font(Dialog, Font.PLAIN, 50));
g.setColor(Color.red);
//g.setBackground(Color.red);

g.drawString(str, 10, 100);
}
}


--
Gianluca Moro Visit  http://ilpinguino.altervista.org/
[EMAIL PROTECTED]  MyBlog http://blog.libero.it/giangiammy/



__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

___
kaffe mailing list
kaffe@kaffe.org
http://kaffe.org/cgi-bin/mailman/listinfo/kaffe