You had me looking in TreeCtrl at first with the previous subject line :)
I too got an error and do not see an obvious reason, Kevin or Roy may
have a better idea as they are better with SWIG than I am.
You may want to put some printf''s in the generated TextCtrl.cpp file
within the SetDefaultStyle method and find where it is crashing.
The error in Mac OS X is:
test.rb:15:in `set_default_style'': undefined method `'' for
#<Wxruby2::TextCtrl:0x55832c> (NoMethodError)
from test.rb:15:in `initialize''
from test.rb:24:in `on_init''
from test.rb:30
Sean
On 8/23/06, Mark Ping <wxruby@roadq.com> wrote:> On my windows build, I just noticed that the background of my
TextCtrl''s
> is grey by default, and when I try to set the default style I get the
error:
>
> TestTextCtrl.rb:15:in `set_default_style'': undefined method
`'' for
> #<Wxruby2::TextCtrl:0x360a0c4> (NoMethodError)
> from TestTextCtrl.rb:15:in `initialize''
> from TestTextCtrl.rb:24:in `on_init''
> from TestTextCtrl.rb:30
>
>
> Using the following (probably overly verbose) program:
>
> require ''wx''
> include Wx
>
> class MyFrame < Frame
> def initialize(title)
> super(nil, -1, title)
> @top_sizer = BoxSizer.new( Wx::VERTICAL )
> @panel = Panel.new(self)
> @panel.set_auto_layout(true)
> @panel.set_sizer(@top_sizer)
> @test_text_ctrl = TextCtrl.new(@panel, -1, "")
>
> style = @test_text_ctrl.get_default_style()
> style.set_background_colour(WHITE)
> @test_text_ctrl.set_default_style(style)
>
>
> @top_sizer.add(@test_text_ctrl, 0, Wx::EXPAND | Wx::RIGHT, 20)
> end
> end
>
> class MyApp < App
> def on_init()
> frame = MyFrame.new("TextCtrl Test")
> frame.show(TRUE)
> end
> end
>
> $g_app = MyApp.new
> $g_app.main_loop()
>
> This is in spite of the fact that "set_default_style" appears to
be
> correctly generated when I run rake.
>
> Any ideas on what might be causing this and/or how to fix it?
>
> --Mark Ping
>
> _______________________________________________
> wxruby-users mailing list
> wxruby-users@rubyforge.org
> http://rubyforge.org/mailman/listinfo/wxruby-users
>