summaryrefslogtreecommitdiffstatshomepage
path: root/label.go
diff options
context:
space:
mode:
authorAlexander Neumann <an2048@gmail.com>2012-10-30 15:06:10 +0100
committerAlexander Neumann <an2048@gmail.com>2012-10-30 15:06:10 +0100
commit6920b4874faffbda25bbc7ab11fdcdd03640e958 (patch)
tree10066452accb7ed5c237b5157d3b6d633cc80812 /label.go
parentBegin replacing previous data binding system with a new one based on properties (diff)
downloadwireguard-windows-6920b4874faffbda25bbc7ab11fdcdd03640e958.tar.xz
wireguard-windows-6920b4874faffbda25bbc7ab11fdcdd03640e958.zip
Add some properties to many widgets
Diffstat (limited to 'label.go')
-rw-r--r--label.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/label.go b/label.go
index 9740ec7e..cf7f216c 100644
--- a/label.go
+++ b/label.go
@@ -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
}