Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Widgets - General questions or Mixed problems » Refresh(), Paint(Draw& w), or something else nearby?
Re: Refresh(), Paint(Draw& w), or something else nearby? [message #10401 is a reply to message #10396] Fri, 06 July 2007 12:02 Go to previous messageGo to previous message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
The problem is that you are running the loop from the window's contructor, but at that point the window hasn't been shown yet so Paint will not be called.

If you add the code:
	virtual bool Key(dword key, int count) {
		if (key == K_SPACE) {
			for(int i=0;i<1000;i++)
			{
		    	step();	
			}	
			return true;	
		}
		return false;
	}

Then pressing the space bar runs the loop correctly, repainting after every calculate(). Also you could speed up your Paint routine using an ImageBuffer (In calculate put the pixels straight into an ImageBuffer, then create an Image and paint that instead).

Nice program though, it makes pretty pictures Razz

James
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Using InstallKeyHook
Next Topic: Missing Functions for Layouter
Goto Forum:
  


Current Time: Sun Jun 09 07:04:21 CEST 2024

Total time taken to generate the page: 0.01276 seconds