Ivan Porto Carrero
2008-Aug-15 07:01 UTC
[Ironruby-core] Interacting with a WPF/Winforms application
Hi Is there a simple way to interact with the GUI of a WPF/Winforms application? I''ll clarify a little what I would like to achieve: when you start a console session with an environment loaded you could potentially type the following lines in there>> require ''config/boot'' >> start_wpf_application >> System::Windows::Application.current.main_window.my_panel.children.addWpf.build(TextBox, :text => "Very important placeholder text") That last line would then add a textbox to the panel while the application is running. I could probably use threading to achieve this or different appdomains maybe. any thoughts? Cheers Ivan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20080815/2b381c51/attachment.html>
Curt Hagenlocher
2008-Aug-15 14:39 UTC
[Ironruby-core] Interacting with a WPF/Winforms application
Running in a separate thread is what you probably want to do. There?s an IronPython sample that does something like this for WinForms ? it?s called winforms.py and lives in the tutorial directory. Unfortunately, it looks like it depends on some IronPython-specific functionality in the command line ? but it wouldn?t be too hard to add something similar to IronRuby. From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Ivan Porto Carrero Sent: Friday, August 15, 2008 12:01 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] Interacting with a WPF/Winforms application Hi Is there a simple way to interact with the GUI of a WPF/Winforms application? I''ll clarify a little what I would like to achieve: when you start a console session with an environment loaded you could potentially type the following lines in there>> require ''config/boot'' >> start_wpf_application >> System::Windows::Application.current.main_window.my_panel.children.add Wpf.build(TextBox, :text => "Very important placeholder text")That last line would then add a textbox to the panel while the application is running. I could probably use threading to achieve this or different appdomains maybe. any thoughts? Cheers Ivan -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20080815/20e069dc/attachment.html>
Michael Letterle
2008-Aug-16 19:36 UTC
[Ironruby-core] Interacting with a WPF/Winforms application
FWIW, the easiest way is to rename the exe to dll,(btw, is there a reason we
can''t require exes?) and then call "Thread.new { Program.main args
}" :)
On Fri, Aug 15, 2008 at 3:01 AM, Ivan Porto Carrero <ivan at
flanders.co.nz>wrote:
> Hi
>
> Is there a simple way to interact with the GUI of a WPF/Winforms
> application?
> I''ll clarify a little what I would like to achieve:
>
> when you start a console session with an environment loaded you could
> potentially type the following lines in there
>
> >> require ''config/boot''
> >> start_wpf_application
> >>
System::Windows::Application.current.main_window.my_panel.children.add
> Wpf.build(TextBox, :text => "Very important placeholder text")
>
> That last line would then add a textbox to the panel while the application
> is running.
>
> I could probably use threading to achieve this or different appdomains
> maybe.
>
> any thoughts?
>
> Cheers
> Ivan
>
> _______________________________________________
> Ironruby-core mailing list
> Ironruby-core at rubyforge.org
> http://rubyforge.org/mailman/listinfo/ironruby-core
>
>
--
Michael Letterle
[Polymath Prokrammer]
http://blog.prokrams.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
<http://rubyforge.org/pipermail/ironruby-core/attachments/20080816/2dd28d0a/attachment-0001.html>