Haskell LanguageGtk3


Syntax

  • obj <- < widgetName >New -- How widgets (e.g Windows, Buttons, Grids) are created

  • set < widget > [ < attributes > ] -- Set attributes as defined as Attr self in widget documentation (e.g. buttonLabel)

  • on < widget > < event > < IO action > -- Adding an IO action to a widgets Signal self (e.g. buttonActivated)

Remarks

On many Linux distributions, the Haskell Gtk3 library is available as a package in the systems package manager (e.g. libghc-gtk in Ubuntu's APT). However, for some developers it might be preferable to use a tool like stack to manage isolated environments, and have Gtk3 installed via cabal instead of via an global installation by the systems package manager. For this option, gtk2hs-buildtools is required. Run cabal install gtk2hs-buildtools before adding gtk, gtk3 or any other Gtk-based Haskell libraries to your projects build-depends entry in your cabal file.