|
From: Jussi S. <jus...@pp...> - 2006-11-25 15:03:53
|
Greg Lindstrom wrote:
> headers (I define them in ColumnHeaders, but when I add data the
> headers go away.
Are you doing this in the resource editor? I enter a list of strings
into the field 'columnHeadings':
['Name', 'Age', 'Address']
and enter data into the field 'items':
[['John', '21', 'London'], ['George', '34', 'Liverpool'],
['Paul', '63', 'Paris']]
and everything is otherwise OK, but the columns change to be too narrow.
That is maybe what you meant with this:
> Also, I can't seem to set the column widths to a fixed width.
I started looking for info to solve this problem through the usual route:
- Pythoncard Sample Launcher,
- wxPython Demo
- wxWidgets reference (installed with wxPython)
The last one helped: its documentation of the wxListCtrl widget gives
the function SetColumnWidth, which I called in the on_initialize method
like this:
self.components.MultiColumnList1.SetColumnWidth(0,70)
self.components.MultiColumnList1.SetColumnWidth(1,45)
to set the 'Name' and 'Age' column widths.
BTW1. Both the Pythoncard and the wxPython demos are a great source of
information because you are able to browse the source code to see how
the widgets are used and read the comments. In this particular case the
Pythoncard demo has a demo called 'multicolumnexample' that at the start
of its source has some documentation on the multicolumlist component.
BTW2. wxPython is built on the wxWidgets package. Thus the wxWidgets
reference is applicable to Pythoncard also. Reading it may be a little
rough at first because the documentation is made on the C++ level. After
a while, though, you get used to how to apply mutatis mutandis the info
in Pythoncard.
HTH,
Jussi
--
Jussi Salmela
http://personal.inet.fi/cool/operator/
|