sqweek / dialog

Simple cross-platform dialog API for go-lang
ISC License
509 stars 77 forks source link

MacOS deprecation warnings: setAllowedFileTypes #64

Open frytacz opened 2 years ago

frytacz commented 2 years ago

Hello,

While building app on macos I get warnings specified below:

# github.com/sqweek/dialog/cocoa dlg.m:96:10: warning: 'setAllowedFileTypes:' is deprecated: first deprecated in macOS 12.0 - Use -allowedContentTypes instead [-Wdeprecated-declarations] /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:215:49: note: property 'allowedFileTypes' is declared deprecated here /Library/Developer/CommandLineTools/SDKs/MacOSX12.1.sdk/System/Library/Frameworks/AppKit.framework/Headers/NSSavePanel.h:215:49: note: 'setAllowedFileTypes:' has been explicitly marked deprecated here

App builds itself, however it doesn't work properly.

sqweek commented 2 years ago

OSX has a bunch of loud warnings which it's unclear how to suppress, especially as I care more about compatibility with older OS releases than using whatever API was rolled out this week. See also #24 and #30.

"Doesn't work properly" is not an actionable bug report; check if your symptoms match the known issue #15 otherwise you're gonna have to elaborate.

daryl-williams commented 1 year ago

I am now getting this error, not sure why it started or what it means but my app will not run and exits with: error status 1. Any help would be greatly appreciated. If I can supply any more information please let me know. I am running MacOS 13.2.1 (22D68) on an M1 MacBook Air. My app backend is written in Golang and uses the Wails framework.

Regards,

Daryl

anacrolix commented 1 year ago

I am seeing this issue too. The goroutine is hanging with this trace:

1 @ 0x104fa9be8 0x105432b08 0x105433084 0x105432fb8 0x105432fb9 0x106faecc8 0x106faec91 0x106faec15 0x106facbc4 0x106fb1600 0x104fe09ec 0x105017a74
#   0x105432b07 github.com/sqweek/dialog/cocoa._Cfunc_alertDlg+0x47         _cgo_gotypes.go:148
#   0x105433083 github.com/sqweek/dialog/cocoa.YesNoDlg.(*AlertParams).run.func1+0x53   /Users/anacrolix/go/pkg/mod/github.com/sqweek/dialog@v0.0.0-20220809060634-e981b270ebbf/cocoa/dlg_darwin.go:28
#   0x105432fb7 github.com/sqweek/dialog/cocoa.(*AlertParams).run+0x87          /Users/anacrolix/go/pkg/mod/github.com/sqweek/dialog@v0.0.0-20220809060634-e981b270ebbf/cocoa/dlg_darwin.go:28
#   0x105432fb8 github.com/sqweek/dialog/cocoa.YesNoDlg+0x88                /Users/anacrolix/go/pkg/mod/github.com/sqweek/dialog@v0.0.0-20220809060634-e981b270ebbf/cocoa/dlg_darwin.go:45
#   0x106faecc7 github.com/sqweek/dialog.(*MsgBuilder).yesNo+0x1f17         /Users/anacrolix/go/pkg/mod/github.com/sqweek/dialog@v0.0.0-20220809060634-e981b270ebbf/dlgs_darwin.go:8
#   0x106faec90 github.com/sqweek/dialog.(*MsgBuilder).YesNo+0x1ee0         /Users/anacrolix/go/pkg/mod/github.com/sqweek/dialog@v0.0.0-20220809060634-e981b270ebbf/dlgs.go:51

I don't see any dialog.

sqweek commented 1 year ago

@anacrolix thanks for the report! The hang is unrelated to the deprecation warning (YesNoDlg doesn't use any file types) so I've split it into a separate issue #79