func (mw *MyMainWindow) showDialogAction_Triggered() { dlg := new(MyDialog) var acceptPB *walk.PushButton var le1, le2 *walk.LineEdit widgets := []Widget{ Label{Row: 0, Column: 0, Text: "A LineEdit:"}, LineEdit{Row: 0, Column: 1, AssignTo: &le1, OnTextChanged: func() { le2.SetText(le1.Text()) }}, ToolButton{Row: 0, Column: 2, Text: "..."}, Label{Row: 1, Column: 0, Text: "Another LineEdit:"}, LineEdit{Row: 1, Column: 1, AssignTo: &le2}, Label{Row: 2, Column: 0, Text: "A ComboBox:"}, ComboBox{Row: 2, Column: 1}, VSpacer{Row: 3, Column: 0, Size: 10}, Label{Row: 4, Column: 0, ColumnSpan: 2, Text: "A TextEdit:"}, TextEdit{Row: 5, Column: 0, ColumnSpan: 2}, } dd := &DialogDecl{ Title: "My Dialog", Owner: mw, Dialog: &dlg.Dialog, AcceptPB: &acceptPB, Widgets: widgets, MinSize: Size{400, 300}, } if err := dd.Create(); err != nil { log.Fatal(err) } acceptPB.Clicked().Attach(func() { dlg.Accept() }) dlg.Run() }