Fix object code
This commit is contained in:
@@ -36,11 +36,11 @@ func NewDialog (kind DialogKind, parent tomo.Window, title, message string, opti
|
||||
|
||||
dialog := &Dialog { }
|
||||
if parent == nil {
|
||||
window, err := tomo.NewWindow(image.Rectangle { })
|
||||
window, err := tomo.NewWindow(tomo.WindowKindNormal, image.Rectangle { })
|
||||
if err != nil { return nil, err }
|
||||
dialog.Window = window
|
||||
} else {
|
||||
window, err := parent.NewModal(image.Rectangle { })
|
||||
window, err := parent.NewChild(tomo.WindowKindModal, image.Rectangle { })
|
||||
if err != nil { return nil, err }
|
||||
dialog.Window = window
|
||||
}
|
||||
@@ -60,7 +60,9 @@ func NewDialog (kind DialogKind, parent tomo.Window, title, message string, opti
|
||||
|
||||
for _, option := range options {
|
||||
if option, ok := option.(clickable); ok {
|
||||
option.OnClick(dialog.Close)
|
||||
option.OnClick(func () {
|
||||
dialog.Close()
|
||||
})
|
||||
}
|
||||
}
|
||||
dialog.controlRow = NewInnerContainer(layouts.ContractHorizontal, options...)
|
||||
|
||||
Reference in New Issue
Block a user