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 » TopWindow&PopUp, TrayIcon » Function holding a static TopWindow. Is it safe?
Function holding a static TopWindow. Is it safe? [message #45863] Fri, 15 January 2016 14:00 Go to previous message
koldo is currently offline  koldo
Messages: 3357
Registered: August 2008
Senior Veteran
SetMessage() is a function that opens a TopWindow showing a message in a list.

Is it safe to have a static TopWindow inside a function?

Could it be that when the program ends, CtrlCore could not close it?

What would be a safer/better way to do it?

class MessageWindow : public TopWindow {
	void SetMessage(const String message);
	~MessageWindow() 		{TopWindow::Close();}
	...
};

void SetMessage(const String message) {
	static MessageWindow window;
	
	window.SetMessage(message);	
}


Best regards
IƱaki
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Crashing when using MenuBar's
Next Topic: TrayIcon in Ubuntu 11.04 not shown.
Goto Forum:
  


Current Time: Sun Apr 28 09:45:25 CEST 2024

Total time taken to generate the page: 0.06254 seconds