diff options
| author | Pietro Gagliardi <[email protected]> | 2018-08-19 22:19:12 -0400 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2018-08-19 22:19:12 -0400 |
| commit | a0354058ecd8ee9bd88d305162b3d2865ef925cc (patch) | |
| tree | 10e2caf3df65f062bed51fe935a91dd2bd77619e /zz_histogram.go | |
| parent | a0458f7593be62d331ba46aa1b59b87ac64bf540 (diff) | |
Added ColorButton. Will fill in the rest of the histogram example later.
Diffstat (limited to 'zz_histogram.go')
| -rw-r--r-- | zz_histogram.go | 19 |
1 files changed, 10 insertions, 9 deletions
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) |
