|
From: Jonathan P. <jp...@dc...> - 2006-02-22 11:17:37
|
On 22 Feb 2006, at 10:58, Yvon Thoraval wrote: > the appearance of the buttons doesn't change and also if, when an > action isn't terminated (that's to say between disableAllButtons > and enableAllButtons) the click is memorized and, when the action > is finished the process enters a new action corresponding to the > new button pressed. > > if, in between disableAllButtons and enableAllButtons, i press two > times a button and another one afterwards, all the click on all the > different buttons and the corresponding actions are undertaken each > after each... > > i'd like to avoid that : no memorization when an action is undertaken. > I think the problem is that the visible 'disabled' state only updates when the event loop runs again. During your long-running method, the Cocoa event loop never gets a chance to run. Therefore, any clicks are queued and get processed later -- by which point the buttons have been enabled again. You could try disabling the buttons, explicitly redrawing them by calling 'display'. You could clear any button clicks from the event queue with 'discardEventsMatchingMask:beforeEvent:'. |