{"action":"opened","issue":{"url":"https://api.github.com/repos/haskell-gi/gi-gtk-examples/issues/3","repository_url":"https://api.github.com/repos/haskell-gi/gi-gtk-examples","labels_url":"https://api.github.com/repos/haskell-gi/gi-gtk-examples/issues/3/labels{/name}","comments_url":"https://api.github.com/repos/haskell-gi/gi-gtk-examples/issues/3/comments","events_url":"https://api.github.com/repos/haskell-gi/gi-gtk-examples/issues/3/events","html_url":"https://github.com/haskell-gi/gi-gtk-examples/issues/3","id":202874523,"number":3,"title":"`gi-gtk-demo-layout` is disabled / out of date","user":{"login":"deepfire","id":452652,"avatar_url":"https://avatars.githubusercontent.com/u/452652?v=3","gravatar_id":"","url":"https://api.github.com/users/deepfire","html_url":"https://github.com/deepfire","followers_url":"https://api.github.com/users/deepfire/followers","following_url":"https://api.github.com/users/deepfire/following{/other_user}","gists_url":"https://api.github.com/users/deepfire/gists{/gist_id}","starred_url":"https://api.github.com/users/deepfire/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deepfire/subscriptions","organizations_url":"https://api.github.com/users/deepfire/orgs","repos_url":"https://api.github.com/users/deepfire/repos","events_url":"https://api.github.com/users/deepfire/events{/privacy}","received_events_url":"https://api.github.com/users/deepfire/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-01-24T16:46:45Z","updated_at":"2017-01-24T16:46:45Z","closed_at":null,"body":"After fixing the trivial symbol jitter issues, like this:\r\n```\r\ndiff --git a/inputmethod/Layout.hs b/inputmethod/Layout.hs\r\nindex 788f435..0df4fa2 100644\r\n--- a/inputmethod/Layout.hs\r\n+++ b/inputmethod/Layout.hs\r\n@@ -24,10 +24,12 @@ import GI.Pango\r\n        (AttrList, Attribute, attrListInsert, attrListNew, Layout,\r\n         layoutSetWidth, layoutNew, layoutSetAttributes, layoutSetText,\r\n         layoutSetWrap)\r\n-import GI.PangoCairo.Functions (showLayout, fontMapGetDefault)\r\n+import GI.Gdk.Structs.Rectangle (getRectangleWidth)\r\n+import GI.Gdk.Structs.EventKey (getEventKeyState, getEventKeyKeyval)\r\n+import GI.PangoCairo.Functions (showLayout)\r\n+import GI.PangoCairo.Interfaces.FontMap (fontMapGetDefault)\r\n import GI.Gdk\r\n-       (keyvalToUnicode, keyvalName, eventKeyReadKeyval,\r\n-        eventKeyReadState, EventKey, rectangleReadWidth)\r\n+       (keyvalToUnicode, keyvalName, EventKey)\r\n import GI.Cairo.Structs.Context (Context(..))\r\n import Foreign.ForeignPtr (withForeignPtr)\r\n import Control.Monad.Trans.Reader (ReaderT(..))\r\n@@ -190,8 +192,8 @@ interpretKeyPress e = do\r\n     where returnJust = return . Just\r\n\r\n shiftAttribute :: Int -> Attribute -> IO Attribute\r\n-shiftAttribute x attr = attr { paStart = x + paStart attr,\r\n-                               paEnd   = x + paEnd attr }\r\n+shiftAttribute x attr = attr -- { paStart = x + paStart attr,\r\n+                             --   paEnd   = x + paEnd attr }\r\n```\r\n..the more complex issue of type ancestry arises:\r\n```\r\n[nix-shell:~/src/gi-gtk-examples]$ cabal build gi-gtk-demo-layout\r\nPreprocessing executable 'gi-gtk-demo-layout' for gi-gtk-examples-0.15.0...\r\n[1 of 1] Compiling Main             ( inputmethod/Layout.hs, dist/build/gi-gtk-demo-layout/gi-gtk-demo-layout-tmp/Main.o )\r\n\r\ninputmethod/Layout.hs:101:10: error:\r\n    • Required ancestor ‘GI.Pango.Objects.Context.Context’ not found for type ‘GI.Pango.Objects.FontMap.FontMap’.\r\n    • In a stmt of a 'do' block: lay <- layoutNew ctxt\r\n      In the expression:\r\n        do { Gtk.init;\r\n             win <- windowNew WindowTypeToplevel;\r\n             onWidgetDestroy win mainQuit;\r\n             area <- drawingAreaNew;\r\n             .... }\r\n      In an equation for ‘main’:\r\n          main\r\n            = do { Gtk.init;\r\n                   win <- windowNew WindowTypeToplevel;\r\n                   onWidgetDestroy win mainQuit;\r\n                   .... }\r\n\r\ninputmethod/Layout.hs:109:19: error:\r\n    • Couldn't match expected type ‘IO a2’\r\n                  with actual type ‘GHC.Int.Int32 -> m2 ()’\r\n    • Probable cause: ‘layoutSetText’ is applied to too few arguments\r\n      In a stmt of a 'do' block: layoutSetText lay (displayBuffer buffer)\r\n      In the expression:\r\n        do { layoutSetText lay (displayBuffer buffer);\r\n             layoutSetAttributes lay [] }\r\n      In a case alternative:\r\n          Nothing\r\n            -> do { layoutSetText lay (displayBuffer buffer);\r\n                    layoutSetAttributes lay [] }\r\n\r\ninputmethod/Layout.hs:110:43: error:\r\n    • Couldn't match expected type ‘Maybe AttrList’\r\n                  with actual type ‘[t1]’\r\n    • In the second argument of ‘layoutSetAttributes’, namely ‘[]’\r\n      In a stmt of a 'do' block: layoutSetAttributes lay []\r\n      In the expression:\r\n        do { layoutSetText lay (displayBuffer buffer);\r\n             layoutSetAttributes lay [] }\r\n\r\ninputmethod/Layout.hs:111:20: error:\r\n    • Couldn't match type ‘GHC.Int.Int32’ with ‘Int’\r\n      Expected type: (T.Text, [[Attribute]], GHC.Int.Int32)\r\n        Actual type: (T.Text, [[Attribute]], Int)\r\n    • In the pattern: (str, attrs, pos)\r\n      In the pattern: Just (str, attrs, pos)\r\n      In a case alternative:\r\n          Just (str, attrs, pos)\r\n            -> do { layoutSetText lay (displayBufferPreedit buffer str pos);\r\n                    attrListNewFromList\r\n                      (map (shiftAttribute (cursor + 1)) (concat attrs))\r\n                    >>= layoutSetAttributes lay }\r\n\r\ninputmethod/Layout.hs:112:19: error:\r\n    • Couldn't match expected type ‘IO a3’\r\n                  with actual type ‘GHC.Int.Int32 -> m3 ()’\r\n    • Probable cause: ‘layoutSetText’ is applied to too few arguments\r\n      In a stmt of a 'do' block:\r\n        layoutSetText lay (displayBufferPreedit buffer str pos)\r\n      In the expression:\r\n        do { layoutSetText lay (displayBufferPreedit buffer str pos);\r\n             attrListNewFromList\r\n               (map (shiftAttribute (cursor + 1)) (concat attrs))\r\n             >>= layoutSetAttributes lay }\r\n      In a case alternative:\r\n          Just (str, attrs, pos)\r\n            -> do { layoutSetText lay (displayBufferPreedit buffer str pos);\r\n                    attrListNewFromList\r\n                      (map (shiftAttribute (cursor + 1)) (concat attrs))\r\n                    >>= layoutSetAttributes lay }\r\n\r\ninputmethod/Layout.hs:113:40: error:\r\n    • Couldn't match type ‘IO Attribute’ with ‘Attribute’\r\n      Expected type: [Attribute]\r\n        Actual type: [IO Attribute]\r\n    • In the first argument of ‘attrListNewFromList’, namely\r\n        ‘(map (shiftAttribute (cursor + 1)) (concat attrs))’\r\n      In the first argument of ‘(>>=)’, namely\r\n        ‘attrListNewFromList\r\n           (map (shiftAttribute (cursor + 1)) (concat attrs))’\r\n      In a stmt of a 'do' block:\r\n        attrListNewFromList\r\n          (map (shiftAttribute (cursor + 1)) (concat attrs))\r\n        >>= layoutSetAttributes lay\r\n\r\ninputmethod/Layout.hs:114:68: error:\r\n    • Couldn't match type ‘AttrList’ with ‘Maybe AttrList’\r\n      Expected type: AttrList -> IO ()\r\n        Actual type: Maybe AttrList -> IO ()\r\n    • In the second argument of ‘(>>=)’, namely\r\n        ‘layoutSetAttributes lay’\r\n      In a stmt of a 'do' block:\r\n        attrListNewFromList\r\n          (map (shiftAttribute (cursor + 1)) (concat attrs))\r\n        >>= layoutSetAttributes lay\r\n      In the expression:\r\n        do { layoutSetText lay (displayBufferPreedit buffer str pos);\r\n             attrListNewFromList\r\n               (map (shiftAttribute (cursor + 1)) (concat attrs))\r\n             >>= layoutSetAttributes lay }\r\n\r\ninputmethod/Layout.hs:121:10: error:\r\n    Variable not in scope:\r\n      rectangleReadWidth\r\n        :: GI.Gdk.Structs.Rectangle.Rectangle -> IO Integer\r\n\r\ninputmethod/Layout.hs:171:5: error:\r\n    • Couldn't match expected type ‘Render ()’\r\n                  with actual type ‘a0 -> m0 ()’\r\n    • Probable cause: ‘showLayout’ is applied to too few arguments\r\n      In a stmt of a 'do' block: showLayout lay\r\n      In the expression:\r\n        do { moveTo 0 0;\r\n             showLayout lay }\r\n      In an equation for ‘updateArea’:\r\n          updateArea area lay\r\n            = do { moveTo 0 0;\r\n                   showLayout lay }\r\n\r\ninputmethod/Layout.hs:171:16: error:\r\n    • Couldn't match expected type ‘Context’ with actual type ‘Layout’\r\n    • In the first argument of ‘showLayout’, namely ‘lay’\r\n      In a stmt of a 'do' block: showLayout lay\r\n      In the expression:\r\n        do { moveTo 0 0;\r\n             showLayout lay }\r\n\r\ninputmethod/Layout.hs:175:18: error:\r\n    Variable not in scope: eventKeyReadState :: EventKey -> IO [t0]\r\n\r\ninputmethod/Layout.hs:177:19: error:\r\n    Variable not in scope: eventKeyReadKeyval :: IO GHC.Word.Word32\r\n\r\ninputmethod/Layout.hs:179:31: error:\r\n    • Couldn't match type ‘GHC.Word.Word32’ with ‘Int’\r\n      Expected type: IO Int\r\n        Actual type: IO GHC.Word.Word32\r\n    • In the second argument of ‘(<$>)’, namely\r\n        ‘keyvalToUnicode keyVal’\r\n      In a stmt of a 'do' block:\r\n        keyChar <- toEnum <$> keyvalToUnicode keyVal\r\n      In the expression:\r\n        do { keyVal <- eventKeyReadKeyval;\r\n             keyName <- keyvalName keyVal;\r\n             keyChar <- toEnum <$> keyvalToUnicode keyVal;\r\n             case keyChar of {\r\n               '\\NUL'\r\n                 -> case keyName of {\r\n                      \"Left\" -> ...\r\n                      \"Right\" -> ...\r\n                      \"BackSpace\" -> ...\r\n                      _ -> ... }\r\n               ch -> do { ... } } }\r\n\r\ninputmethod/Layout.hs:195:25: error:\r\n    • Couldn't match expected type ‘IO Attribute’\r\n                  with actual type ‘Attribute’\r\n    • In the expression: attr\r\n      In an equation for ‘shiftAttribute’: shiftAttribute x attr = attr\r\n```"}}
{"actor":{"display_login":"deepfire"}}