Updated previous commit to work on password fields as well.

This commit is contained in:
Pietro Gagliardi 2014-08-20 15:53:34 -04:00
parent 77ab711705
commit 35e788aa7f
1 changed files with 7 additions and 5 deletions

View File

@ -14,19 +14,21 @@ type textfield struct {
changed *event changed *event
} }
func newTextField() *textfield { func finishNewTextField(id C.id) *textfield {
t := &textfield{ t := &textfield{
_id: C.newTextField(), _id: id,
changed: newEvent(), changed: newEvent(),
} }
C.textfieldSetDelegate(t._id, unsafe.Pointer(t)) C.textfieldSetDelegate(t._id, unsafe.Pointer(t))
return t return t
} }
func newPasswordField() *textfield { func newTextField() *textfield {
return &textfield{ return finishNewTextField(C.newTextField()
_id: C.newPasswordField(),
} }
func newPasswordField() *textfield {
return finishNewTextField(C.newPasswordField())
} }
func (t *textfield) Text() string { func (t *textfield) Text() string {