Adam Burmister
2009-Nov-25 14:12 UTC
[Ironruby-core] Finding the mythical root_visual object in Gestalt
Hi all, I''m currently writing about Gestalt using the 1.0 release. The best documentation I can find for it is the PDF "sl-back-to-just-text.pdf", by Jimmy, which states: "XAML accessors root_visual maps to System.Windows.Application.Current.RootVisual ... When a method is called that does not exist on root_visual, then FindName(methodName) is called. This allows access to any XAML elements with an x:Name value... root_visual.Message.Text = "New Message" " This is the code that I''m using to try and experiment with this: <html> <head> <script src="http://visitmix.com/dlr/dlr.js" type="text/javascript"></script> </head> <body> <script type="application/xml+xaml" width="200" height="50"> <UserControl xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Width="200" Height="50"> <Button x:Name="button1" Content="Button Text" /> </UserControl> </script> <script type="text/ruby"> window.alert root_visual.button1.content </script> </body> </html> I cannot find this object placed anywhere I would expect; at least it''s not as easily available as the documentation leads me to believe. Can anyone throw some light onto what I''m doing wrong, or if there has been a change in the way this works? Thank you kindly, Adam Burmister -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20091125/ec754c8c/attachment.html>
Jimmy Schementi
2009-Nov-29 00:23 UTC
[Ironruby-core] Finding the mythical root_visual object in Gestalt
I can add the "root_visual" variable; the current implementation only defines "me" and "xaml", which do exactly what "root_visual" would do. Unfortunately the implementation doesn''t quite match the spec at the moment (I''m not sure why they called it 1.0 =P). On Nov 25, 2009, at 9:12 AM, "Adam Burmister" <adam.burmister at gmail.com<mailto:adam.burmister at gmail.com>> wrote: Hi all, I''m currently writing about Gestalt using the 1.0 release. The best documentation I can find for it is the PDF "sl-back-to-just-text.pdf", by Jimmy, which states: "XAML accessors root_visual maps to System.Windows.Application.Current.RootVisual ... When a method is called that does not exist on root_visual, then FindName(methodName) is called. This allows access to any XAML elements with an x:Name value... root_visual.Message.Text = "New Message" " This is the code that I''m using to try and experiment with this: <html> <head> <script src="<http://visitmix.com/dlr/dlr.js>http://visitmix.com/dlr/dlr.js" type="text/javascript"></script> </head> <body> <script type="application/xml+xaml" width="200" height="50"> <UserControl xmlns="<http://schemas.microsoft.com/winfx/2006/xaml/presentation>http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="<http://schemas.microsoft.com/winfx/2006/xaml>http://schemas.microsoft.com/winfx/2006/xaml" Width="200" Height="50"> <Button x:Name="button1" Content="Button Text" /> </UserControl> </script> <script type="text/ruby"> window.alert root_visual.button1.content </script> </body> </html> I cannot find this object placed anywhere I would expect; at least it''s not as easily available as the documentation leads me to believe. Can anyone throw some light onto what I''m doing wrong, or if there has been a change in the way this works? Thank you kindly, Adam Burmister _______________________________________________ Ironruby-core mailing list Ironruby-core at rubyforge.org<mailto:Ironruby-core at rubyforge.org> http://rubyforge.org/mailman/listinfo/ironruby-core -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/ironruby-core/attachments/20091129/81acc89c/attachment.html>