[MacRuby-devel] Focus window from second XIB

Sven Schwyn svoop at delirium.ch
Tue Mar 1 11:11:06 PST 2011


Hi

For the preferences, I've created a second XIB. However, when the corresponding controller is instantiated, the window does appear but does not gain focus. Any idea what I'm doing wrong here?

preferences_controller.rb:
  class PreferencesController < NSWindowController  
    def windowNibName()
      return "Preferences"
    end
  end

application_controller.rb:
  def menu_preferences(sender)
    preferences = PreferencesController.new
  end

The Preferences.xib has a delegate which points to PreferencesController which has it's window outlet point to the window. The File's Owner is also set to the PreferencesController.

Thanks for your help!   -sven



More information about the MacRuby-devel mailing list