summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortrustable-code <krauter.simon@arcor.de>2018-02-20 18:31:50 +0100
committertrustable-code <krauter.simon@arcor.de>2018-02-20 18:31:50 +0100
commitfdd862a97e630e706d6067869efc732ee1513115 (patch)
tree001c88b51da596591e48cfe44f272d0a53eabd6c /src
parent679538d03e9abf17b9750ca8c1c6cb5118a12c47 (diff)
downloadNiGui-fdd862a97e630e706d6067869efc732ee1513115.tar.gz
NiGui-fdd862a97e630e706d6067869efc732ee1513115.zip
Call forceRedraw() on text change of Frame, Button and Label
Diffstat (limited to 'src')
-rwxr-xr-xsrc/nigui.nim3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/nigui.nim b/src/nigui.nim
index 29fcf71..6b50dee 100755
--- a/src/nigui.nim
+++ b/src/nigui.nim
@@ -2192,6 +2192,7 @@ method text(frame: Frame): string = frame.fText
method `text=`(frame: Frame, text: string) =
frame.fText = text
frame.tag = text
+ frame.forceRedraw()
# should be extended by NativeFrame
method getPadding(frame: Frame): Spacing =
@@ -2229,6 +2230,7 @@ method `text=`(button: Button, text: string) =
button.fText = text
button.tag = text
button.triggerRelayoutIfModeIsAuto()
+ button.forceRedraw()
# should be extended by NativeButton
method naturalWidth(button: Button): int = button.getTextWidth(button.text) + 20
@@ -2266,6 +2268,7 @@ method `text=`(label: Label, text: string) =
label.fText = text
label.tag = text
label.triggerRelayoutIfModeIsAuto()
+ label.forceRedraw()
method naturalWidth(label: Label): int = label.getTextWidth(label.text)