Custom view in NSToolbarItem - validate: method
Custom view in NSToolbarItem - validate: method
- Subject: Custom view in NSToolbarItem - validate: method
- From: Thierry Santacana <email@hidden>
- Date: Fri, 25 Jun 2004 17:32:47 +0200
Hi all,
I'm new to Cocoa programming and want to develop an application with a
Finder-like toolbar (specially, grouped buttons "backward"/"forward" in
a NSSegmentedControl).
I know (read in Apple Dev Doc and in mailing-lists) that :
- I have to subclass NSView (this is already done and my custom
view--NSSegmentedControl, is displayed in the toolbar),
- I have to implement theses methods in my subclass :
- (id)initWithFrame:(NSRect)frame;
- (void)drawRect:(NSRect)rect;
and an action method that will handle what segment has been clicked :
- (IBAction)segControlClicked:(id)sender;
But I have read too that :
- many calls to the toolbarItem are forwarded to the custom view (does
it mean that I should set the toolbarItem's target to the instance of
my custom view and set the action to a method--segControlClicked, of
the same instance?),
- I should subclass NSToolbarItem to override validate: method because
this method doesn't sent the message validateToolbarItem:(NSToolbarItem
*)theItem to custom toolbarItem's views,
- I should also implement every "forwards to -view if it responds"
methods too (ie : setTarget:, target, setAction:, action, ...)?
Finally, that get me bored and I feel like in front of a mountain of
code to write for a simple grouped pair of buttons :-(
Does anybody has an experience with this?
Thanks you all (forgive my english)
Cordialement.
--
Thierry Santacana - mailto:email@hidden
Girant - Responsable Diveloppements Web et Communication
Project:Omega SARL - www.projectOmega.com - "Divelopper l'alternative"
Til/Fax : 01 60 02 76 34 - GSM : 06 63 11 67 41
_______________________________________________
xcode-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/xcode-users
Do not post admin requests to the list. They will be ignored.