本文整理汇总了Golang中github.com/lxn/walk.PushButton.Text方法的典型用法代码示例。如果您正苦于以下问题:Golang PushButton.Text方法的具体用法?Golang PushButton.Text怎么用?Golang PushButton.Text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类github.com/lxn/walk.PushButton
的用法示例。
在下文中一共展示了PushButton.Text方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Golang代码示例。
示例1: main
func main() {
mw := new(MyMainWindow)
var openButton *walk.PushButton
var hostEdit, destEdit, portEdit *walk.LineEdit
var logTextEdit *walk.TextEdit
closeMessage := make(chan int)
MainWindow{
AssignTo: &mw.MainWindow,
Title: "SCREAMO",
MinSize: Size{600, 400},
Layout: VBox{},
Children: []Widget{
Composite{
Layout: Grid{},
Children: []Widget{
Label{
Row: 0,
Column: 0,
Text: "JmsHost:",
},
LineEdit{
AssignTo: &hostEdit,
Row: 0,
Column: 1,
Text: "192.168.1.105",
},
Label{
Row: 1,
Column: 0,
Text: "JmsDest:",
},
LineEdit{
AssignTo: &destEdit,
Row: 1,
Column: 1,
Text: "/topic/IDC.QuoteExchange.bond2app",
},
Label{
Row: 2,
Column: 0,
Text: "JmsPort:",
},
LineEdit{
AssignTo: &portEdit,
Row: 2,
Column: 1,
Text: "61612",
},
},
},
Composite{
Layout: HBox{},
Children: []Widget{
PushButton{
AssignTo: &openButton,
Text: "Open",
OnClicked: func() {
if openButton.Text() == "Open" {
go openstomp(hostEdit.Text(), destEdit.Text(), portEdit.Text(), logTextEdit, closeMessage)
openButton.SetText("Close")
} else {
go stopstomp(closeMessage)
openButton.SetText("Open")
}
},
},
PushButton{
Text: "Clear",
OnClicked: func() {
logTextEdit.SetText("")
},
},
},
},
TextEdit{
AssignTo: &logTextEdit,
MinSize: Size{100, 50},
Text: "",
ReadOnly: true,
},
},
}.Run()
}