Sophie

Sophie

distrib > Fedora > 14 > x86_64 > media > updates > by-pkgid > 677c1b5134368504c2e447757584d19e > files > 563

ghc-gtk-devel-0.11.2-5.fc14.i686.rpm

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
	button `onClicked` putStrLn "button pressed!"
	window `onDestroy` mainQuit
	
	-- Display the window
	widgetShowAll window
	mainGUI