[Ironruby-core] trouble with super and .NET classes
jomes at microsoft.com
Mon Oct 8 18:40:44 EDT 2007
I attached a patch that fixes inheriting from a CLR base class. Of course, there's still a lot more work to do, but it lets you do the basic things like inherit from a CLR type and add methods in Ruby.
- John M
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of John Lam (DLR)
Sent: Monday, October 08, 2007 3:08 PM
To: ironruby-core at rubyforge.org
Subject: Re: [Ironruby-core] trouble with super and .NET classes
A quick look at the code:
Enums are broken today, so that won't work without some helper library that just returns the enum value. This is on our short list of bugs to fix already.
Jomes has already fixed inheritance and will be posting a patch for that soon to unblock you (we're still going to code review it internally and run it through our testing infrastructure before it gets out).
> -----Original Message-----
> From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-
> bounces at rubyforge.org] On Behalf Of Dermot Hogan
> Sent: Monday, October 08, 2007 2:56 PM
> To: ironruby-core at rubyforge.org
> Subject: Re: [Ironruby-core] trouble with super and .NET classes
> Hi John,
> Here's some very simple text: a form, a checkbox and a button with a
> couple of attributes. I haven't been able run this in IR at all so I've
> no idea if it will work or not. However, it looks like the sort of
> that the Form Designer produces in C# or VB. Tt does 'round trip'
> between the designer and persistant store, so it's internally
> - I think :)
> require 'mscorlib'
> require 'System'
> require 'System.Windows.Forms'
> require 'System.Drawing'
> class Form1123 < System::Windows::Forms::Form
> attr_accessor :checkBox1
> attr_accessor :button2
> def InitializeComponent
> self.button2 = System::Windows::Forms::Button.new()
> self.checkBox1 = System::Windows::Forms::CheckBox.new()
> # button2
> self.button2.Location = System::Drawing::Point.new(79, 113)
> self.button2.Name = "button2"
> self.button2.Size = System::Drawing::Size.new(75, 23)
> self.button2.TabIndex = 0
> self.button2.Text = "button2"
> self.button2.TextAlign =
> self.button2.UseVisualStyleBackColor = true
> # checkBox1
> self.checkBox1.Anchor = System::Windows::Forms::AnchorStyles.Top |
> System::Windows::Forms::AnchorStyles.Bottom |
> self.checkBox1.AutoSize = true
> self.checkBox1.Location = System::Drawing::Point.new(79, 61)
> self.checkBox1.Name = "checkBox1"
> self.checkBox1.Size = System::Drawing::Size.new(90, 17)
> self.checkBox1.TabIndex = 1
> self.checkBox1.Text = "checkBox1"
> self.checkBox1.TextAlign =
> self.checkBox1.UseVisualStyleBackColor = true
> # Form1123
> self.ClientSize = System::Drawing::Size.new(284, 264)
> self.Name = "Form1123"
> good luck!
> Posted via http://www.ruby-forum.com/.
> Ironruby-core mailing list
> Ironruby-core at rubyforge.org
Ironruby-core mailing list
Ironruby-core at rubyforge.org
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 2320 bytes
Url : http://rubyforge.org/pipermail/ironruby-core/attachments/20071008/9a35340d/attachment.obj
More information about the Ironruby-core