• 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: How can I prevent drag-and-drop initiation in an NSTextField
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How can I prevent drag-and-drop initiation in an NSTextField


  • Subject: Re: How can I prevent drag-and-drop initiation in an NSTextField
  • From: Michael Crawford <email@hidden>
  • Date: Tue, 16 Aug 2011 14:26:26 -0400

Thanks for responding, Kyle.

I assume you meant NSTextField not NSTextView? I'm working on touch based museum exhibits, which run on Mac mini's.  Suffice it to say I don't want to allow the movement of text.

In the time since I asked the question, I've done some more reading on NSTextField and d&d.  I'm prototyping a subclass of NSTextField and I'm about attempt to disable the drag source and context menu.  Wish me luck.  Of course, if you have some wisdom to share on how better to accomplish this, I'm all ears (umm . . . eyes).

- (NSDragOperation)draggingSourceOperationMaskForLocal:(BOOL)isLocal
{
    return NSDragOperationNone;
}

- (NSMenu*)menuForEvent:(NSEvent*)event
{
    return nil;
}

-Michael

On Aug 16, 2011, at 2:02 PM, Kyle Sluder wrote:

> On Tue, Aug 16, 2011 at 10:15 AM, Michael Crawford
> <email@hidden> wrote:
>> I have a window that contains an NSTextField instance.  When the textfield contains text, I can select it with a single click.  I want to preserve that behavior.  When I click (mouseDown) and hold, the cursor changes to an arrow and drag-and-drop (d&d) is initiated.  I want to disable this behavior.
>
> I guess the question is why? That's a system-supported way of moving
> text around in an NSTextView.
>
> --Kyle Sluder

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: How can I prevent drag-and-drop initiation in an NSTextField
      • From: Conrad Shultz <email@hidden>
    • Re: How can I prevent drag-and-drop initiation in an NSTextField
      • From: Quincey Morris <email@hidden>
    • Re: How can I prevent drag-and-drop initiation in an NSTextField
      • From: Kyle Sluder <email@hidden>
References: 
 >How can I prevent drag-and-drop initiation in an NSTextField (From: Michael Crawford <email@hidden>)
 >Re: How can I prevent drag-and-drop initiation in an NSTextField (From: Kyle Sluder <email@hidden>)

  • Prev by Date: Core Data to many relationship deletion causing exception
  • Next by Date: Re: How can I prevent drag-and-drop initiation in an NSTextField
  • Previous by thread: Re: How can I prevent drag-and-drop initiation in an NSTextField
  • Next by thread: Re: How can I prevent drag-and-drop initiation in an NSTextField
  • Index(es):
    • Date
    • Thread