-
Notifications
You must be signed in to change notification settings - Fork 58
/
Layout.hs
28 lines (24 loc) · 1.13 KB
/
Layout.hs
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
28
{-----------------------------------------------------------------------------------------
Layout demo.
-----------------------------------------------------------------------------------------}
module Main where
import Graphics.UI.WX
main :: IO ()
main
= start gui
gui :: IO ()
gui
= do f <- frame [text := "Layout test"]
p <- panel f [] -- panel for color and tab management.
ok <- button p [text := "Ok", on command := close f]
can <- button p [text := "Cancel", on command := infoDialog f "Info" "Pressed 'Cancel'"]
xinput <- textEntry p [text := "100", alignment := AlignRight]
yinput <- textEntry p [text := "100", alignment := AlignRight]
set p [defaultButton := ok]
set f [layout := container p $
margin 10 $
column 5 [boxed "coordinates" (grid 5 5 [[label "x:", hfill $ widget xinput]
,[label "y:", hfill $ widget yinput]])
,floatBottomRight $ row 5 [widget ok,widget can]]
]
return ()