Skip to content
Discussion options

You must be logged in to vote

Yeah, the problem is that your Text.widget() is immediately invalidated as soon as widgetBuilder returns because it refers to a dangling stack pointer. You'll have to provide widget with 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 for widget() to work with as long as you only modify the array list from the same thread that does the drawing.
The scroll example does something similiar, though it doesn't store vxfw.Text directly but implements its own ModelRow.widget for the builder to use and generates a Text on the fly for each row during the drawing …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by LukeSkyw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants