[Ironruby-core] Form Designer adding delegates

Dermot Hogan lists at ruby-forum.com
Wed Oct 24 17:24:12 EDT 2007


I've got most of the form designer working ok now, so I'm going to start
working on the MSBuild, project & item integration. However, I've got a
couple of problems/questions.

1) IronRuby doesn't like the delegate op assign so I can't click on a
button

2) I really need 'attr_accessor' to define a 'field' (it's commented out
below and I've worked round it, but it's a pain to do). Does it exist
yet?

3) the references use the full qualified reference name. I can live with
this no problem, but it really should use the short form. Is this on the
road map?





Here's the code for a simple form:

require 'System, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL'
require 'System.Data, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089, processorArchitecture=x86'
require 'System.Drawing, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL'
require 'System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089, processorArchitecture=MSIL'

class Form1123 < System::Windows::Forms::Form

  #attr_accessor :button1

  def button1=(v)
    @button1 = v
  end
  def button1
    @button1
  end


  def InitializeComponent


    self.button1 = System::Windows::Forms::Button.new()
    self.SuspendLayout()
    #
    # button1
    #
    self.button1.Location = System::Drawing::Point.new(220, 91)
    self.button1.Name = "button1"
    self.button1.Size = System::Drawing::Size.new(198, 42)
    self.button1.TabIndex = 0
    self.button1.Text = "button1"
    self.button1.Click += System::EventHandler.new(self.button1_Click)
    #
    # Form1123
    #
    self.ClientSize = System::Drawing::Size.new(600, 400)
    self.Controls.Add(self.button1)
    self.Name = "Form1123"
    self.ResumeLayout(false)
    end
  end


Apart from the 'Click' everything else works fine.

Thanks,

Dermot
-- 
Posted via http://www.ruby-forum.com/.


More information about the Ironruby-core mailing list