• 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
Re: NSImageView and mouse events
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSImageView and mouse events


  • Subject: Re: NSImageView and mouse events
  • From: Jeremy Dronfield <email@hidden>
  • Date: Tue, 25 Jan 2005 10:19:17 +0000


On 25 Jan 2005, at 4:00 am, Duncan Campbell wrote:

When I replace the NSImageView with an NSButton, I can no longer do the [self addSubview:] piece

Of course you can. NSButton inherits from NSView and instances of it can be passed to -addSubview:



- (void)closeIconAction:(NSEvent *)theEvent

The method signature here should be

- (void)closeIconAction:(id)sender

Action methods take sender (i.e. the sender of the action) as their one and only argument.

In case you are wondering why the NSRect - it's 'cause i am going to want to add a tracking rect to make close graphic change on mouse-over.

In that case you will want to use a subclass. That's pretty advanced for someone only three days into Cocoa...


Regards,

-Jeremy

===================================
SkoobySoft, home of viJournal and Skooby Renamer
email: email@hidden or visit:
http://freespace.virgin.net/jeremy.dronfield/skoobysoft.html
===================================

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >NSImageView and mouse events (From: Duncan Campbell <email@hidden>)
 >Re: NSImageView and mouse events (From: daniel <email@hidden>)
 >Re: NSImageView and mouse events (From: Duncan Campbell <email@hidden>)

  • Prev by Date: OT - UK Job Vacancy
  • Next by Date: NSMenuItem +separatorItem. Separator showing a line programatically.
  • Previous by thread: Re: NSImageView and mouse events
  • Next by thread: converting c to compatable structure
  • Index(es):
    • Date
    • Thread