From: Sherm Pendley Date: 2007-05-08T21:30:04+09:00 Subject: Re: RubyCocoa Sheets - help anyone? Tim Perrett writes: >> Then select the "file's owner" and select your Ruby class in the "custom >> class" pane of the info panel. Again - this doesn't create an instance >> of >> your controller class, it just lets IB know that, when this NIB is >> loaded >> at run time, what class its owner object will be an instance of. This is >> how IB knows what outlets and actions to show in the "connections" pane >> of the Info panel. > > You make a very good point there sherm that a lot of people including > myself miss. > > I have finally got this working!!! wahooooooooooo!!!!!!! The sheet > displays correctly and dismisses on the button click :D > > As we discussed earlyer in the thread about having the callback using > the didEndSheet_returnCode_contextInfo(sheet, code, context) method, > that is presumably how i pass the input of my displayed sheet into the > controller? I would actually do that in the action method. For instance, let's say that your sheet has an text field and two buttons - OK and Cancel. In the OK action method, I'd get the input from the text field and store it wherever it needed to go, and call endSheet_returnCode() with a return code of 1. In the Cancel action, I'd pass a code of 0. In the callback, I'd first do an orderOut() on the sheet, then check the return code. If it's 1 I'd notify anything that needs to know about the new value read from the text field. By storing the changed data immediately but delaying the notification until the callback, any visual updates won't happen until after the sheet is out of the way - so the user is more likely to notice the change. sherm-- -- Web Hosting by West Virginians, for West Virginians: http://wv-www.net Cocoa programming in Perl: http://camelbones.sourceforge.net