summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortrustable-code <krauter.simon@arcor.de>2017-09-19 19:07:38 +0200
committertrustable-code <krauter.simon@arcor.de>2017-09-19 19:07:38 +0200
commitdc62b597a99b8bc1866400366a340347b8fc12b9 (patch)
tree71a80b5899ce73798978b1af0c1ac9838b2abc02
parent97a1f6de78ba55366bad4b9a266f4c0e871aa9f9 (diff)
downloadNiGui-dc62b597a99b8bc1866400366a340347b8fc12b9.tar.gz
NiGui-dc62b597a99b8bc1866400366a340347b8fc12b9.zip
Change Control's default width/height mode from "Expand" to "Static"
"Expand" as default made problems in same cases. It should be overwritten anyway.
-rwxr-xr-xexamples/example_10_drawing.nim5
-rwxr-xr-xsrc/nigui.nim6
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()