Can someone tell me how to hide views? That is, in IB, I create all the
elements of my interface, but some of them I want to not be displayed when
the app starts and I want to display them later. This seems like it
should be an easy problem to solve.
Maybe I'm just not finding the doc that tells me how to do it, but
searches in PB on "hide", "visibility", and "transparent" are unhelpful.
Some views have a "transparent" attribute which I can set and unset, but
some, like NSTextField, do not. So, say I have an NSTextField accessed
via outlet "TheText" which should be invisible when the app starts.
Right now, I have:
sub new {
my $proto = shift;
my $class = ref($proto) || $proto;
my $self = {};
# Outlets
$self->{'Window'} = undef;
$self->{'TheText'} = undef;
bless ($self, $class);
$self->{'NSWindowController'} =
NSWindowController->alloc->initWithWindowNibName_owner("MainWindow",
$self);
$self->{'NSWindowController'}->window;
$self->{'TheText'}->setStringValue('');
return $self;
}
To set its value to the empty string, so it at least looks invisible.
Even so, the sample value I put into IB so I'll know where the NSTextField
is appears briefly when the window displays and then vanishes. (Of
course, I could just delete the text in IB, and then I won't see it, but
this feels very kludgey to me and besides, I need to be able to see it in
IB.)
There must be some standard way to hide a view, prior to the window being
displayed. What is it? :-)
Trey
--
I'm looking for work. If you need a senior SAGE Level IV sysadmin with 10
years Perl, tool development, training, and architecture experience,
please email me at [EMAIL PROTECTED] I'm willing to relocate for the right
opportunity. Resume: http://www.ibiblio.org/harris/trey-harris-cv.html