• 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
[Solution?] Re: bad mouse with NSComboBox on sheet
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Solution?] Re: bad mouse with NSComboBox on sheet


  • Subject: [Solution?] Re: bad mouse with NSComboBox on sheet
  • From: Ken Victor <email@hidden>
  • Date: Wed, 26 Apr 2006 10:31:45 -0700

i've solved this problem as follows: in my method that receives the NSComboBoxWillDismissNotification notification:

- (void) comboBoxDidDismiss: (NSNotification*) aNotification {

NSEvent* curEvent = [NSApp currentEvent];
if ([curEvent type] == NSLeftMouseDown) {
do {
curEvent = [NSApp nextEventMatchingMask: (NSLeftMouseDraggedMask | NSLeftMouseUpMask) untilDate: [NSDate distantFuture] inMode: NSEventTrackingRunLoopMode dequeue: YES];
} while ([curEvent type] != NSLeftMouseUp);
}
}


personally, i consider it a bug that NSComboBox doesn't eat mouse moved/up events generated after the dismissing mouse down. (i would log a bug against this, but radar still isn't letting me in.)

however, my solution may be a bug waiting to happen. if apple in the future should decide to eat mouse moved/up events, i hope that they don't post the NSComboBoxWillDismissNotification on the mouse down, otherwise my code would hang/loop until the next time the users pops up the combo box again! can anyone suggest a way for my code to prevent/anticipate this potential problem?

thanx,
ken


At 2:33 PM -0700 4/25/06, Ken Victor wrote:
with some further checking, it turns out i do get the dismiss notification when the combo box's popup dismisses via dragging the window. but mouse click's are still dispatching to the wrong target.
ken



At 1:56 PM -0700 4/25/06, Ken Victor wrote:
i've got a sheet on a window with an NSComboBox in the sheet. if i drag the window, the combo box popup dismisses, but i don't get any notification of this. plus, from then on, mouse clicks are sent to the wrong target! the only way i've been able to get mouse clicks working properly again is to drag the window again!

has anyone seen similar (weird/absurd/errant) behavior? (i'd log a bug except radar isn't giving me access today!)

also, if anyone has seen this before, can you suggest any work around? since mouse clicks are being "dispatched" wrongly, i can't think of anything offhand.

thanx for any sympathy, suggestions, etc.
ken
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >bad mouse with NSComboBox on sheet (From: Ken Victor <email@hidden>)
 >Re: bad mouse with NSComboBox on sheet (From: Ken Victor <email@hidden>)

  • Prev by Date: Re: FYI: Cocoa's framework scaling works great!
  • Next by Date: Re: NSError: why returned directly?
  • Previous by thread: Re: bad mouse with NSComboBox on sheet
  • Next by thread: Re: isMovableByWindowBackground is not always movable (was:How do I implement a splash screen) [SOLVED]
  • Index(es):
    • Date
    • Thread