Re: Custom View in Toolbar
Re: Custom View in Toolbar
- Subject: Re: Custom View in Toolbar
- From: David Blanton <email@hidden>
- Date: Mon, 8 Mar 2010 09:56:39 -0700
You never need to call anything to result in display.
Apparently you do as the custom view containing two buttons placed in
the tool bar is not displayed.
The docs for -validate indicate that -setEnabled should be called if
the custom view is a control and that NStoolbarItem has no idea on how
to validate a custom view containing 'complex' controls. Did that,
don't work.
So, it is not the workman it is the tool. Proven by how long it took
Apple to include toolbar support in IB and the fact that there is not
one answer or example anywhere on how to do what is supposed to be
trivial. Ergo, I stand by may statement that a trivial task in MFC is
consuming lots of time to do in Cocoa. Does that not point to either
poor tool design or poor documentation?
You can't blame the Toyota drivers for sudden acceleration when Toyota
recalled 'the tool' to fix the problem. Analogous situation here.
So I ask again, how does one display a custom view containing controls
in a toolbar?
-db
On Mar 5, 2010, at 2:53 PM, Kyle Sluder wrote:
On Fri, Mar 5, 2010 at 10:45 AM, David Blanton
<email@hidden> wrote:
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.
You never need to call anything to result in display. Your involvement
with drawing extends merely to marking a dirty region; AppKit takes
care of calling all of your drawing methods. If you are trying to
force drawing, you are doing something very, very wrong.
You have a memory management bug somewhere, most likely in your
validation method. Turn on zombies, run in Instruments, and find out
where.
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.
A poor workman blames his tools.
--Kyle Sluder
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden