Source codeContentsIndex
Core
Contents
submodules
tool instance
Widget configuration
enabling / disabling of widgets
GUIObjects and methods (internal representation of Tk-Widgets)
events
Tk variables
Synopsis
data Wish = Wish {
commands :: (Channel TclScript)
wishLock :: BSem
eventQueue :: (EqGuardedChannel BindTag EventInfo)
coQueue :: (EqGuardedChannel CallBackId ())
bindTags :: (MVar BindTag)
readWish :: (GuardedEvent (EqMatch TclMessageType) (TclMessageType, String))
writeWish :: (CStringLen -> IO ())
destroyWish :: (IO ())
bufferedCommands :: (MVar (Int, TclScript))
oID :: ObjectID
}
wish :: Wish
type TclCmd = String
type TclScript = [TclCmd]
data TclMessageType
= OKType
| ERType
| COType
| EVType
execCmd :: TclCmd -> IO ()
evalCmd :: TclCmd -> IO String
execTclScript :: TclScript -> IO ()
evalTclScript :: TclScript -> IO String
execMethod :: (GUIObject a) => a -> (ObjectName -> TclScript) -> IO ()
evalMethod :: (GUIObject a, GUIValue b) => a -> (ObjectName -> TclScript) -> IO b
setTclVariable :: (GUIValue a) => String -> a -> IO ()
getTclVariable :: (GUIValue a) => String -> IO a
module GUIValue
module GUIObjectName
module GUIObjectKind
data GUI = GUI GUIOBJECT (Ref GST)
getGUI :: IO GUI
type ConfigOption = (ConfigID, GUIVALUE)
type ConfigID = String
showConfigs :: [(ConfigID, GUIVALUE)] -> String
showConfig :: (ConfigID, GUIVALUE) -> String
class (GUIObject w) => HasEnable w where
state :: State -> Config w
getState :: w -> IO State
disable :: Config w
enable :: Config w
isEnabled :: w -> IO Bool
data GUIOBJECT
= GUIOBJECT ObjectID (Ref OST)
| ROOT
data OST = OST {
objectkind :: ObjectKind
objectname :: ObjectName
parentobj :: ObjectID
methods :: Methods
}
class GUIObject w where
toGUIObject :: w -> GUIOBJECT
cname :: w -> String
cset :: (GUIValue a) => w -> ConfigID -> a -> IO w
cget :: (GUIValue a) => w -> ConfigID -> IO a
class Object o where
objectID :: o -> ObjectID
newtype ObjectID = ObjectID Int
getObjectNo :: GUIOBJECT -> Int
getParentObjectID :: GUIOBJECT -> IO ObjectID
createGUIObject :: GUIOBJECT -> ObjectKind -> Methods -> IO GUIOBJECT
createHTkObject :: Methods -> IO GUIOBJECT
createWidget :: GUIOBJECT -> ObjectKind -> IO GUIOBJECT
lookupGUIObjectByName :: WidgetName -> IO (Maybe GUIOBJECT)
lookupGUIObject :: ObjectID -> IO GUIOBJECT
getParentPathName :: (GUIObject w) => w -> IO (Maybe ObjectName)
getParentObject :: (GUIObject w) => w -> IO (Maybe GUIOBJECT)
getObjectKind :: GUIOBJECT -> IO ObjectKind
setObjectKind :: GUIOBJECT -> ObjectKind -> IO ()
getObjectName :: GUIOBJECT -> IO ObjectName
setObjectName :: GUIOBJECT -> ObjectName -> IO ()
data Methods = Methods {
cgetCmd :: (ObjectName -> ConfigID -> TclScript)
csetCmd :: (ObjectName -> [ConfigOption] -> TclScript)
createCmd :: (ObjectName -> ObjectKind -> ObjectName -> ObjectID -> [ConfigOption] -> TclScript)
packCmd :: (ObjectName -> [PackOption] -> TclScript)
gridCmd :: (ObjectName -> [GridPackOption] -> TclScript)
destroyCmd :: (ObjectName -> TclScript)
bindCmd :: (ObjectName -> BindTag -> [WishEvent] -> EventInfoSet -> Bool -> TclScript)
unbindCmd :: (ObjectName -> BindTag -> [WishEvent] -> Bool -> TclScript)
cleanupCmd :: (ObjectID -> ObjectName -> TclScript)
}
defMethods :: Methods
voidMethods :: Methods
setMethods :: GUIOBJECT -> Methods -> IO ()
data WishEvent = WishEvent [WishEventModifier] WishEventType
data WishEventType
= Activate
| ButtonPress (Maybe BNo)
| ButtonRelease (Maybe BNo)
| Circulate
| Colormap
| Configure
| Deactivate
| Destroy
| Enter
| Expose
| FocusIn
| FocusOut
| Gravity
| KeyPress (Maybe KeySym)
| KeyRelease (Maybe KeySym)
| Motion
| Leave
| Map
| Property
| Reparent
| Unmap
| Visibility
data WishEventModifier
= Control
| Shift
| Lock
| CommandKey
| Meta
| M
| Alt
| Mod1
| Mod2
| Mod3
| Mod4
| Mod5
| Button1
| Button2
| Button3
| Button4
| Button5
| Double
| Triple
newtype KeySym = KeySym String
bind :: (GUIObject wid) => wid -> [WishEvent] -> IO (Event EventInfo, IO ())
bindSimple :: (GUIObject wid) => wid -> WishEventType -> IO (Event (), IO ())
bindPath :: (Widget wid) => wid -> [WishEvent] -> IO (Event EventInfo, IO ())
bindPathSimple :: (Widget wid) => wid -> WishEventType -> IO (Event (), IO ())
class (GUIObject w) => HasCommand w where
clicked :: w -> IO (Event ())
bindTagS :: BindTag -> String
showP :: (Show a) => a -> String -> String
mkBoundCmdArg :: BindTag -> EventInfoSet -> String
delimitString :: String -> String
data BindTag
data EventInfoSet
tkDeclVar :: String -> String -> TclScript
tkUndeclVar :: String -> TclScript
Documentation
data Wish
Constructors
Wish
commands :: (Channel TclScript)
wishLock :: BSem
eventQueue :: (EqGuardedChannel BindTag EventInfo)
coQueue :: (EqGuardedChannel CallBackId ())
bindTags :: (MVar BindTag)
readWish :: (GuardedEvent (EqMatch TclMessageType) (TclMessageType, String))
writeWish :: (CStringLen -> IO ())
destroyWish :: (IO ())
bufferedCommands :: (MVar (Int, TclScript))
oID :: ObjectID
Instances
Object Wish
Destroyable Wish
wish :: Wish
type TclCmd = String
type TclScript = [TclCmd]
data TclMessageType
Constructors
OKType
ERType
COType
EVType
execCmd :: TclCmd -> IO ()
execCmd is used for commands which don't expect an answer and calls execTclScript
evalCmd :: TclCmd -> IO String
evalCmd is used for commands which expect an answer, and calls evalTclScript.
execTclScript :: TclScript -> IO ()
Used for commands which do not expect an answer
evalTclScript :: TclScript -> IO String
Used for commands which expect an answer.
execMethod :: (GUIObject a) => a -> (ObjectName -> TclScript) -> IO ()
evalMethod :: (GUIObject a, GUIValue b) => a -> (ObjectName -> TclScript) -> IO b
setTclVariable :: (GUIValue a) => String -> a -> IO ()
getTclVariable :: (GUIValue a) => String -> IO a
submodules
module GUIValue
module GUIObjectName
module GUIObjectKind
tool instance
data GUI
Constructors
GUI GUIOBJECT (Ref GST)
Instances
Object GUI
GUIObject GUI
getGUI :: IO GUI
Widget configuration
type ConfigOption = (ConfigID, GUIVALUE)
type ConfigID = String
showConfigs :: [(ConfigID, GUIVALUE)] -> String
showConfig :: (ConfigID, GUIVALUE) -> String
enabling / disabling of widgets
class (GUIObject w) => HasEnable w where
Stateful objects that can be enabled or disabled instantiate the class HasEnable.
Methods
state :: State -> Config w
Sets the objects state.
getState :: w -> IO State
Gets the objects state.
disable :: Config w
Disables the object.
enable :: Config w
Enables the object.
isEnabled :: w -> IO Bool
True if the object is enabled.
Instances
HasEnable Button
HasEnable Canvas
HasEnable (CheckButton a)
HasEnable (ComboBox a)
HasEnable Editor
HasEnable (Entry a)
HasEnable IconBar
HasEnable (InputForm a)
HasEnable (EntryField a b)
HasEnable (TextField a b)
HasEnable (EnumField a b)
HasEnable (RecordField a b)
HasEnable (ListBox a)
HasEnable MenuButton
HasEnable MenuCascade
HasEnable MenuCheckButton
HasEnable MenuCommand
HasEnable MenuRadioButton
HasEnable (OptionMenu a)
HasEnable (Prompt a)
HasEnable (RadioButton a)
HasEnable (Scale a)
HasEnable ScrollBar
HasEnable SelectBox
HasEnable SpinButton
GUIObjects and methods (internal representation of Tk-Widgets)
data GUIOBJECT
Constructors
GUIOBJECT ObjectID (Ref OST)
ROOT
Instances
GUIObject GUIOBJECT
Eq GUIOBJECT
Ord GUIOBJECT
Object GUIOBJECT
Synchronized GUIOBJECT
HasIndicator GUIOBJECT
data OST
Constructors
OST
objectkind :: ObjectKind
objectname :: ObjectName
parentobj :: ObjectID
methods :: Methods
class GUIObject w where
Methods
toGUIObject :: w -> GUIOBJECT
cname :: w -> String
cset :: (GUIValue a) => w -> ConfigID -> a -> IO w
cget :: (GUIValue a) => w -> ConfigID -> IO a
Instances
GUIObject Arc
GUIObject BitMap
GUIObject BitMapItem
GUIObject Box
GUIObject Button
GUIObject Canvas
GUIObject CanvasTag
GUIObject (CheckButton a)
GUIObject (ComboBox a)
GUIObject GUIOBJECT
GUIObject GUI
GUIObject (Dialog a)
GUIObject Editor
GUIObject EmbeddedCanvasWin
GUIObject EmbeddedTextWin
GUIObject (Entry a)
GUIObject CurrentGrab
GUIObject CurrentFocus
GUIObject Frame
(CItem c) => GUIObject (GenGUI c)
(GBObject o) => GUIObject (GenericBrowser o)
GUIObject HTk
(GUIObject w) => GUIObject (ICursor w)
(Window w) => GUIObject (Icon w)
GUIObject IconBar
GUIObject Image
GUIObject ImageItem
(HasIndicator w) => GUIObject (Indicator w)
GUIObject (InputForm a)
GUIObject (EntryField a b)
GUIObject (TextField a b)
GUIObject (EnumField a b)
GUIObject (RecordField a b)
GUIObject (InputWin a)
GUIObject Label
GUIObject LabelFrame
GUIObject Line
GUIObject (ListBox a)
GUIObject LogWin
GUIObject Menu
GUIObject MenuButton
GUIObject MenuCascade
GUIObject MenuCheckButton
GUIObject MenuCommand
GUIObject MenuRadioButton
GUIObject MenuSeparator
GUIObject Message
GUIObject NoteBook
GUIObject NoteBookPage
GUIObject (NotepadItem a)
GUIObject (Notepad a)
GUIObject (OptionMenu a)
GUIObject Oval
GUIObject AbstractWidget
GUIObject PanedWindow
GUIObject Pane
GUIObject Polygon
GUIObject (Prompt a)
GUIObject (RadioButton a)
GUIObject Rectangle
GUIObject (Scale a)
GUIObject ScrollBar
GUIObject (ScrollBox a)
GUIObject SelectBox
(GUIObject w) => GUIObject (Selection w)
GUIObject Separator
(GUIObject w) => GUIObject (Slider w)
GUIObject Space
GUIObject SpinButton
GUIObject TextItem
GUIObject TextTag
GUIObject Toplevel
(CItem c) => GUIObject (TreeList c)
(CItem a) => GUIObject (TREELISTOBJECT a)
class Object o where
Methods
objectID :: o -> ObjectID
Instances
Object GUI
Object CurrentGrab
Object CurrentFocus
Object GUIOBJECT
Object Wish
newtype ObjectID
Constructors
ObjectID Int
Instances
Show ObjectID
Read ObjectID
getObjectNo :: GUIOBJECT -> Int
getParentObjectID :: GUIOBJECT -> IO ObjectID
createGUIObject :: GUIOBJECT -> ObjectKind -> Methods -> IO GUIOBJECT
createHTkObject :: Methods -> IO GUIOBJECT
createWidget :: GUIOBJECT -> ObjectKind -> IO GUIOBJECT
lookupGUIObjectByName :: WidgetName -> IO (Maybe GUIOBJECT)
lookupGUIObject :: ObjectID -> IO GUIOBJECT
getParentPathName :: (GUIObject w) => w -> IO (Maybe ObjectName)
getParentObject :: (GUIObject w) => w -> IO (Maybe GUIOBJECT)
getObjectKind :: GUIOBJECT -> IO ObjectKind
setObjectKind :: GUIOBJECT -> ObjectKind -> IO ()
getObjectName :: GUIOBJECT -> IO ObjectName
setObjectName :: GUIOBJECT -> ObjectName -> IO ()
data Methods
Constructors
Methods
cgetCmd :: (ObjectName -> ConfigID -> TclScript)
csetCmd :: (ObjectName -> [ConfigOption] -> TclScript)
createCmd :: (ObjectName -> ObjectKind -> ObjectName -> ObjectID -> [ConfigOption] -> TclScript)
packCmd :: (ObjectName -> [PackOption] -> TclScript)
gridCmd :: (ObjectName -> [GridPackOption] -> TclScript)
destroyCmd :: (ObjectName -> TclScript)
bindCmd :: (ObjectName -> BindTag -> [WishEvent] -> EventInfoSet -> Bool -> TclScript)
unbindCmd :: (ObjectName -> BindTag -> [WishEvent] -> Bool -> TclScript)
cleanupCmd :: (ObjectID -> ObjectName -> TclScript)
defMethods :: Methods
voidMethods :: Methods
setMethods :: GUIOBJECT -> Methods -> IO ()
events
data WishEvent
Constructors
WishEvent [WishEventModifier] WishEventType
Instances
Show WishEvent
data WishEventType
Constructors
Activate
ButtonPress (Maybe BNo)
ButtonRelease (Maybe BNo)
Circulate
Colormap
Configure
Deactivate
Destroy
Enter
Expose
FocusIn
FocusOut
Gravity
KeyPress (Maybe KeySym)
KeyRelease (Maybe KeySym)
Motion
Leave
Map
Property
Reparent
Unmap
Visibility
data WishEventModifier
Constructors
Control
Shift
Lock
CommandKey
Meta
M
Alt
Mod1
Mod2
Mod3
Mod4
Mod5
Button1
Button2
Button3
Button4
Button5
Double
Triple
newtype KeySym
Constructors
KeySym String
bind :: (GUIObject wid) => wid -> [WishEvent] -> IO (Event EventInfo, IO ())
Binds an event for this widget. The second action returned unbinds the event.
bindSimple :: (GUIObject wid) => wid -> WishEventType -> IO (Event (), IO ())
Simple version of bind for only one event and without modifiers.
bindPath :: (Widget wid) => wid -> [WishEvent] -> IO (Event EventInfo, IO ())
Binds an event for this widget and its parent widgets. The second action returned unbinds the event.
bindPathSimple :: (Widget wid) => wid -> WishEventType -> IO (Event (), IO ())
Simple version of bindPath for only one event and without modifiers.
class (GUIObject w) => HasCommand w where
Methods
clicked :: w -> IO (Event ())
Instances
HasCommand Button
HasCommand (CheckButton a)
HasCommand MenuButton
HasCommand MenuCheckButton
HasCommand MenuCommand
HasCommand MenuRadioButton
HasCommand (RadioButton a)
bindTagS :: BindTag -> String
showP :: (Show a) => a -> String -> String
mkBoundCmdArg :: BindTag -> EventInfoSet -> String
delimitString :: String -> String
data BindTag
data EventInfoSet
Tk variables
tkDeclVar :: String -> String -> TclScript
tkUndeclVar :: String -> TclScript
Produced by Haddock version 0.3