[MacRuby-devel] handlers and carets

Pavlos Vinieratos pvinis at gmail.com
Sat May 7 04:08:30 PDT 2011


awesome. works like a charm!

On Sat, May 7, 2011 at 2:05 PM, Pavlos Vinieratos <pvinis at gmail.com> wrote:

> thanks. I will try that now. Do I have to do anything special with BS, or
> just install it?
>
>
> On Sat, May 7, 2011 at 3:58 AM, Laurent Sansonetti <lsansonetti at apple.com>wrote:
>
>> Hi Pavlos,
>>
>> You simply pass a Proc object.
>>
>>  handler = Proc.new do |result|
>> if result == …
>> ...
>> end
>>  oPanel.beginSheetModalForWindow self.window, completionHandler: handler
>>
>> Make sure you installed the latest BridgeSupport preview before, available
>> from http://www.macruby.org/files.
>>
>> Laurent
>>
>> On May 6, 2011, at 5:38 PM, Pavlos Vinieratos wrote:
>>
>> hello. how can I write this in macruby?
>>
>> [oPanel beginSheetModalForWindow:[self window]
>>
>>
>>         completionHandler:^(NSInteger result) {
>>
>>
>>         if (result == NSFileHandlingPanelOKButton) {
>>
>>
>>             for (NSURL *fileURL in [oPanel URLs]) {
>>
>>
>>                 // do something with fileURL
>>
>>
>>             }
>>
>>
>>         }
>>
>>
>>     }];
>>
>>
>> the second arg is a handler..
>>
>> thank you
>>
>> --
>> Pavlos Vinieratos
>>  _______________________________________________
>> MacRuby-devel mailing list
>> MacRuby-devel at lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>>
>>
>>
>> _______________________________________________
>> MacRuby-devel mailing list
>> MacRuby-devel at lists.macosforge.org
>> http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
>>
>>
>
>
> --
> Pavlos Vinieratos
>



-- 
Pavlos Vinieratos
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macruby-devel/attachments/20110507/ff3cedf5/attachment-0001.html>


More information about the MacRuby-devel mailing list