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 » Multiple windows and focus
Re: Multiple windows and focus [message #10369 is a reply to message #10368] Wed, 04 July 2007 14:07 Go to previous messageGo to previous message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
		win->SetForeground();
		win->SetFocus();

Works fine for me. Also you don't need to call LostFocus, this will be done for you.

Now, some other suggestions:
'delete this' should never be used as it relies on the object being created by 'new'. Have the owner set the TopWindow::WhenClose callback to a function that deletes it instead.

You might want to use the Upp class Ptr<TopWindow> instead of the pointers. Then you don't need to worry about setting them back to NULL. Personally I'd keep them in an array of Ptrs.

Do you really need to create/delete the windows when they are opened/closed? Unless you will have many of them you could just have them as members and not have to worry about it.

Or you could google for 'Singleton class C++', which might do what you're looking for.

James

[Updated on: Wed, 04 July 2007 14:10]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Can't get rid of minimize button on Linux, okay on Win32
Next Topic: System tray on windows
Goto Forum:
  


Current Time: Sun Apr 28 14:44:07 CEST 2024

Total time taken to generate the page: 0.02645 seconds