Re: Closing windows bearing sheets
Re: Closing windows bearing sheets
- Subject: Re: Closing windows bearing sheets
- From: Kurt Revis <email@hidden>
- Date: Mon, 4 Mar 2002 16:00:38 -0800
Every developer trying to work around the bug (each in a different way,
probably) will just waste a lot of everybody's time, and quite possibly
lead to a bunch of broken apps when Apple fixes the bug in a way that
turns out to be incompatible with people's hack workarounds.
Hey, I resemble that remark! :)
I'd say that, as workarounds go, the one I just posted is pretty
obvious, painless, and unlikely to break in the future. The correct way
for Apple to fix it is to not try to close windows which have attached
sheets--and in that case, the workaround code will not cause any harm.
(Of course, it could be argued that I am wrong about that. If you think
so, feel free to try to change my mind!)
Personally, I would prefer that people share the bugs they find and the
workarounds they invent, so at least we can discuss the pros and cons of
these things openly, instead of pushing it all into the closet. Forcing
everyone to reinvent workarounds is only going to lead to *more* badly
done hacks, IMHO. And often enough people think they need workarounds
to bugs which don't turn out to be bugs after all.
Also, I've never seen a workaround that didn't teach me more about how
the system actually works, or bring up details I wouldn't have thought
of. The original reason I have this code in my window controllers is
not because of the option-close thing--in fact, I hadn't noticed that
problem.
(What I was doing originally was making -windowShouldClose: end editing
in the window, so that I could get the values of any text fields that
were currently being edited. But there was some validation of input
involved, which could open a sheet on the window if the input was
invalid. So after ending editing, -windowShouldClose: needed to check if
the window had a sheet attached--which might not have been the case when
it was first called--and return NO if there was a sheet. All of this is
stuff which a well-behaved app should do, but the AppKit doesn't
automatically provide, and I think people should be aware of that.)
I do agree that some bugs are not worth the trouble to work around (for
instance, the one recently posted to MacOSX-dev about the popup menu in
the title bar moving the window instead of the menu...), but I'd leave
it to each developer to make an informed choice about each individual
bug in the context of their own app.
--
Kurt Revis
email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.