[Mono-dev] mono X11 rendering

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


Hi guys,
(sorry for the typo in the previous email)

I am developing a simple applications using Thread
class to change the color of the square (Lab
assignment). Everything is working properly, except I
have to drag or cls /opn the windows in linux to fix
theThread and the only solutions to produce the color
change.  

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

here is my code: (This code should be working in MS
Windows) 

[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());
	}
}
[/code]


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