owickstrom / gi-gtk-declarative

Declarative GTK+ programming in Haskell
https://owickstrom.github.io/gi-gtk-declarative/
288 stars 35 forks source link

Windows10: FileChooserButton example sends LF to stderr #36

Open mpilgrem opened 5 years ago

mpilgrem commented 5 years ago

I do not know where the problem lies but, on Windows 10, the FileChooserButton example (and only that example) somehow sends LF characters to stderr when the dialog box is first drawn (about 7 or 8 LF characters) and when the buttons are clicked (1 or 2 LF characters).

For example (with the example's dialog box immediately closed once it appears):

>stack exec example -- FileChooserButton 2> temp.txt
>notepad++ temp.txt

yields: image

(This is with the package up to commit 1e968131bdef3639f4b570e0c4a21ceac8ef4797 and built with resolver nightly-2018-12-17 (GHC 8.6.2)).

mpilgrem commented 5 years ago

On Windows 10, I get the same behaviour with resolver lts-13.0 (GHC 8.6.3).

On macOS High Sierra 10.13.6, I do not get the LF character behaviour. (However, when I first click the file chooser button, I get the terminal message "objc[23708]: Class FIFinderSyncExtensionHost is implemented in both /System/Library/PrivateFrameworks/FinderKit.framework/Versions/A/FinderKit (0x7fffb03bacd0) and /System/Library/PrivateFrameworks/FileProvider.framework/OverrideBundles/FinderSyncCollaborationFileProviderOverride.bundle/Contents/MacOS/FinderSyncCollaborationFileProviderOverride (0x108d1bcd8). One of the two will be used. Which one is undefined." Google searches indicate that is an 'Apple problem'.)

owickstrom commented 5 years ago

This is quite strange. Is it only for this example?

Could you maybe try building something using the FileChooserNative widget and see if it behaves the same? See https://hackage.haskell.org/package/gi-gtk-3.0.27/docs/GI-Gtk-Objects-FileChooserNative.html. Not sure that fits well into gi-gtk-declarative at the moment, but you could maybe modify the CSS example and create imperatively in main.

Thanks!