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
}
func newTextField() *textfield {
func finishNewTextField(id C.id) *textfield {
t := &textfield{
_id: C.newTextField(),
_id: id,
changed: newEvent(),
}
C.textfieldSetDelegate(t._id, unsafe.Pointer(t))
return t
}
func newTextField() *textfield {
return finishNewTextField(C.newTextField()
}
func newPasswordField() *textfield {
return &textfield{
_id: C.newPasswordField(),
}
return finishNewTextField(C.newPasswordField())
}
func (t *textfield) Text() string {