summaryrefslogtreecommitdiff
path: root/gix.hs
diff options
context:
space:
mode:
authorJoe Crayne <joe@jerkface.net>2019-04-08 00:58:18 -0400
committerJoe Crayne <joe@jerkface.net>2019-04-08 00:58:18 -0400
commit72da18a55e7fdda733c8306398920277ad5b7985 (patch)
treea67ab3dd2a09bbc2e8ea7ef6c356611d454b85b2 /gix.hs
parentf7120657200b74c555966d17c8a882c15e948280 (diff)
Lambda2 experiment.
Diffstat (limited to 'gix.hs')
-rw-r--r--gix.hs32
1 files changed, 28 insertions, 4 deletions
diff --git a/gix.hs b/gix.hs
index 4d2fb18..2dd753a 100644
--- a/gix.hs
+++ b/gix.hs
@@ -4,8 +4,15 @@ module Main where
4 4
5import GI.Gtk as Gtk hiding (main) 5import GI.Gtk as Gtk hiding (main)
6import qualified GI.Gtk as Gtk 6import qualified GI.Gtk as Gtk
7import GI.GObject.Functions
8import GI.GObject.Flags
9import Data.GI.Base.GType
7 10
8import Triangle as R 11import Foreign.Ptr
12
13-- import Triangle as R
14-- import LambdaHello as R
15import Lambda2 as R
9 16
10 17
11main = do 18main = do
@@ -14,9 +21,26 @@ main = do
14 let mkChild = do 21 let mkChild = do
15 gl <- gLAreaNew 22 gl <- gLAreaNew
16 st <- R.initState 23 st <- R.initState
17 _ <- on gl #realize $ R.realize st gl 24 _ <- on gl #realize $ R.realize st gl
18 _ <- on gl #unrealize $ R.unrealize st gl 25 _ <- on gl #unrealize $ R.unrealize st gl
19 _ <- on gl #render $ R.render st gl 26 _ <- on gl #render $ R.render st gl
27 typ <- gobjectType gl
28 ccSig <- signalLookup "create-context" typ
29 ccid <- signalHandlerFind gl [SignalMatchTypeId] ccSig
30 0 -- detail
31 Nothing -- closure
32 nullPtr -- func
33 nullPtr -- data
34 ccqry <- signalQuery (fromIntegral ccid)
35 print (gtypeToCGType typ,ccSig,ccid {-, ccqry -}) -- (66419360,233,0)
36 _ <- on gl #createContext $ R.createContext st gl
37 ccid <- signalHandlerFind gl [SignalMatchTypeId] ccSig
38 0 -- detail
39 Nothing -- closure
40 nullPtr -- func
41 nullPtr -- data
42 print (gtypeToCGType typ,ccSig,ccid {-, ccqry -}) -- (77669760,233,47)
43 -- signalHandlerDisconnect gl ccid
20 return gl 44 return gl
21 45
22 window <- do 46 window <- do