Re: setHidden: on MacOS 10.2
Re: setHidden: on MacOS 10.2
- Subject: Re: setHidden: on MacOS 10.2
- From: Glenn Andreas <email@hidden>
- Date: Fri, 30 Apr 2004 14:13:28 -0500
At 11:44 AM -0700 4/30/04, cricket wrote:
On Apr 29, 2004, at 2:08 PM, M. Uli Kusterer wrote:
Okay, I'll bite: *why* are the other options presented so far so
bad? I see perfectly valid reasons for using most of them in
certain circumstances, and I'd be interesting in finding out
whether I may have missed something.
IMHO:
- Moving the widget in question to (-100, -100) is a common tactic
that I've seen used in many other circumstances (although never in
Cocoa to hide a widget), and I've seen it bite people later on, when
the assumption of -100, -100 being a good place to park things
suddenly is no longer the case.
The Dialog manager has always used this trick (for decades now) -
HideDialogItem adds 0x4000 to the horizontal coordinate (and
ShowDialogItem subtracts 0x4000) and works well.
OTOH, there were apps that use to hide windows by moving them to some
negative coordinate - until people with multiple monitors whose
second monitor was to the left of the main monitor suddenly saw their
supposedly hidden windows show up there (I seem to remember this was
for windows that were suppose to hide on deactivate, rather than keep
a separate flag and use Show/HideWindow, they'd be moved regardless).
- Using a tabview (and hiding the tabs) can be a good idea in many
cases. However, consider the case where you have a view with 100
widgets in it and you want to hide one. Duplicating 99 of them in a
second view uses up extra disk space, could affect nib loading
times, and is just inviting potential problems (i.e. did I hook up
all 99 widgets the same way in both views?)
You'd only embed the one widget in a tabview, not all of them.
Using dynamically loaded bundles that would add -setHidden: via a
category, you could probably come up with a transparent way to do
this for 10.2 (i.e., write a "-setHidden:" that embeds the view
inside a tabview if it isn't already, and then hide/show accordingly,
and load that as needed based on Cocoa version).
--
Glenn Andreas email@hidden
mondo blobbo, Cythera, Theldrow, oh my!
Mad, Bad, and Dangerous to Know
_______________________________________________
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.