From 17d3d8a6fdcf0f2a04cb51634c55b5121806b57e Mon Sep 17 00:00:00 2001 From: trustable-code Date: Thu, 21 Mar 2019 19:35:17 +0100 Subject: example_14_container_scrolling: eliminate fixed height value --- examples/example_14_container_scrolling.nim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/example_14_container_scrolling.nim b/examples/example_14_container_scrolling.nim index 95923d0..157ca53 100755 --- a/examples/example_14_container_scrolling.nim +++ b/examples/example_14_container_scrolling.nim @@ -1,8 +1,10 @@ # This example shows an inner container with a scrollbar. # Result: # topContainer will take as many space as needed for the 5 labels. +# scrollContainer takes the remaining space. # There is only one scrollbar: -# The vertical scrollbar in scrollContainer, because it has an insufficient fixed height. +# The vertical scrollbar in scrollContainer, because it's height is insufficient for the 25 labels. +# When the window height is increased, the scrollbar disappears. import NiGui @@ -23,7 +25,7 @@ for i in 1..5: var scrollContainer = newLayoutContainer(Layout_Vertical) mainContainer.add(scrollContainer) -scrollContainer.height = 300 +scrollContainer.heightMode = HeightMode_Expand scrollContainer.widthMode = WidthMode_Expand for i in 1..25: -- cgit v1.2.3