awesome. works like a charm!

On Sat, May 7, 2011 at 2:05 PM, Pavlos Vinieratos <pvinis@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@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@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel


_______________________________________________
MacRuby-devel mailing list
MacRuby-devel@lists.macosforge.org
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel




--
Pavlos Vinieratos



--
Pavlos Vinieratos