• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Custom view (NSSegmentedControl/NSButton) in NSToolbarItem - validate: method
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Custom view (NSSegmentedControl/NSButton) in NSToolbarItem - validate: method


  • Subject: Custom view (NSSegmentedControl/NSButton) in NSToolbarItem - validate: method
  • From: Thierry Santacana <email@hidden>
  • Date: Tue, 29 Jun 2004 10:38:54 +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?

I've started doing lot of these stuffs but I get a problem dialing with
the segment of the NSSegmentedControl (no highlight blue color of the
selected segment, always the same selected segment sent whatever
segment is clicked; ...).

I am going to rest for while :-)

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
_______________________________________________
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.


  • Prev by Date: Re: Tab View Delegate
  • Next by Date: how decode xml utf-8 string into nsstring??
  • Previous by thread: [ANN] AutoGraf 1.0.2b (4E27) - Visual class browser
  • Next by thread: how decode xml utf-8 string into nsstring??
  • Index(es):
    • Date
    • Thread