File: GtkBuilderTest.hs

package info (click to toggle)
haskell-gtk 0.15.7-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,964 kB
  • sloc: haskell: 3,346; ansic: 826; makefile: 161
file content (22 lines) | stat: -rw-r--r-- 591 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
module Main where

import Graphics.UI.Gtk

main = do
        initGUI

        -- Create the builder, and load the UI file
        builder <- builderNew
        builderAddFromFile builder "simple.ui"

        -- Retrieve some objects from the UI
        window <- builderGetObject builder castToWindow "window1"
        button <- builderGetObject builder castToButton "button1"

        -- Basic user interation
        on button buttonActivated $ putStrLn "button pressed!"
        on window objectDestroy mainQuit

        -- Display the window
        widgetShowAll window
        mainGUI