From: Yvon T. <tho...@fr...> - 2006-03-14 13:40:47
|
Hey all, i've a menu item called "menuTransformer" it's one of my ib_outels : =20 ib_outlets :mainWindow, :menuChoisir, :menuTransformer, :boutonChoisir, =20= :boutonTransformer, :messageTextField in awakeFromNib i do : def awakeFromNib setMessage("Choisissez un r=E9pertoire...") @menuTransformer.setEnabled(false) end here, no prob to set enabled false @menuYtansformer, the app launch =20 normally. however, this has no effect (the user might continue to choose this =20 menu item) second prob, when the user has effectively choosen a directory i'd =20 like to set that menu item enabled to true like here : def dirChoosen setMessage("R=E9pertoire choisi : =AB #{@dir} =BB") @transformerBouton.setEnabled(true) @transformerBouton.oc_display @menuTransformer.setEnabled(true) ############################ =20= line 47 @menuTransformer.oc_display end no prob, whith @transformerBouton (a NSButton) but the application =20 crashes over the line : @menuTransformer.setEnabled(true) with the following error message : /Users/yvon/work/RubyCocoa/AddMenu/build/Development/AddMenu.app/=20 Contents/Resources/Controller.rb:47:in `NSApplicationMain': =20 NSApplicationMain - RBException_NoMethodError - undefined method =20 `setEnabled' for nil:NilClass (OSX::OCException) from /Users/yvon/work/RubyCocoa/AddMenu/build/Development/=20 AddMenu.app/Contents/Resources/rb_main.rb:35 althought, @menuTransformer has been seen before in awakeFromNib ??? someone has an idae about that behaviour ??? best, Yvon |