diff options
author | Alexander Neumann <an2048@gmail.com> | 2012-10-30 15:06:10 +0100 |
---|---|---|
committer | Alexander Neumann <an2048@gmail.com> | 2012-10-30 15:06:10 +0100 |
commit | 6920b4874faffbda25bbc7ab11fdcdd03640e958 (patch) | |
tree | 10066452accb7ed5c237b5157d3b6d633cc80812 /label.go | |
parent | Begin replacing previous data binding system with a new one based on properties (diff) | |
download | wireguard-windows-6920b4874faffbda25bbc7ab11fdcdd03640e958.tar.xz wireguard-windows-6920b4874faffbda25bbc7ab11fdcdd03640e958.zip |
Add some properties to many widgets
Diffstat (limited to 'label.go')
-rw-r--r-- | label.go | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -9,6 +9,7 @@ import . "github.com/lxn/go-winapi" type Label struct { WidgetBase bindingMember string + textProperty *Property } func NewLabel(parent Container) (*Label, error) { @@ -23,6 +24,18 @@ func NewLabel(parent Container) (*Label, error) { return nil, err } + l.textProperty = NewProperty( + "Text", + func() interface{} { + return l.Text() + }, + func(v interface{}) error { + return l.SetText(v.(string)) + }, + nil) + + l.MustRegisterProperties(l.textProperty) + return l, nil } |