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   |
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
|
|
|
Goto Forum:
Current Time: Sun Apr 27 19:44:19 CEST 2025
Total time taken to generate the page: 0.03439 seconds
|