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 Letterle [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. -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Michael Letterle Sent: Thursday, February 14, 2008 5:56 AM To: ironruby-core at rubyforge.org Subject: [Ironruby-core] 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 Letterle [Polymath Programmer] http://michaeldotnet.blogspot.com _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org http://rubyforge.org/mailman/listinfo/ironruby-core
Robert Brotherus
2008-Feb-15 08:09 UTC
[Ironruby-core] Mismatch in cases of names of events
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 Brotherus
Software architect
Email: Robert.Brotherus at napa.fi
www.napa.fi
------------------------- 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)
Robert Brotherus:> 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
Have you tried mouse_enter?
Tomas
-----Original Message-----
From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at
rubyforge.org] On Behalf Of Robert Brotherus
Sent: Friday, February 15, 2008 12:10 AM
To: ironruby-core at rubyforge.org
Subject: [Ironruby-core] Mismatch in cases of names of events
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 Brotherus
Software architect
Email: Robert.Brotherus at napa.fi
www.napa.fi
------------------------- 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)
_______________________________________________
Ironruby-core mailing list
Ironruby-core at rubyforge.org
http://rubyforge.org/mailman/listinfo/ironruby-core
Robert Brotherus
2008-Feb-18 07:35 UTC
[Ironruby-core] Mismatch in cases of names of events
Yes I tried, mouse_enter did not work Robert Brotherus Software architect Napa Ltd -----Original Message----- From: ironruby-core-bounces at rubyforge.org [mailto:ironruby-core-bounces at rubyforge.org] On Behalf Of Tomas Matousek Sent: 15. helmikuuta 2008 19:14 To: ironruby-core at rubyforge.org Subject: Re: [Ironruby-core] Mismatch in cases of names of events Have you tried mouse_enter? Tomas