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++ MT-multithreading and servers » Code before Thread.Run() nor executed
Re: Code before Thread.Run() nor executed [message #48716 is a reply to message #48715] Mon, 28 August 2017 09:27 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
There is only a small typo: You have assigned StartProgress to TestLayout instead of button1:

TestWindow::TestWindow()
{
	SetRect(0, 0, Zx(400), Zy(200));
	Add(testLayout);
	Add(testLayout2);
	testLayout.Show(true);
	testLayout2.Show(false);
	testLayout.button1.WhenAction = THISBACK(StartProgress);
}


Here are some further hints:

TestWindow::TestWindow()
{
	SetRect(0, 0, Zx(400), Zy(200));
	Add(testLayout);
	Add(testLayout2);
	testLayout.Show(true);
	testLayout2.Show(false);
	testLayout.button1 << [=] {
		testLayout.Show(false);
		testLayout2.Show(true);
		testLayout2.progress.Set(0, 100);
		Thread::Start([=] {
			for(int i = 0; i < 100; i++) {
				if(Thread::IsShutdownThreads())
					break;
				Sleep(100);
				GuiLock __;
				testLayout2.progress++;
			}
			GuiLock __;
			testLayout.Show(true);
			testLayout2.Show(false);
		});
	};
}
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to use TLS over SMTP
Next Topic: HttpRequest ignores server errors
Goto Forum:
  


Current Time: Sat Apr 20 05:38:42 CEST 2024

Total time taken to generate the page: 0.02089 seconds