Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Where is the cairo example? #393

Open
kindaro opened this issue Dec 8, 2022 · 2 comments
Open

Where is the cairo example? #393

kindaro opened this issue Dec 8, 2022 · 2 comments

Comments

@kindaro
Copy link

kindaro commented Dec 8, 2022

My task is to open a window, draw some diagrams with Chart and interact with a human. Chart-cairo provides a function runBackend that creates a cairo Render. I was looking for a way to render that Render.

There was a cairo example. It is referred to from https://github.com/haskell-gi/haskell-gi/wiki/Using-Cairo-with-haskell-gi-generated-bindings. However, it seems to have been removed in commit c844d5f. The missing example seems to have been doing what I need. The function of interest is renderWithContext ∷ GI.Cairo.Context → Render () → IO ().

There is also an issue timbod7/haskell-chart#241 that offers renderToGI ∷ C.Render a → GI.Render a. However, this issue does not offer a complete example either.

Can documentation for this use case be updated with a working and supported example?

@garetxe
Copy link
Collaborator

garetxe commented Feb 19, 2023

Thanks for the report, and sorry for the delay in replying.

I think that the example would still build, but the handwritten Haskell binding to cairo (the cairo package, not gi-cairo) does not build for me any more, so the example does not compile any more because of this.

The error I get is

src/Gtk2HsSetup.hs:(297,20)-(304,1): Missing field in record construction ppOrdering

I suspect this is probably not very hard to fix, but I haven't had time to look into it. I am happy to reinstate the cairo example once the cairo package is fixed.

@int-index
Copy link

int-index commented Jan 4, 2024

Consider using https://github.com/cohomology/gi-cairo-render, it solves the issue for me. There's an example there, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants