wtk-gtk-0.2: GTK tools within Wojcik Tool Kit

Safe HaskellNone

Graphics.UI.Gtk.WtkGtk

Description

Gtk instantiation of interface between application and GUI.

Synopsis

Documentation

data State a Source

The State. It contains all details that have to passed around to manage properly Gtk UI and of course users state.

Constructors

St 

Fields

ntbk :: Notebook

Notebook. All the GUI is embeded in a notebook.

titleN :: String

Notebook's title

usrSt :: a

User's state

bs :: [(Int, Button, ConnectId Button)]

Page number and its closing button and closing signal

inputPg :: Int -> IORef (State a) -> IO (VBox, [WidgetsCollection])

Function showing input page. Id of widget with focus, state are input. vbox to be shown and list of widgets to set focus are output.

newUsrSt :: String -> Int -> a -> a

Gives new, user defined state, having new entry of a widget.

idFocus :: Int

id of widget with focus

debug :: Bool

set, displays lots of debug info

data WidgetsCollection Source

Serialization of inputable widgets for focus purposes. To be used in the function showing input page for producing proper output.

Constructors

CSL (Int, ComboBox) 
CEn (Int, Entry) 
CBu (Int, Button) 
CCB (Int, CheckButton) 
Dummy 

initStateSource

Arguments

:: Notebook

Gtk's 'Notebook

-> String

Notebook's title

-> a

Initialized user's state

-> (Int -> IORef (State a) -> IO (VBox, [WidgetsCollection]))

Input page creation

-> (String -> Int -> a -> a)

User state change

-> Bool

Debug on/off

-> IO (IORef (State a)) 

State initializaion

logSt :: Bool -> String -> IO ()Source

Displays debuging detail if switched on

newTable :: BoxClass self => String -> self -> Int -> Int -> IO TableSource

Packs a new table into a new frame, the frame into given box and returns table. Gets label for the frame, box and size of the new table.

newOutputPageSource

Arguments

:: String

Title of page

-> VBox

Content

-> IORef (State a)

State

-> IO () 

Renders text output page on the notebook with closing button on the tab.

newOutputTextSource

Arguments

:: String

Title of page

-> String

Content

-> IORef (State a)

State

-> IO () 

Renders text output page on the notebook with closing button on the tab.

showSelectionSource

Arguments

:: TableClass self 
=> InputField

Selection constructor

-> Int

left coordinate

-> Int

up coordinate

-> Int

id of active widget

-> self

table to attach

-> IORef (State a)

user state

-> IO ComboBox 

Shows combo box and sets its attributes according to input. Attaches new selection list to the given table.

showEntrySource

Arguments

:: TableClass self 
=> InputField

Data and attributes

-> Int

Left coordinate

-> Int

Top coordinate

-> Int

Id of active widget

-> self

Table to attach to

-> IORef (State a)

The state

-> IO Entry 

Entry field is rendered and attached to the given table.

showButtonSource

Arguments

:: (TableClass self, ButtonClass b) 
=> InputField

Attributes

-> Int

Left coordinate

-> Int

Top coordinate

-> Int

Id of active widget

-> self

Table to attach to

-> IORef (State a1)

The state

-> b

Button to attach

-> (IORef (State a1) -> IO a)

Action attached to the button

-> IO b 

Attaches given buttun to the given table with action and attributes.

showCheckBoxSource

Arguments

:: TableClass self 
=> InputField

CheckBox constructor

-> Int

Left coordinate

-> Int

top coordinate

-> Int

id of active widget

-> self

table to attach to

-> IORef (State a)

The state

-> IO CheckButton 

Renders and attaches new check button to the given table.

reShowPage :: Int -> IORef (State a) -> IO BoolSource

Re-shows the page.