summaryrefslogtreecommitdiff
path: root/src/Gtk/Tune.icl
blob: d04d691cc8de2a0d63692a036d5f344d46158de5 (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
28
29
30
31
implementation module Gtk.Tune

import StdEnv

import Control.Applicative
import Control.Monad

import Gtk

instance tune elem (oa,ob)       | tune elem oa & tune elem ob
where
	tune (a,b) elem = tune a elem >>= tune b

instance tune elem (oa,ob,oc)    | tune elem oa & tune elem ob & tune elem oc
where
	tune (a,b,c) elem = tune a elem >>= tune b >>= tune c

instance tune elem (oa,ob,oc,od) | tune elem oa & tune elem ob & tune elem oc & tune elem od
where
	tune (a,b,c,d) elem = tune a elem >>= tune b >>= tune c >>= tune d

(<<@) infixl 2 :: !(GtkM elem) !option -> GtkM elem | tune elem option
(<<@) elemf option = elemf >>= tune option

instance tune w GtkMargins | gtkWidget w
where
	tune margins widget = setMargins margins widget

instance tune w GtkCSSClass | gtkWidget w
where
	tune cls widget = addCSSClass cls widget