Gtk2HsContentsIndex
Graphics.UI.Gtk.General.General
Portabilityportable (depends on GHC)
Stabilityprovisional
Maintainergtk2hs-users@lists.sourceforge.net
Description

TODO

  • quitAddDestroy, quitAdd, quitRemove, inputAdd, inputRemove
Synopsis
initGUI :: IO [String]
eventsPending :: IO Int
mainGUI :: IO ()
mainLevel :: IO Int
mainQuit :: IO ()
mainIteration :: IO Bool
mainIterationDo :: Bool -> IO Bool
grabAdd :: WidgetClass wd => wd -> IO ()
grabGetCurrent :: IO (Maybe Widget)
grabRemove :: WidgetClass w => w -> IO ()
priorityLow :: Int
priorityDefaultIdle :: Int
priorityHighIdle :: Int
priorityDefault :: Int
priorityHigh :: Int
timeoutAdd :: IO Bool -> Int -> IO HandlerId
timeoutAddFull :: IO Bool -> Int -> Int -> IO HandlerId
timeoutRemove :: HandlerId -> IO ()
idleAdd :: IO Bool -> Int -> IO HandlerId
idleRemove :: HandlerId -> IO ()
type HandlerId = CUInt
Documentation
initGUI :: IO [String]

Initialize the GUI binding.

  • This function initialized the GUI toolkit and parses all Gtk specific arguments. The remaining arguments are returned. If the initialization of the toolkit fails for whatever reason, an exception is thrown.
  • Throws: ErrorCall Cannot initialize GUI.
eventsPending :: IO Int
Inquire the number of events pending on the event queue
mainGUI :: IO ()
Run GTK+'s main event loop.
mainLevel :: IO Int

Inquire the main loop level.

  • Callbacks that take more time to process can call loopIteration to keep the GUI responsive. Each time the main loop is restarted this way, the main loop counter is increased. This function returns this counter.
mainQuit :: IO ()
Exit the main event loop.
mainIteration :: IO Bool

Process an event, block if necessary.

  • Returns True if the loopQuit was called while processing the event.
mainIterationDo :: Bool -> IO Bool

Process a single event.

  • Called with True, this function behaves as loopIteration in that it waits until an event is available for processing. The function will return immediately, if passed False.
  • Returns True if the loopQuit was called while processing the event.
grabAdd :: WidgetClass wd => wd -> IO ()
add a grab widget
grabGetCurrent :: IO (Maybe Widget)
inquire current grab widget
grabRemove :: WidgetClass w => w -> IO ()
remove a grab widget
priorityLow :: Int
priorityDefaultIdle :: Int
priorityHighIdle :: Int
priorityDefault :: Int
priorityHigh :: Int
For installing idle callbacks: Priorities.
timeoutAdd :: IO Bool -> Int -> IO HandlerId

Sets a function to be called at regular intervals, with the default priority priorityDefault. The function is called repeatedly until it returns False, after which point the timeout function will not be called again. The first call to the function will be at the end of the first interval.

Note that timeout functions may be delayed, due to the processing of other event sources. Thus they should not be relied on for precise timing. After each call to the timeout function, the time of the next timeout is recalculated based on the current time and the given interval (it does not try to 'catch up' time lost in delays).

timeoutAddFull :: IO Bool -> Int -> Int -> IO HandlerId

Sets a function to be called at regular intervals, with the given priority. The function is called repeatedly until it returns False, after which point the timeout function will not be called again. The first call to the function will be at the end of the first interval.

Note that timeout functions may be delayed, due to the processing of other event sources. Thus they should not be relied on for precise timing. After each call to the timeout function, the time of the next timeout is recalculated based on the current time and the given interval (it does not try to 'catch up' time lost in delays).

timeoutRemove :: HandlerId -> IO ()
Remove a previously added timeout handler by its TimeoutId.
idleAdd :: IO Bool -> Int -> IO HandlerId

Add a callback that is called whenever the system is idle.

  • A priority can be specified via an integer. This should usually be priorityDefaultIdle.
  • If the function returns False it will be removed.
idleRemove :: HandlerId -> IO ()
Remove a previously added idle handler by its TimeoutId.
type HandlerId = CUInt
Produced by Haddock version 0.7