On Mar 5, 2010, at 10:45, David Blanton wrote:

> Well, I have read and re-read the docs on custom views in a toolbar.  In 
> particular the section "View item validation".
> 
> I sub-classed NSToolbarItem and set the custom view toolbar item to this 
> class.
> 
> In this subclass I have outlets for all the controls in the view.
> 
> I overrode -validate.
> 
> I have called every possible method on the view and the controls for them to 
> display.  Never see anything and in fact the second time through -validate 
> EXC_BAD_ACCESS is thrown.

If validate is crashing, there's a bug you need to fix. It might be, you know, 
related to the problem you ran into. Have you looked for a memory management 
problem relating to the custom view? Did you check the run log for error 
messages?

> So two hours later I still cannot display a custom view containing buttons in 
> an NSToolbar. Something that in MFC is trivial is near impossible with Cocoa. 
> The Windows guys here are laughing their ... off at my inability to 
> accomplish a trivial MFC task in a Cocoa equivalent.

Let them have their innocent fun. The last time any of them had a good reason 
to laugh was somewhere around 1979.

> Frustrated.
> 
> -db
> 
> 
> 
> 
> On Mar 5, 2010, at 10:23 AM, David Blanton wrote:
> 
>> Using IB I have placed a custom view in a window toolbar.  The custom view 
>> contains buttons.  The buttons are connected to actions.  The custom view as 
>> a tool bar item auto validates. In IB the custom view and its contained 
>> buttons appears in the tool bar and customization palette.
>> 
>> The problem.
>> 
>> When I build an run the program the custom view does not appear in the tool 
>> bar or the customization palette. Its label does appear in both the tool bar 
>> and the customization palette.
>> 
>> What am I not enabling to keep this from being visible?

You haven't established that the custom view isn't visible, just that its 
contents aren't visible. Sometimes odd things happen when an unflipped view is 
inserted in a flipped superview. Maybe the subview frames or bounds aren't 
where you think they are. Maybe the subviews have been clipped away.


_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to