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

getGTKBuilder :: (String, String) -> IO Builder Source #

Returns a GladeXML Object of a xmlstring.

startMainLoop :: IO () Source #

Starts the gtk main event loop in a thread

forkIO_ :: IO () -> IO () Source #

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

Windows for use inside Gtk thread

infoDialog Source #

Arguments

:: String

Title

-> String

Message

-> IO () 

create a window which displays a given text

errorDialog Source #

Arguments

:: String

Title

-> String

Message

-> IO () 

create a window which displays a given error

warningDialog Source #

Arguments

:: String

Title

-> String

Message

-> IO Bool 

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

questionDialog Source #

Arguments

:: String

Title

-> String

Message

-> IO Bool 

create a window which displays a given question

fileOpenDialog Source #

Arguments

:: FilePath

Defaultname for file

-> [(String, [String])]

Filter (name, pattern list)

-> Maybe (FilePath -> IO ())

Action on open

-> IO (Maybe FilePath) 

fileSaveDialog Source #

Arguments

:: FilePath

Defaultname for file

-> [(String, [String])]

Filter (name, pattern list)

-> Maybe (FilePath -> IO ())

Action on save

-> IO (Maybe FilePath) 

listChoiceAux Source #

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 Source #

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 Source #

Arguments

:: String

Title

-> String

Description

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

pulseBar Source #

Arguments

:: String

Title

-> String

Description

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

textView Source #

Arguments

:: String

Title

-> String

Message

-> Maybe FilePath

Filename

-> IO () 

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

displayTheoryWithWarning Source #

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 Source #

Arguments

:: String

Title

-> String

Message

-> IO () 

create a window which displays a given text

errorDialogExt Source #

Arguments

:: String

Title

-> String

Message

-> IO () 

create a window which displays a given error

warningDialogExt Source #

Arguments

:: String

Title

-> String

Message

-> IO Bool 

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

questionDialogExt Source #

Arguments

:: String

Title

-> String

Message

-> IO Bool 

create a window which displays a given question

fileOpenDialogExt Source #

Arguments

:: FilePath

Defaultname for file

-> [(String, [String])]

Filter (name, pattern list)

-> Maybe (FilePath -> IO ())

Action on open

-> IO (Maybe FilePath) 

fileSaveDialogExt Source #

Arguments

:: FilePath

Defaultname for file

-> [(String, [String])]

Filter (name, pattern list)

-> Maybe (FilePath -> IO ())

Action on save

-> IO (Maybe FilePath) 

listChoiceExt Source #

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 Source #

Arguments

:: String

Title

-> String

Description

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

pulseBarExt Source #

Arguments

:: String

Title

-> String

Description

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

textViewExt Source #

Arguments

:: String

Title

-> String

Message

-> Maybe FilePath

Filename

-> IO () 

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

displayTheoryWithWarningExt Source #

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) Source #

Sets data of list

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

Updates data of list

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

Setup list with single selection

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

Setup list with multiple selection

selectFirst :: TreeView -> IO () Source #

Selects the first item if possible

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

Get selected item

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

Get selected items and row number

selectAllRows :: TreeView -> IO () Source #

Select all rows

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

Activates or deactivates a list of widgets

escapeGtkMarkup :: String -> String Source #

type ComboBoxText = Text #

toComboBoxText :: Show a => [a] -> [ComboBoxText] Source #