From dc62b597a99b8bc1866400366a340347b8fc12b9 Mon Sep 17 00:00:00 2001 From: trustable-code Date: Tue, 19 Sep 2017 19:07:38 +0200 Subject: Change Control's default width/height mode from "Expand" to "Static" "Expand" as default made problems in same cases. It should be overwritten anyway. --- examples/example_10_drawing.nim | 5 ++++- src/nigui.nim | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/examples/example_10_drawing.nim b/examples/example_10_drawing.nim index bab3a6b..5fb8b55 100755 --- a/examples/example_10_drawing.nim +++ b/examples/example_10_drawing.nim @@ -8,9 +8,12 @@ window.width = 500 window.height = 500 var control1 = newControl() +window.add(control1) # Creates a drawable control -window.add(control1) +control1.widthMode = WidthMode_Fill +control1.heightMode = HeightMode_Fill +# Let it fill out the whole window var image1 = newImage() image1.loadFromFile("example_01_basic_app.png") diff --git a/src/nigui.nim b/src/nigui.nim index a62348c..087c139 100755 --- a/src/nigui.nim +++ b/src/nigui.nim @@ -1314,8 +1314,10 @@ proc newControl(): Control = proc init(control: Control) = control.tag = "" - control.fWidthMode = WidthMode_Expand - control.fHeightMode = HeightMode_Expand + control.fWidthMode = WidthMode_Static + control.fHeightMode = HeightMode_Static + control.fWidth = 50 + control.fheight = 50 control.fScrollableWidth = -1 control.fScrollableHeight = -1 control.resetFontFamily() -- cgit v1.2.3