summaryrefslogtreecommitdiff
path: root/lineedit.go
diff options
context:
space:
mode:
Diffstat (limited to 'lineedit.go')
-rw-r--r--lineedit.go18
1 files changed, 14 insertions, 4 deletions
diff --git a/lineedit.go b/lineedit.go
index 61f1cf7..bcb28ac 100644
--- a/lineedit.go
+++ b/lineedit.go
@@ -9,10 +9,11 @@ import (
type LineEdit struct {
// TODO Typing event
- lock sync.Mutex
- created bool
- sysData *sysData
- initText string
+ lock sync.Mutex
+ created bool
+ sysData *sysData
+ initText string
+ password bool
}
// NewLineEdit makes a new LineEdit with the specified text.
@@ -23,6 +24,14 @@ func NewLineEdit(text string) *LineEdit {
}
}
+// NewPasswordEdit makes a new LineEdit which allows the user to enter a password.
+func NewPasswordEdit() *LineEdit {
+ return &LineEdit{
+ sysData: mksysdata(c_lineedit),
+ password: true,
+ }
+}
+
// SetText sets the LineEdit's text.
func (l *LineEdit) SetText(text string) (err error) {
l.lock.Lock()
@@ -50,6 +59,7 @@ func (l *LineEdit) make(window *sysData) error {
l.lock.Lock()
defer l.lock.Unlock()
+ l.sysData.alternate = l.password
err := l.sysData.make(l.initText, window)
if err != nil {
return err