Fix object code

This commit is contained in:
2024-09-12 02:34:28 -04:00
parent dca3880a87
commit c2245ec304
7 changed files with 31 additions and 26 deletions

View File

@@ -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...)