I need suggestions on a strategy to handle this.
I want to provide a command to "Close All" open windows, by either a menu
command or option clicking on a window's close box.
However, it seems not as simple as it sounds.
I have an PowerPlant app that was ported from Classic. It has a number of
"document" windows that may be open, let's say anywhere from 1 to 20, but
out of these windows, there are one or two "special" windows (but not
floaters, or a different class, or anything else to distinguish them) that
are not to be closed by this command. They are a special type of data window
that I do not want to be affected by this command, but for all purposes at
the moment, procedurally they look the same as the other windows.
It's true I can tag them with some data (RefCon) or something to identify
those windows that are not to be closed, but I don't see at the moment the
strategy for closing the rest.
If I didn't have these special windows, I would just loop in a while loop
until all visible windows were closed, and PP's UDesktop::FetchTopRegular()
command (which calls GetFronWindowOfClass()) returned NULL. However, this
will loop forever if I just skip closing the "special ones", and send them
to the end of the list, or something like that.
I could do something hacky like determining if I'm looping back and forth
over the same set of remaining windows and all of them are not to be closed,
and then aborting the loop, but I had hoped for something more elegant.
Do I need to be putting all of these non-special windows into a Window Group
without any specific attributes (is that possible?), so that I can use
CountWindowGroupContents() on them, and then use GetIndexedWindow() to run a
for loop on closing them (by index), and ignore the one or two "special
ones"? Or what other strategy might you suggest?
Thanks,
- Stephen
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Stephen Kay
Karma Lab - developers of KARMA
http://www.karma-lab.com
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden