sridharans sivamurugan
2011-May-04 06:23 UTC
[Ironruby-core] How to acces the Application''s control in Iron Ruby script
Hi All,
I''m trying to do the same in IronRuby that I have done in IronPython
script, but its throwing some exception as undefine constant. I dont
know how to achieve it Iron Ruby.
In Puthon I will access the control that is placed in the applicatoin
and set its source in the Script itself. But in Ruby I dont know how to
do it.
Can any one help me to achieve this.
-Sri.
Python Code :
grid = Application.FindName(''MyListBox'')
grid.ItemsSource = MyObject
While using the same in IronRuby its throwing exception as undefined
constant "Application".
--
Posted via http://www.ruby-forum.com/.
Eduardo Blumenfeld
2011-May-04 12:11 UTC
[Ironruby-core] How to acces the Application''s control in Iron Ruby script
Hi Sri,
I assume that you are trying to work from a wpf application...
in Ruby, variables that start in upper case are interpreted as
constants...
Did you try?
list = self.FindName(''MyListBox'')
list.ItemsSource = myObject
(note the lower case names)...
Regards,
Eduardo Blumenfeld
Sridharan Sivamurugan wrote in post #996532:> Hi All,
>
> I''m trying to do the same in IronRuby that I have done in
IronPython
> script, but its throwing some exception as undefine constant. I dont
> know how to achieve it Iron Ruby.
>
> In Puthon I will access the control that is placed in the applicatoin
> and set its source in the Script itself. But in Ruby I dont know how to
> do it.
> Can any one help me to achieve this.
>
> -Sri.
>
> Python Code :
>
> List = Application.FindName(''MyListBox'')
> List.ItemsSource = MyObject
>
> While using the same in IronRuby its throwing exception as undefined
> constant "Application".
--
Posted via http://www.ruby-forum.com/.