discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTabView bug/incompatibility


From: Andreas Höschler
Subject: Re: NSTabView bug/incompatibility
Date: Sat, 20 May 2006 12:08:13 +0200

Hello all,

this is a followup to my own post. The complete set of NSTabView modifications to make GNUstep compatible with Cocoa follows:

- (NSTabViewItem*) tabViewItemAtPoint: (NSPoint)point
{
  int           howMany = [_items count];
  int           i;

// point = [self convertPoint: point fromView: nil]; // <-- remove this line to gain compatibility with Cocoa

  for (i = 0; i < howMany; i++)
    {
      NSTabViewItem *anItem = [_items objectAtIndex: i];

      if (NSPointInRect(point,[anItem _tabRect]))
        return anItem;
    }

  return nil;
}

- (void) mouseDown: (NSEvent *)theEvent
{
   NSPoint location = [theEvent locationInWindow];

location = [self convertPoint: location fromView: nil]; // <-- add this line to gain compatibility with Cocoa

   NSTabViewItem *anItem = [self tabViewItemAtPoint: location];

   if (anItem != nil  &&  ![anItem isEqual: _selected])
     {
      [self selectTabViewItem: anItem];
     }
}

Regards,

  Andreas






reply via email to

[Prev in Thread] Current Thread [Next in Thread]