diff options
author | Joe Crayne <joe@jerkface.net> | 2019-04-08 00:58:18 -0400 |
---|---|---|
committer | Joe Crayne <joe@jerkface.net> | 2019-04-08 00:58:18 -0400 |
commit | 72da18a55e7fdda733c8306398920277ad5b7985 (patch) | |
tree | a67ab3dd2a09bbc2e8ea7ef6c356611d454b85b2 /gix.hs | |
parent | f7120657200b74c555966d17c8a882c15e948280 (diff) |
Lambda2 experiment.
Diffstat (limited to 'gix.hs')
-rw-r--r-- | gix.hs | 32 |
1 files changed, 28 insertions, 4 deletions
@@ -4,8 +4,15 @@ module Main where | |||
4 | 4 | ||
5 | import GI.Gtk as Gtk hiding (main) | 5 | import GI.Gtk as Gtk hiding (main) |
6 | import qualified GI.Gtk as Gtk | 6 | import qualified GI.Gtk as Gtk |
7 | import GI.GObject.Functions | ||
8 | import GI.GObject.Flags | ||
9 | import Data.GI.Base.GType | ||
7 | 10 | ||
8 | import Triangle as R | 11 | import Foreign.Ptr |
12 | |||
13 | -- import Triangle as R | ||
14 | -- import LambdaHello as R | ||
15 | import Lambda2 as R | ||
9 | 16 | ||
10 | 17 | ||
11 | main = do | 18 | main = 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 |