From a0354058ecd8ee9bd88d305162b3d2865ef925cc Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Sun, 19 Aug 2018 22:19:12 -0400 Subject: Added ColorButton. Will fill in the rest of the histogram example later. --- zz_histogram.go | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'zz_histogram.go') diff --git a/zz_histogram.go b/zz_histogram.go index bf26358..a783dbd 100644 --- a/zz_histogram.go +++ b/zz_histogram.go @@ -11,6 +11,8 @@ import ( "github.com/andlabs/ui" ) +var colorButton *ui.ColorButton + var datapoints [10]*ui.Spinbox // some metrics @@ -234,18 +236,17 @@ func setupUI() { vbox.Append(datapoints[i], false) } -/* - colorButton = uiNewColorButton(); + colorButton = ui.NewColorButton() // TODO inline these - setSolidBrush(&brush, colorDodgerBlue, 1.0); - uiColorButtonSetColor(colorButton, - brush.R, + brush := mkSolidBrush(colorDodgerBlue, 1.0); + colorButton.SetColor(brush.R, brush.G, brush.B, - brush.A); - uiColorButtonOnChanged(colorButton, onColorChanged, NULL); - uiBoxAppend(vbox, uiControl(colorButton), 0); -*/ + brush.A) + colorButton.OnChanged(func(*ui.ColorButton) { + histogram.QueueRedrawAll() + }) + vbox.Append(colorButton, false) hbox.Append(histogram, true) -- cgit v1.2.3