Skip to content

Instantly share code, notes, and snippets.

@chamons
Created December 12, 2016 16:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chamons/a21ae35b13b9d5e0c4787571f8478cf4 to your computer and use it in GitHub Desktop.
Save chamons/a21ae35b13b9d5e0c4787571f8478cf4 to your computer and use it in GitHub Desktop.
using System;
using AppKit;
using Foundation;
namespace Cursor_test
{
[Register ("MyBox")]
public class MyBox : NSBox
{
public MyBox (IntPtr handle) : base(handle)
{
}
public override void ViewDidMoveToWindow ()
{
base.ViewDidMoveToWindow ();
AddTrackingRect (VisibleRect(), this, IntPtr.Zero, false);
}
public override void MouseMoved (NSEvent theEvent)
{
base.MouseMoved (theEvent);
}
public override void ResetCursorRects()
{
AddCursorRect(VisibleRect(), NSCursor.CrosshairCursor);
//base.ResetCursorRects();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment