Re: Vanishing Toolbar, Part III
Re: Vanishing Toolbar, Part III
- Subject: Re: Vanishing Toolbar, Part III
- From: Frank Midgley <email@hidden>
- Date: Tue, 25 Jun 2002 10:25:53 -0500
On Friday, June 21, 2002, at 04:12 PM, Carl Jochen Norum wrote:
I have an NSPopUpButton in my toolbar. When the pop up button is used,
all
of the other items in the toolbar (all standard image toolbar items)
vanish.
They're still there, and can be clicked on, and perform the appropriate
function.
However, they are invisible. Labels too.
I have a similar problem in my app. I am attempting to simulate the
tri-button from the Finder that lets you choose between three different
view modes (icon, list and column in the Finder's case.) I set up a
custom view in IB with three image buttons on it. These buttons message
my controller, the same messages are sent by three menu choices that
correspond to the buttons. When the view is changed the window
containing the toolbar is resized with animation.
The menus work fine, but strangely the buttons don't. After clicking a
button and having the window resize, everything but the clicked button
disappears. Manually resizing or switching views via menus/keyboard
shortcuts causes the toolbar to redraw. If animation is not used for
the window resize everything works fine.
My solution for now is to resize the window in two stages. First,
animate the resize to within four pixels of the target size and then do
a final resize without animation. There is a noticeable 'hop' at the
end of the resize if you know what to look for, but otherwise it's fine.
Along the way I have tried:
- Removing all other toolbar buttons
- Removing the code that switches between the buttons' highlighted and
non-highlighted images
- Having the custom toolbar view originate from a stand-alone view in
the nib and from a view embedded in the toolbar's window (and
subsequently removed)
All to no avail. The code that sets up the toolbar item follows:
toolbarItem = [[[NSToolbarItem alloc]
initWithItemIdentifier:itemIdentifier] autorelease];
if ([itemIdentifier isEqualToString:@"View"])
{
[toolbarItem setMinSize:NSMakeSize(95, 32)];
[toolbarItem setMaxSize:NSMakeSize(95, 32)];
[toolbarItem setLabel:@"View"];
[toolbarItem setPaletteLabel:@"View"];
[toolbarItem setView:viewToolbarView];
[toolbarItem setMenuFormRepresentation:_viewToolbarMenuItem];
_viewToolbarItem = toolbarItem;
}
viewToolbarView is connected to my custom view in IB.
Unfortunately I don't think that this gives a solution to the problem
Carl is seeing, but maybe the larger sample set will help find a real
solution.
-Frank
_______________________________________________
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.