blob: 5341e9f8a48a27ea50b6491f035713726daed775 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
module test
import StdMaybe
import Control.Applicative
import Control.Monad
import Control.Monad.Identity
import Control.Monad.State
import Gtk
Start w = runGtk app w
where
app =
newWindow "Hello!" Nothing >>= \window ->
installSignalHandler window (DestroyHandler quit) >>|
framed (Label "label") (newPaned Horizontal WideHandle) >>= \(paned,frame) ->
setMargins (margin 8) frame >>|
addToContainer frame window >>|
newTextView >>= \text_view_a ->
newTextView >>= \text_view_b ->
setMargins (margin 3) text_view_a >>|
setMargins (margin 3) text_view_b >>|
packPane1 text_view_a paned Resize NoShrink >>|
packPane2 text_view_b paned Resize NoShrink >>|
insertAtCursor "Hello" (getTextBuffer text_view_a) >>|
insertAtCursor "world!" (getTextBuffer text_view_b)
|