refaktor / rye-fyne

Fyne GUI library with Rye language.
https://ryelang.org
Apache License 2.0
14 stars 2 forks source link

list displays only 1 row on Windows #39

Open HFolkertH opened 3 weeks ago

HFolkertH commented 3 weeks ago

The million numbers List example shows me only 1 row instead of the 5 rows as shown on rye-fyne website.

image

My screen. image

Could that be a Windows problem?

And how can I set the number of listed rows from 5 to something else?

refaktor commented 3 weeks ago

How big is the window itself in your case and in your code do you call |resize size 220.0 200.0 ?

That call determines the window size, without it the list would reduce to minimum or one row. The number of rows it shows in the consequence of the window size in this example.

HFolkertH commented 3 weeks ago

the canvas itself is large enough

a. app |window "Hello Folkert" |resize size 1200.0 800.0

image

I will test the same code on my macbook later on. Perhaps it is OS related.

refaktor commented 3 weeks ago

Aha, that is a different example / demo ... that one shows one line for me also and it's expected. The reason is that the parent is v-box and both boxes always reduce the items in them to minimum.

If you want the list to extend you have to use different combinations of layouts. I in fact don't have that much experience with Fyne yet, but the one layout that takes all available space is called border. It has a little unusual api ... first 4 arguments are border widgers for top bottom left right, and the last argument is a block of items that it expands to maximum.

Look at the Shopping list app example on how border is used to expand list to the maximum and input to the bottom. cont: border nil input nil nil [ lst ]

I plan to add page about layouts and layouting tricks to the cookbook.