Exemplo n.º 1
0
        public static NSTrackingArea Create(NSView aView, NSRect aTrackRect, bool aTrackMove)
        {
            NSTrackingArea trackingArea;

            if (aTrackMove)
            {
                trackingArea = new NSTrackingArea(aTrackRect,
                                                  NSTrackingAreaOptions.NSTrackingActiveInActiveApp |
                                                  NSTrackingAreaOptions.NSTrackingMouseEnteredAndExited |
                                                  NSTrackingAreaOptions.NSTrackingMouseMoved,
                                                  aView,
                                                  null);
            }
            else
            {
                trackingArea = new NSTrackingArea(aTrackRect,
                                                  NSTrackingAreaOptions.NSTrackingActiveInActiveApp |
                                                  NSTrackingAreaOptions.NSTrackingMouseEnteredAndExited,
                                                  aView,
                                                  null);
            }

            aView.AddTrackingArea(trackingArea);
            return(trackingArea);
        }