[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: problem with RubyDotNet r3 evaluator .rbw

Benjamin Schroeder

9/14/2003 2:29:00 AM

On Saturday, September 13, 2003, at 08:01 PM, gabriele renzi wrote:

> I even get this error with this simple script:
>
>>> require 'dotnet'
> => true
>>> loadLibrary('System.Windows.Forms')
> => #<DotNetObject:0x27eb1a0 @dotNet=#<DotNet:0x27ec4a8>,
> @objectRef=#<WrappedObjectRef:0x27eb518>>
>>> Application.run(Form.new)
>
> ....same error...

Do you get this error when running from irb? That seems to work for
me. (A script file should work as well.) I'd be interested to hear
whether it works in that context.

I think what is going on when you are in the evaluator is that an
application loop is already running (to display the evaluator window),
so .NET doesn't want to run one on top of it. Does it work to do
something like "Form.new.show" instead? When there's already a loop
running, like in the evaluator, that will show the window and let it
handle events.

When running from a top-level script, the Application.run should be the
thing to do. This would set up the "main window" for your app. Just
calling show in that context would cause the window to disappear
immediately afterwards.

Hope this helps - please let me know what you find out!

> OTOH, running tests work fine, some tests are failing cause it seem I
> don't have csc.exe in my path..

I'm glad to hear that! We aren't in general as sure about the
portability of the test and build environments. The tests that are
failing because of csc are, I think, mostly just trying to use
libraries that we set up to test particular interop features.

> anyway this is really an impressive package!
> Just two things:
> - would you please add the online documentation to the archive? goin
> online just to get some docs that could safely fit in the .zip file is
> a PITA.

Thanks - and, yes - that's a good idea. We'll add the documentation to
the next release, R4.

> - would you add some more samples?

Sure! Is there any kind of sample you'd like to see?

Thanks,
Ben Schroeder


1 Answer

gabriele renzi

9/14/2003 6:32:00 PM

0

il Sun, 14 Sep 2003 11:29:29 +0900, Benjamin Schroeder
<benschroeder@acm.org> ha scritto::


>Do you get this error when running from irb?

yes

> That seems to work for
>me. (A script file should work as well.) I''d be interested to hear
>whether it works in that context.

running from a file with ruby filename.rb fail with the same error.
It works like a charm with Form.new.show
Anyway, I didn''t run this script in the evaluator, cause the evaluator
won''t start at all :)




>
>> - would you add some more samples?
>
>Sure! Is there any kind of sample you''d like to see?


Another useful thing would be the usage of System.Data.

I think that some sample using System.Windows.Forms would cause a good
impression on the casual downloader ;)
In the general sense, it would be cool to have some irb-controlled
script.
i.e. show a simple WinForm running and calling methods of the GUI from
irb.
On the same line some I think something really cool would be a
TestSuite written in ruby for .net classes, similar in spirit to
http://www.testing.com/writings/bypassing-t...

I mean, ruby as a tool.

Another cool thing would be some example of System.Data.

I think these are the stuff you''re using ATM, possibly because many
other .net packages are lready available in ruby, and some are ,
maybe, not easily integrated with ruby (I suppos, for example, the web
stuff.)

thanks for the quick answer, sorry if my posts come on the list latre,
I think my provider is having some prob with the newserver