Forum: wxRuby Control Sizing

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
9e6d05909dc733af570faadce1392e67?d=identicon&s=25 Michael Satterwhite (msatterwhite)
on 2009-04-18 20:40
I'm still having trouble getting the intricities of Control sizing
through my head.

I'm using wxFormBuilder to build my screen, but I can subclass and write
code as needed ... if I knew what code is needed.

I have a form with a vertical sizer that contains a label and a ListBox
control. The label has a proportion of 0, the listbox of 1. When the
form is created, the listbox is only tall enough to contain about 3
items - very short screen. I want it to be tall enough for at least 10
items. problem: I have no idea how to reasonably control the size of a
control (in this case listbox)

I am calling self.fit - which I *THINK* may be the problem. If I don't
call that, however, the screen comes up so narrow that the controls on
the right are cut off - which is much worse than the sort listbox.

Would one of the experts here be so kind as to help me in understanding
how to control something such as this?

Thanks in advance
---Michael
06f6780c99d4a8dd71f2b474082ea9ce?d=identicon&s=25 Alex Fenton (Guest)
on 2009-04-18 20:57
(Received via mailing list)
Michael Satterwhite wrote:
> I have a form with a vertical sizer that contains a label and a ListBox
> control. The label has a proportion of 0, the listbox of 1. When the
> form is created, the listbox is only tall enough to contain about 3
> items - very short screen. I want it to be tall enough for at least 10
> items. problem: I have no idea how to reasonably control the size of a
> control (in this case listbox)
>
> I am calling self.fit - which I *THINK* may be the problem. If I don't
> call that, however, the screen comes up so narrow that the controls on
> the right are cut off - which is much worse than the sort listbox.

Perhaps calling something like:

list_box.min_size = [250, 400]

(and then possibly, sizer.layout, to update the layout)

Calling this advises the sizer of a minimum size for the relevant widget
to be allocated in the layout
http://wxruby.rubyforge.org/doc/window.html#Window...

alex
This topic is locked and can not be replied to.