try NSSelectorFromString

http://developer.apple.com/documentation/Cocoa/Reference/Foundation/Miscellaneous/Foundation_Functions/Reference/reference.html#//apple_ref/c/func/NSSelectorFromString

On 5/5/07, Tim Perrett <freestyle_kayaker / hotmail.com> wrote:
> Hey Guys
>
> Just wondered if somone could help me with using modal sheets in
> RubyCocoa - I think I am nearly there but its one method paramater that
> is sucuppering me.... In the apple tutorial here is the code:
>
>
> - (void)showCustomSheet: (NSWindow *)window
>
> // User has asked to see the custom display. Display it.
> {
>     if (!myCustomSheet)
> //Check the myCustomSheet instance variable to make sure the custom
> sheet does not already exist.
>         [NSBundle loadNibNamed: @"MyCustomSheet" owner: self];
>
>     [NSApp beginSheet: myCustomSheet
>             modalForWindow: window
>             modalDelegate: self
>             didEndSelector:
> @selector(didEndSheet:returnCode:contextInfo:)
>             contextInfo: nil];
>
>     // Sheet is up here.
>     // Return processing to the event loop
> }
>
>
>
> So I have translated this into
>
>   def showConnectionSheet(window)
>     NSBundle.loadNibNamed_owner('Connection', self)
>   NSApp.beginSheet_modalForWindow_modalDelegate_didEndSelector_contextInfo(@connection,
> self.window, nil, nil, nil)
>   end
>
>
> But its the didEndSelector paramater that I do not know what to put in?
> Can anyone help me?
>
> Cheers
>
> Tim
>
> --
> Posted via http://www.ruby-forum.com/.
>
>