Gtk2hs invalid signals

61 views Asked by At

I'm running a very simple "hello world" GUI program. (Saved as gui.hs) My code is:

import Graphics.UI.Gtk

main = do
  initGUI
  window <- windowNew
  widgetShowAll window
  onDestroy window mainQuit
  mainGUI  

I compile with: ghc -L/usr/lib gui

It compiles fine, but when I run it I see:

objc[51245]: Class GNotificationCenterDelegate is implemented in both /usr/local/opt/glib/lib/libgio-2.0.0.dylib and /opt/local/lib/libgio-2.0.0.dylib. One of the two will be used. Which one is undefined.

(process:51245): GLib-GObject-WARNING **: gsignal.c:2423: signal 'destroy' is invalid for instance '0x7fe9dc81a0e0' of type '(null)'

The window appears, but it won't quit when I click to close the window. (Window disappears, but the process doesn't terminate.)

This is a very simple example- I've tried making buttons that trigger signals, but I (almost) always get this "signal is invalid" warning.

I'm using Mac OS X El Capitan with GHC 8.4.3 (Haskell platform), and I installed everything following instructions here: (section 2) [https://wiki.haskell.org/Gtk2Hs/Mac]

I am starting to feel like my installation is messed up somehow? Maybe do I need to have installed GHC also with brew? Is there any way I can test the installation (other than trying what I'm already doing)? Are the two runtime warnings related to each other? Thanks for any help!

1

There are 1 answers

0
user2744010 On

Self answer: I fixed this by removing the Haskell Platform and reinstalling GHC with brew. Then all worked fine.