Noone's mentioned it yet

But I noticed it yesterday, there’s a new SVN revision out there.
Lot’s of changes to the DLR, which can affect stuff people may be
working on. You may want to get latest and merge your changes.

I assume this is a result of syncing up IronPython and IronRuby’s DLR
projects… I’m sure it’s been asked before, but why /isn’t/ the DLR
hosted separately?


Michael L.
[Polymath Programmer]
http://michaeldotnet.blogspot.com

We have talked about hosting DLR separately and still not sure where we
will land. Hosting it separately makes it harder to pull down matching
sources of the DLR and IronRuby (or DLR and IronPython). So its not
clear whether it would be a net positive or a net negative to host it
separately.

Have you tried mouse_enter?

Tomas

I have made a test app with XAML + WPF + IronRuby event handlers
(IronRuby revision 76). The code of the Ruby-part (EventManager.rb) is
below. Due to lack of other working mechanisms of connecting the
Ruby-methods to the WPF-events, I ended up in passing the widget
reference to Ruby in a global variable and then using the closure-syntax
to connect the delegates on Ruby-side.

All three events work ok and the App runs, but only with following event
names:

CLR name of the event Name of event seen in IronRuby
“Click” “click”
“Loaded” “loaded”
“MouseEnter” “MouseEnter”

Notice that whereas “Click” and “Loaded” mapped to their lower-case
equivalents, the “MouseEnter” event connected only if it was written in
the original capital form “MouseEnter” on IronRuby-side. The most
logical alternative “mouseEnter” caused MethodMissing. I suspect such
inconsistency in the name-mapping cannot be intentional.

Robert B.
Software architect
Email: [email protected]

------------------------- EventManager.rb: -------------------------

Reference the WPF assemblies

require ‘PresentationFramework, Version=3.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35’
require ‘PresentationCore, Version=3.0.0.0, Culture=neutral,
PublicKeyToken=31bf3856ad364e35’

SolidColorBrush = System::Windows::Media::SolidColorBrush
Colors = System::Windows::Media::Colors

module NWS

module COLOURBUTTON

class WidgetEventManager
  def initialize(widget)
    widget.click { |sender,args| self.click(sender,args) }

CLR name: Click

    widget.loaded { |sender,args| self.loaded(sender) }

CLR name: Loaded

    widget.MouseEnter { |sender,args| self.mouse_enter(sender,args)

} # CRL name: MouseEnter
end
def click(widget, args)
widget.content = widget.content.to_s + “X”
end
def mouse_enter(widget, args)
widget.background = SolidColorBrush.new(Colors.Red)
end
def loaded(widget)
widget.background = SolidColorBrush.new(Colors.Yellow)
end
end

end

end

WidgetEventManager.new($widget)

Yes I tried, mouse_enter did not work

Robert B.
Software architect
Napa Ltd

Robert B.:

CLR name of the event Name of event seen in IronRuby
“Click” “click”
“Loaded” “loaded”
“MouseEnter” “MouseEnter”

Nope. This is definitely a bug in the name mangling. It should be
mouse_enter or MouseEnter. Can you open a bug on this one please?

Thanks,
-John