Hello, I have an interesting problem that I can?t work out. I have a GUI app that uses FolderBrowserDialog. It works fine when I run it from the command line with ir. When I embed IronRuby in an app, the browse window comes up, the ok, cancel, and make new folder buttons are there, but the actual browse functionality is missing. It?s just blank where the browse bit should be. This is how I?ve called IronRuby from the app: ScriptRuntime irruntime = IronRuby.Ruby.CreateRuntime(); ScriptEngine ir = IronRuby.Ruby.GetEngine(irruntime); ScriptScope scope = ir.CreateScope(); ScriptSource script = ir.CreateScriptSourceFromFile(script); script.Execute(scope); -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100105/c7443573/attachment.html>
I seem to recall that the actual folder brower is implemented via COM, and that you probably need an [STAThread] attribute on your Main method. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Robert Rouse Sent: Tuesday, January 05, 2010 8:01 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Problem with FolderBrowserDialog Hello, I have an interesting problem that I can''t work out. I have a GUI app that uses FolderBrowserDialog. It works fine when I run it from the command line with ir. When I embed IronRuby in an app, the browse window comes up, the ok, cancel, and make new folder buttons are there, but the actual browse functionality is missing. It''s just blank where the browse bit should be. This is how I''ve called IronRuby from the app: ScriptRuntime irruntime = IronRuby.Ruby.CreateRuntime(); ScriptEngine ir = IronRuby.Ruby.GetEngine(irruntime); ScriptScope scope = ir.CreateScope(); ScriptSource script = ir.CreateScriptSourceFromFile(script); script.Execute(scope); -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100105/0bb7a1b5/attachment-0001.html>
That was it. It works now. On 1/5/10 10:21 AM, "Curt Hagenlocher" <curth at microsoft.com> wrote:> I seem to recall that the actual folder brower is implemented via COM, and > that you probably need an [STAThread] attribute on your Main method. > > > From: ironruby-core-bounces at rubyforge.org > [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Robert Rouse > Sent: Tuesday, January 05, 2010 8:01 AM > To: ironruby-core at rubyforge.org > Subject: [Ironruby-core] Problem with FolderBrowserDialog > > Hello, > > I have an interesting problem that I can?t work out. > > I have a GUI app that uses FolderBrowserDialog. It works fine when I run it > from the command line with ir. > > When I embed IronRuby in an app, the browse window comes up, the ok, cancel, > and make new folder buttons are there, but the actual browse functionality is > missing. It?s just blank where the browse bit should be. This is how I?ve > called IronRuby from the app: > > ScriptRuntime irruntime = IronRuby.Ruby.CreateRuntime(); > > ScriptEngine ir = IronRuby.Ruby.GetEngine(irruntime); > > ScriptScope scope = ir.CreateScope(); > > ScriptSource script = ir.CreateScriptSourceFromFile(script); > > script.Execute(scope); > > > > _______________________________________________ > Ironruby-core mailing list > Ironruby-core at rubyforge.org > http://rubyforge.org/mailman/listinfo/ironruby-core-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20100105/6aff1702/attachment.html>