Model vs Widgets #232
-
|
I have a model which is an My Creating a This only works if the Or should I create a separate list of Any guidance is appreciated. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Yeah, the problem is that your To achieve that you could just use an |
Beta Was this translation helpful? Give feedback.
Yeah, the problem is that your
Text.widget()is immediately invalidated as soon aswidgetBuilderreturns because it refers to a dangling stack pointer. You'll have to providewidgetwith a pointer that's stable throughout the entire drawing process.To achieve that you could just use an
ArrayList(vxfw.Text)to store your user input, that way you'll have stable pointers forwidget()to work with as long as you only modify the array list from the same thread that does the drawing.The
scrollexample does something similiar, though it doesn't storevxfw.Textdirectly but implements its ownModelRow.widgetfor the builder to use and generates aTexton the fly for each row during the drawing …