[wxruby-users] Problem with ListCtrl Width
Michael Satterwhite
lists at ruby-forum.com
Mon Mar 23 13:45:42 EDT 2009
I'm still learning wxWidgets, so this is probably basic.
I have some data that I'm trying to display in a wxListCtrl. The
ListCtrl is in a Box Sizer that is stacked in a main box sizer. the list
control is the only control in the specific box sizer containing it.
The problem is that the sizer is squeezing the width of the list control
down to the point that only a column and a half are visible without
horizontal scrolling. The form is actually wide enough that it should be
able to display all the columns.
How do I tell the layout to expand the width of the wxListCtrl?
Here's my code for the ListCtrl:
#Put the item list on the screen
@itemSizer = Wx::BoxSizer.new(Wx::HORIZONTAL)
@itemList = Wx::ListCtrl.new(self, -1,
Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE,
Wx::LC_REPORT | Wx::LC_HRULES | Wx::LC_VRULES)
row = 0
@itemList.insert_column(0, "Date")
@itemList.insert_column(1, "Start")
@itemList.insert_column(2, "End")
@itemList.insert_column(3, "Description")
@itemList.insert_column(4, "Elapsed")
@itemList.insert_column(5, "No Charge")
@itemSizer.add(@itemList, 1, Wx::TOP | Wx::LEFT, 15)
@mainSizer.add(@itemSizer, 1, Wx::ALIGN_LEFT | Wx::LEFT |Wx::BOTTOM,
15)
Thanks in advance
---Michael
--
Posted via http://www.ruby-forum.com/.
More information about the wxruby-users
mailing list