|
From: Yvon T. <tho...@fr...> - 2006-02-22 10:59:51
|
Le 22 f=E9vr. 06 =E0 11:37, Jonathan Paisley a =E9crit :
>
> I'm afraid I'm not sure what's going on here. More complete code =20
> would be helpful to understand how things are put together.
>
ok, in Interface Builder all the NSButtons enabled ckeckboxes are set =20=
to false.
then in Controller.rb i do :
def awakeFromNib
loadXmlGauche("safari.xml", "BookmarksBar")
loadXmlDroite("firefox.xml", "Barre personnelle")
@xmlGauche=3D"safari.xml"
@xmlDroite=3D"firefox.xml"
@labelGauche.setStringValue "Safari"
@labelDroite.setStringValue "Firefox"
@buttons =3D [@nonVideButtonGauche, @uniqueButtonGauche, =20
@fusionButtonGauche, @loadButtonGauche, @nonVideButtonDroite, =20
@uniqueButtonDroite, @fusionButtonDroite, @loadButtonDroite]
enableAllButtons ####### here i enable all =20
buttons
end
=09
def windowDidBecomeMain(sender)
p "windowDidBecomeMain(sender)"
end
def enableAllButtons
#@nonVideButtonGauche.setHidden true
#@nonVideButtonGauche.setNeedsDisplay true
@buttons.each { |b| b.setEnabled(true)}
end
def disableAllButtons
#@nonVideButtonGauche.setNeedsDisplay true
@buttons.each { |b| b.setEnabled(false)}
end
after awakeFromNib all the NSButtons are enabled, that' right.
when someone press one of the buttons, saying =20
"Load" (@loadButtonDroite) i do :
def loadDroite(sender)
disableAllButtons ####### here i disable all =20=
buttons
loadXmlDroite("firefox.xml", "Barre personnelle")
@xmlDroite=3D"firefox.xml"
@labelDroite.setStringValue "Firefox"
enableAllButtons ####### here i re-enable =20
all buttons
end
i do the "same" (isableAllButtons [...] enableAllButtons) for all the =20=
actions corresponding to all the buttons.
the appearance of the buttons doesn't change and also if, when an =20
action isn't terminated (that's to say between disableAllButtons and =20
enableAllButtons) the click is memorized and, when the action is =20
finished the process enters a new action corresponding to the new =20
button pressed.
if, in between disableAllButtons and enableAllButtons, i press two =20
times a button and another one afterwards, all the click on all the =20
different buttons and the corresponding actions are undertaken each =20
after each...
i'd like to avoid that : no memorization when an action is undertaken.
best,
Yvon=
|