|
From: Yvon T. <tho...@fr...> - 2006-02-22 12:20:16
|
Le 22 f=E9vr. 06 =E0 12:17, Jonathan Paisley a =E9crit :
> I think the problem is that the visible 'disabled' state only =20
> updates when the event loop runs again. During your long-running =20
> method, the Cocoa event loop never gets a chance to run. Therefore, =20=
> any clicks are queued and get processed later -- by which point the =20=
> buttons have been enabled again.
>
ok, i understand.
> You could try disabling the buttons, explicitly redrawing them by =20
> calling 'display'. You could clear any button clicks from the event =20=
> queue with 'discardEventsMatchingMask:beforeEvent:'.
>
display (eventually after a "setNeedsDisplay true" ) doesn't change =20
anything :
def disableAllButtons
@buttons.each { |b|
b.setEnabled(false)
#b.setNeedsDisplay true
b.display
}
sleep 1
end
sleep 1 doesn't help too
with #display i get only that in the XCode's Run log :
[Session started at 2006-02-22 13:13:49 +0100.]
<NSButton: 0x69d0f0><NSButton: 0x4b3210><NSButton: =20
0x4bba30><NSButton: 0x6dfc70><NSButton: 0x689400><NSButton: =20
0x4b47a0><NSButton: 0x6899e0><NSButton: 0x6e5080>
BookmarksMerge has exited with status 0.
may be one drastic solution coud be using #setHidden true gaves no =20
change too...
then i went to "discardEventsMatchingMask:beforeEvent:" and applied =20
to a NSWindow as a receiver :
@mainWindow.discardEventsMatchingMask_beforeEvent=20
(OSX::NSAnyEventMask, OSX::NSKeyUpMask)
here i got this error in the XCode's Run log :
[Session started at 2006-02-22 13:13:18 +0100.]
2006-02-22 13:13:24.417 BookmarksMerge[22686] *** -[NSDecimalNumber =20
_cgsEventTime]: selector not recognized [self =3D 0x4bb0af0]
/Library/Frameworks/RubyCocoa.framework/Versions/A/Resources/ruby/osx/=20=
objc/oc_wrapper.rb:17:in `NSApplicationMain': NSApplicationMain - =20
NSInvalidArgumentException - *** -[NSDecimalNumber _cgsEventTime]: =20
selector not recognized [self =3D 0x4bb0af0] (OSX::OCException)
from =
/Users/yvon/work/RubyCocoa/BookmarksMerge/build/Development/=20
BookmarksMerge.app/Contents/Resources/rb_main.rb:46
BookmarksMerge has exited with status 1.
i've followed what's written in the Cocoa browser...
?
Yvon
|