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 /groupbox.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 'groupbox.go')
-rw-r--r-- | groupbox.go | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/groupbox.go b/groupbox.go index a2507794..c7e49b06 100644 --- a/groupbox.go +++ b/groupbox.go @@ -16,8 +16,9 @@ func init() { type GroupBox struct { WidgetBase - hWndGroupBox HWND - composite *Composite + hWndGroupBox HWND + composite *Composite + titleProperty *Property } func NewGroupBox(parent Container) (*GroupBox, error) { @@ -57,6 +58,18 @@ func NewGroupBox(parent Container) (*GroupBox, error) { gb.font = nil gb.SetFont(defaultFont) + gb.titleProperty = NewProperty( + "Title", + func() interface{} { + return gb.Title() + }, + func(v interface{}) error { + return gb.SetTitle(v.(string)) + }, + nil) + + gb.MustRegisterProperties(gb.titleProperty) + succeeded = true return gb, nil |