• 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
Toolbar and tracking rects problem
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Toolbar and tracking rects problem


  • Subject: Toolbar and tracking rects problem
  • From: Luc Vandal <email@hidden>
  • Date: Fri, 2 Sep 2005 09:08:28 -0400

Hi,

I managed to get tracking rects to work with custom toolbar items with views. I do get the mouseEntered message when the mouse cursor is over one of the item but something strange is happening. Somehow, it seems that the tracking rects are also somewhere else in the screen. If the mouse cursor is over a certain part of the screen, mouseEntered will be triggered even though it's not even over a toolbar item. What did I do wrong? Here's some code:

@implementation VRToolbarItemView
- (void)frameDidChange:(NSNotification*)notification
{
    [self addTrackingRect:[self bounds]
                                    owner:self
                             userData:nil
                     assumeInside:NO];
}

- (void)mouseEntered:(NSEvent *)event
{
    ...
}

@end

@implementation VRAppController
- (NSToolbarItem *) toolbar: (NSToolbar *)toolbar itemForItemIdentifier: (NSString *) itemIdent willBeInsertedIntoToolbar:(BOOL) willBeInserted {


NSToolbarItem *toolbarItem = [[[NSToolbarItem alloc] initWithItemIdentifier: itemIdent] autorelease];

if ([itemIdent isEqual: OpenBookItemIdentifier])
{
m_viewOpenBook = [[VRToolbarItemView alloc] initWithFrame:NSMakeRect(0,0,32,32)];
[toolbarItem setTarget:m_viewOpenBook];
[toolbarItem setView:m_viewOpenBook];
[toolbarItem setMinSize:NSMakeSize( 32, 32 )];
[toolbarItem setMaxSize:NSMakeSize( 32, 32 )];
[toolbarItem setImage:[NSImage imageNamed: @"icone1"]];
}
}


Thanks!

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


  • Follow-Ups:
    • SOLVED: Toolbar and tracking rects problem
      • From: Luc Vandal <email@hidden>
  • Prev by Date: Re: NSSocketPort ipv6 vs ipv4 nightmare
  • Next by Date: SOLVED: Toolbar and tracking rects problem
  • Previous by thread: SOLVED: dyld CoreData failure on 10.3 Systems (Gracefully failing on unsupported OS version)
  • Next by thread: SOLVED: Toolbar and tracking rects problem
  • Index(es):
    • Date
    • Thread