本文整理汇总了Golang中github.com/lxn/walk.LineEdit.SetPasswordMode方法的典型用法代码示例。如果您正苦于以下问题:Golang LineEdit.SetPasswordMode方法的具体用法?Golang LineEdit.SetPasswordMode怎么用?Golang LineEdit.SetPasswordMode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/lxn/walk.LineEdit
的用法示例。
在下文中一共展示了LineEdit.SetPasswordMode方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: main
func main() {
fout, _ := os.Create("dialer.log")
defer fout.Close()
bo := bufio.NewWriter(fout)
defer bo.Flush()
util.INFO.SetOutput(bo)
util.ERROR.SetOutput(bo)
bin, err := ioutil.ReadFile("config.json")
if err == nil {
json.Unmarshal(bin, config)
} else {
util.ERROR.Log(err)
err = nil
}
var usr, pwd *walk.LineEdit
var raddr, rusr, rpwd *walk.LineEdit
var lb, rb *walk.PushButton
var mode *walk.ComboBox
var mw *walk.MainWindow
var db *walk.DataBinder
var laddr, lusr, lpwd *walk.Splitter
go func() {
for mw == nil {
runtime.Gosched()
}
ic, err := walk.NewIconFromResourceId(6)
if err == nil {
// func onLoad() {
db.SetAutoSubmit(true)
mw.SetIcon(ic)
switch config.RouterType {
case "hiwifi":
laddr.SetVisible(true)
lusr.SetVisible(false)
lpwd.SetVisible(true)
case "openwrt":
laddr.SetVisible(true)
lusr.SetVisible(true)
lpwd.SetVisible(true)
case "asus":
laddr.SetVisible(true)
lusr.SetVisible(true)
lpwd.SetVisible(true)
default:
laddr.SetVisible(false)
lusr.SetVisible(false)
lpwd.SetVisible(false)
}
mw.SetSize(walk.Size{0, 0})
// }
}
}()
MainWindow{
AssignTo: &mw,
Title: TITLE,
MinSize: Size{340, 0},
Layout: VBox{},
DataBinder: DataBinder{
AssignTo: &db,
DataSource: config,
},
Children: []Widget{
HSplitter{
Children: []Widget{
Label{Text: "用户名", MaxSize: Size{60, 20}},
LineEdit{Text: Bind("Username"), AssignTo: &usr, MaxSize: Size{0, 20}},
}, MaxSize: Size{0, 20},
},
HSplitter{
Children: []Widget{
Label{Text: "密码", MaxSize: Size{60, 20}},
LineEdit{Text: Bind("Password"), AssignTo: &pwd, MaxSize: Size{0, 20}, PasswordMode: true,
OnMouseDown: func(x, y int, button walk.MouseButton) {
pwd.SetPasswordMode(false)
},
OnMouseUp: func(x, y int, button walk.MouseButton) {
pwd.SetPasswordMode(true)
},
},
}, MaxSize: Size{0, 20},
},
HSplitter{
Children: []Widget{
Label{Text: "模式", MaxSize: Size{60, 20}},
ComboBox{AssignTo: &mode,
Editable: true, Value: Bind("RouterType"),
Model: []string{"local", "10.0.x.x(手动填写)", "openwrt", "hiwifi", "asus"},
MaxSize: Size{0, 20},
OnCurrentIndexChanged: func() {
switch mode.CurrentIndex() {
case 2: //"openwrt":
laddr.SetVisible(true)
lusr.SetVisible(true)
lpwd.SetVisible(true)
case 3: //"hiwifi":
config.RouterAddr = "192.168.199.1"
laddr.SetVisible(true)
lusr.SetVisible(false)
//.........这里部分代码省略.........