Hets - the Heterogeneous Tool Set

Copyright(c) Thiemo Wiedemeyer, Uni Bremen 2008
LicenseGPLv2 or higher, see LICENSE.txt
Maintainerraider@informatik.uni-bremen.de
Stabilityprovisional
Portabilitynon-portable
Safe HaskellNone

GUI.GtkUtils

Contents

Description

This module provides the ability to store xml stings in a temporary file to load it with gtk2hs. This is needed, because gtk2hs needs glade files for input, but we want to distribute them within the binary.

Synopsis

Documentation

getGladeXML :: (String, String) -> IO GladeXML

Returns a GladeXML Object of a xmlstring.

startMainLoop :: IO ()

Starts the gtk main event loop in a thread

forkIO_ :: IO () -> IO ()

forkIOWithPostProcessing :: IO a -> (a -> IO ()) -> IO ()

Windows for use inside Gtk thread

infoDialog

Arguments

:: String

Title

-> String

Message

-> IO () 

create a window which displays a given text

errorDialog

Arguments

:: String

Title

-> String

Message

-> IO () 

create a window which displays a given error

warningDialog

Arguments

:: String

Title

-> String

Message

-> IO Bool 

create a window which displays a given warning and ask for continue

questionDialog

Arguments

:: String

Title

-> String

Message

-> IO Bool 

create a window which displays a given question

fileOpenDialog

Arguments

:: FilePath

Defaultname for file

-> [(String, [String])]

Filter (name, pattern list)

-> Maybe (FilePath -> IO ())

Action on open

-> IO (Maybe FilePath) 

fileSaveDialog

Arguments

:: FilePath

Defaultname for file

-> [(String, [String])]

Filter (name, pattern list)

-> Maybe (FilePath -> IO ())

Action on save

-> IO (Maybe FilePath) 

listChoiceAux

Arguments

:: String

Title

-> (a -> String)

Name of element

-> [a]

Rows to display

-> IO (Maybe (Int, a))

Selected row

create a window with title and list of options, return selected option

listChoice

Arguments

:: String

Title

-> [String]

Rows to display

-> IO (Maybe Int)

Selected row

create a window with title and list of options, return selected option

progressBar

Arguments

:: String

Title

-> String

Description

-> IO (Double -> String -> IO (), IO ()) 

pulseBar

Arguments

:: String

Title

-> String

Description

-> IO (String -> IO (), IO ()) 

textView

Arguments

:: String

Title

-> String

Message

-> Maybe FilePath

Filename

-> IO () 

Display text in an uneditable, scrollable editor. Not blocking!

displayTheoryWithWarning

Arguments

:: String

Kind of theory

-> String

Name of theory

-> String

Warning

-> G_theory

Theory

-> IO () 

displays a theory with warning in a window

Windows for use in Gtk windows

infoDialogExt

Arguments

:: String

Title

-> String

Message

-> IO () 

create a window which displays a given text

errorDialogExt

Arguments

:: String

Title

-> String

Message

-> IO () 

create a window which displays a given error

warningDialogExt

Arguments

:: String

Title

-> String

Message

-> IO Bool 

create a window which displays a given warning and ask for continue

questionDialogExt

Arguments

:: String

Title

-> String

Message

-> IO Bool 

create a window which displays a given question

fileOpenDialogExt

Arguments

:: FilePath

Defaultname for file

-> [(String, [String])]

Filter (name, pattern list)

-> Maybe (FilePath -> IO ())

Action on open

-> IO (Maybe FilePath) 

fileSaveDialogExt

Arguments

:: FilePath

Defaultname for file

-> [(String, [String])]

Filter (name, pattern list)

-> Maybe (FilePath -> IO ())

Action on save

-> IO (Maybe FilePath) 

listChoiceExt

Arguments

:: String

Title

-> [String]

Rows to display

-> IO (Maybe Int)

Selected row

create a window with title and list of options, return selected option

progressBarExt

Arguments

:: String

Title

-> String

Description

-> IO (Double -> String -> IO (), IO ()) 

pulseBarExt

Arguments

:: String

Title

-> String

Description

-> IO (String -> IO (), IO ()) 

textViewExt

Arguments

:: String

Title

-> String

Message

-> Maybe FilePath

Filename

-> IO () 

Display text in an uneditable, scrollable editor. Not blocking!

displayTheoryWithWarningExt

Arguments

:: String

Kind of theory

-> String

Name of theory

-> String

Warning

-> G_theory

Theory

-> IO () 

displays a theory with warning in a window

Frequently used functions inside Gtk thread

setListData :: TreeView -> (a -> String) -> [a] -> IO (ListStore a)

Sets data of list

updateListData :: ListStore a -> [a] -> IO ()

Updates data of list

setListSelectorSingle :: TreeView -> IO () -> IO (ConnectId TreeSelection)

Setup list with single selection

setListSelectorMultiple :: TreeView -> Button -> Button -> Button -> IO () -> IO (ConnectId TreeSelection)

Setup list with multiple selection

selectFirst :: TreeView -> IO ()

Selects the first item if possible

getSelectedSingle :: TreeView -> ListStore a -> IO (Maybe (Int, a))

Get selected item

getSelectedMultiple :: TreeView -> ListStore a -> IO [(Int, a)]

Get selected items and row number

selectAllRows :: TreeView -> IO ()

Select all rows

activate :: [Widget] -> Bool -> IO ()

Activates or deactivates a list of widgets