• 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
NSMatrix mouse puzzle
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSMatrix mouse puzzle


  • Subject: NSMatrix mouse puzzle
  • From: "D.K. Johnston" <email@hidden>
  • Date: Wed, 3 Sep 2008 21:40:40 -0700

I've got a matrix of buttons in a window that I want to disable for a short period, while data is being displayed. So I wrote something like this:

[theMatrix setEnabled:NO];

// wait 10 seconds
NSUInteger i = 0, resume = time( nil ) + 10;
while( i < resume )
index = time( nil );

[theMatrix setEnabled:YES];

But when I click the buttons during that 10-second waiting period, the clicks are sent to the matrix anyway. (I know this because a click- counter is incremented.)


Why is this happening? Is it because the matrix doesn't get the message until later in the run loop? Any ideas about how I can get the desired result?

I tried setting a "waiting" flag that's monitored by the method that processes the clicks, but that didn't work either.

dkj
_______________________________________________

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: NSMatrix mouse puzzle
      • From: Graham Cox <email@hidden>
  • Prev by Date: Re: process monitoring panic
  • Next by Date: Re: NSMatrix mouse puzzle
  • Previous by thread: Re: NSString/NSMutable String Concatenation
  • Next by thread: Re: NSMatrix mouse puzzle
  • Index(es):
    • Date
    • Thread