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 » [Linux] Upp application can block all mouse events
Re: [Linux] Upp application can block all mouse events [message #46739 is a reply to message #43161] Thu, 21 July 2016 19:31 Go to previous messageGo to previous message
slashupp is currently offline  slashupp
Messages: 231
Registered: July 2009
Experienced Member
Confirms that gui "hangs" for sleep period.
You are using WhenAction for Callback on the button
Everything works fine if you use WhenPush

Example:
#include <CtrlLib/CtrlLib.h>
using namespace Upp;

struct SleepTest : public TopWindow
{
	typedef SleepTest CLASSNAME;
	
	Button button;

	void Test()
	{
	Sleep(10000); //calls Util.cpp - Sleep()
	}

	SleepTest()
	{
		Title("Sleep Test").CenterScreen().Sizeable();
		SetRect(0,0,200,200);
		
		Add(button.SetLabel(t_("Test")).HCenterPosZ(84, 2).VCenterPosZ(32, -2));
		//button.WhenAction = THISBACK(Test); --- hogs the gui for sleep-time - Alt-D in debug still works
		button.WhenPush = THISBACK(Test); //this is fine
	};
	
	virtual ~SleepTest(){}
};

GUI_APP_MAIN
{
	SleepTest().Run();
}


I don't know what WhenAction does internally to hog the gui so - mirek?
I guess some kind of thread-lockup with X that leave X waiting?
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: ColumnList clipping problem
Next Topic: Question about Drag and Drop
Goto Forum:
  


Current Time: Sun May 12 15:02:08 CEST 2024

Total time taken to generate the page: 0.01971 seconds