[Mono-dev] mono X11 rendering

Harry harry_tanama at yahoo.com
Fri Oct 14 03:55:03 EDT 2005


Hi guys, 

I am not sure where to post this questions. Hopefuly
you guys are able to answer my questions:

I am developing a simple applications using Thread
class to change the color of the square (Lab
assignment)

everything working correctly, accept I have to drag
the windows in linux to let the Thread working to
change the color of a square. 

I think it has something todo with the X11 rendering
in Linux. Are there any solutions to this problems? 

here is my code: 
using System;
using System.Windows.Forms;
using System.Threading;
using System.Drawing;

public class ColoredBoxes : Form
{
	private Color c;
	public ColoredBoxes()
	{
		Thread t = new Thread(new ThreadStart(Run));
		t.Start();
	}
	
	protected override void OnPaint(PaintEventArgs e)
	{
		Graphics g = e.Graphics;
		Pen blue = new Pen(c, 3);				
		g.DrawRectangle(blue, 100,100,30,30);
		base.OnPaint(e);
	}

	public void Run()
	{
		Random r = new Random();
		while(true)
		{
			c = Color.FromArgb(r.Next(256), r.Next(256),
r.Next(256));
			Thread.Sleep(200);
		}
	}

}

public class Test{
	public static void Main()
	{
		Application.Run(new ColoredBoxes());
	}
}

Thank you for all your help guys



--

Harry Tanama
Programmer/Developer
.NET / JAVA
Powerd by GNU/LiNUX  


"Let Christ be glorify in our words and actions."

"Jesus Christ save the entire human race from sins & GNU/Linux save human from high cost software applications."


		
__________________________________ 
Yahoo! Music Unlimited 
Access over 1 million songs. Try it free.
http://music.yahoo.com/unlimited/



More information about the Mono-devel-list mailing list