Skip to content

Create a native scroll window without using a ListView? #711

Answered by jrmoulton
jrmoulton asked this question in Q&A
Discussion options

You must be logged in to vote
window := Window {
    min-width: 300pt;
    min-height: 388pt;
    preferred-width: 425pt;
    preferred-height: 550pt;
    property <[TextElement]> TextElements: [];
    document := ScrollView {  
        y: 10px;
        x: 10pt;
        for text_element[i] in TextElements : Text {
            y: i * 25px;
            width: parent.width - 30pt;
            wrap: word-wrap;
            text: text_element.text;
        }
    }
}

Using a ScrollView has the same issue as a Flickable. The content is rendered and if I manually resize the window I can see the content but there is no scroll bar.
Is it not working because this is a for loop of elements?

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@ogoffart
Comment options

@ogoffart
Comment options

@jrmoulton
Comment options

@ogoffart
Comment options

Answer selected by jrmoulton
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