[wxruby-users] set_size and ScrolledWindow
Alex Fenton
alex at pressure.to
Tue Aug 5 15:26:43 EDT 2008
Magnus Sjöstrand wrote:
> I'm trying to set the size of a panel by using set_size. The size does
> change, but the scrollbars in my ScrolledWindow does not activate.
>
> If I create a panel in wxFormBuilder and set the size there it works,
> but not when created from code.
>
> I've tried both with and without sizers, set_virtual_size and anything
> else I thought was even remotely related.
>
> my code looks like this:
>
> custom_panel = MyCustomPanel.new(@scrolled_window)
> custom_panel.set_size 800, 6000
>
> @scrolled_window is initialized by code from xrcise
>
> Which I guessed would work since it works in c++.
>
> I've also tried to set the size from MyCustomPanel's constructor.
>
> What did I miss? :)
Perhaps you need to call set_scroll_rate?
Using sizers is the easiest way. The ScrolledWindow is the parent that
owns the sizer, the child panel is added to it. But the scrollbars won't
show unless the pixel increment is specified with set_scroll_rate.
hth
alex
More information about the wxruby-users
mailing list