summaryrefslogtreecommitdiff
path: root/examples/example_09_font_size.nim
blob: 7f443968a604a6c49bae364e501a18ba17b75d31 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# This example shows how to change the font size of controls.

import nigui

app.init()

var window = newWindow()
window.width = 500
window.height = 600
var container = newLayoutContainer(Layout_Vertical)
window.add(container)

for i in 12..20:
  var innerContainer = newLayoutContainer(Layout_Horizontal)
  container.add(innerContainer)
  innerContainer.frame = newFrame("Font size: " & $i)
  var button = newButton("Button")
  button.fontSize = i.float
  innerContainer.add(button)
  var label = newLabel("Label")
  label.fontSize = i.float
  innerContainer.add(label)

window.show()
app.run()