Bug: Mutating a ListView

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

Bug: Mutating a ListView

Louis Sumberg
I see in DSDN that this was reported by Ian in June of last year but it's
still a problem in version 4.  If you mutate a listview to any other sort of
listview, all existing columns are reparented to nil.  I traced it back to
ViewComposer>>#removeView: which is called by ViewComposer>>#mutateTo:, in
particular, the line " aView parentView removeSubView: aView", though I
don't see how to fix the code itself.  (Tracing it further, the columns do
have the correct parents until the call to Processor>>#callback:evaluate: in
InputState:#wndProc:message:wParam:lParam.)  As Ian pointed out, the current
fix, after mutating and before laying out, is to reparent the
listviewcolumns to the listview -- you can do this from within VC by
selecting the listview and evaluating the following in the VC workspace:
"self allColumns do: [:col | col parent: self]".

BTW, a tip on debugging.  I traced the workings of #mutate, which is a VC
command, by selecting the listview, then debugging the following in the VC
workspace: "self topView presenter mutate".  "self topView presenter"
returns the VC's presenter (a View Composer) and gives you ready access to
VC commands.  Another example of the living breathing nature of a Smalltalk
environment.

-- Louis