ListViewColumn width vs basicWidth

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

ListViewColumn width vs basicWidth

Louis Sumberg-2
I have a ListView where I want to change a column text heading dynamically.
The problem I run into is that when I change the header text, the column
width changes, e.g.,

  "Evaluate next line"
  shell := ListPresenter show: 'Enhanced list view'.
  "Make the first column a lot wider, then evaluate next line"
  shell view primaryColumn text: 'Header with info'.

I traced the problem to LVCOLUMN class>>fromColumn:in: which uses
#basicWidth:, so I changed that to #width, but that had some bad side
effects with the rest of the system.  I found a workaround is to set the
column width explicitly before setting the column text, e.g.,

  "Evaluate next line"
  shell := ListPresenter show: 'Enhanced list view'.
  "Make the first column a lot wider, then evaluate next lines"
  shell view primaryColumn
        width: shell view primaryColumn width;
        text: 'Header with info'.

-- Louis