hi all,
i'm building a test application. the goal is to be able to add and remove widgets dynamically. the test application has a VerticalPaneView and 2 Buttons. clicking the buttons add labels to the paneview. i have implemented postBuildWith: and an action method for each button. i add the first label in postBuildWith:. when the application opens the initial label is displayed.
the problem is that on clicking the buttons the displayed label text doesn't change. i have inspected the subpane and the new label is in its subviews collection. i have tried sending the invalidate and redraw messages to the label and subpane with no results. what am i missing?
below are the postBuildWith: and button action methods. currentWidget and panelView are instance vars.
postBuildWith: aBuilder
|widget|
panelView := aBuilder componentAt: #ID222.
widget := Label new.
widget name: 'GenericLbl'.
widget label: 'START'.
panelView add: widget.
currentWidget := widget.
self halt.
buttonActionMethod1
<resource: #uiCallback>
|widget|
panelView removeComponent: currentWidget.
self halt. ****************** panelView subViews collection is empty
widget := Label new.
widget name: 'GenericLbl'.
widget label: 'FUEL'.
currentWidget := widget.
panelView add: widget. ****************** panelView subViews collection is has new label
panelView invalidate.