NSTabItems dynamically loaded?? and other IB weaknesses...
NSTabItems dynamically loaded?? and other IB weaknesses...
- Subject: NSTabItems dynamically loaded?? and other IB weaknesses...
- From: Geoff Lenglin <email@hidden>
- Date: Sun, 2 Sep 2001 18:19:24 -0400
Hi everyone,
I'm having some trouble with NSTabview and the class reference does
not mention anything helpful. So here is the problem:
I've created a nib file containing a window. The file's owner is the
WindowController subclass. This window contains a NSTabview and some
of its NSTabItems contain a NSMatrix of buttons (about 30 buttons
each).
I really need that many buttons but I figured setting
ShowsBorderOnlyWhileMouseInside: to YES would make the window less
cluttered - and it's indeed much nicer.
IB does not enable us to set this with the GUI (am I wrong?), so I
implemented it programmaticaly by overriding the windowDidLoad:
method of the window Controller.
for (i=0;i<24;i++)
{
[[buttonTabAmatrix cellWithTag:i] setShowsBorderOnlyWhileMouseInside:YES];
}
for (i=0;i<30;i++)
{
[[buttonTabBmatrix cellWithTag:i] setShowsBorderOnlyWhileMouseInside:YES];
}
At first glance, this works perfectly: the matrix of buttons of the
first visible tab called 'A' looks great.
Now when I click another tab 'B' the buttons do not have
ShowsBorderOnlyWhileMouseInside enabled ... worse the buttons are not
functioning. Furthermore, the debug console fills with dozens of
error messages:
ApplicationName [346] Error in CGSRemoveTrackingArea (1001)
as many messages as buttons actually. Click back tab 'A' and again
'B' and everything works fine again as wanted.
It looks as if the hidden tabs - when the window just finished
loading - had not been loaded yet. It's weird.
Does my code come too early in the loading process? Using
windowDidLoad: method should guarantee that the entire nib file is
loaded, right?
Am I missing something here?
Any Suggestions?
Do I need to select each NSTabItems and set things in its view one
after another ? It is going to make the window loading sluggish
though.
I also have some difficulties figuring out how to use some of IB
features. (u know lack of docs, blah blah)
say you want to display an image in a NSButtonCell using IB GUI.
Well, that looks simple: just fills in the 'Icon' textfield in
Attributes in the Info Window of IB. But WHAT do we actually write in
there? a path to the image file, I guess. But what path? relative to
the .app main Bundle? the current path of the image? And with what
format? human form or @"path" form?... I'm puzzled.
Any help would be appreciated.
Thanks in advance,
Geoff, cocoaddicted.