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

Can we provide a constructor for XlibSurface? #278

Open
stuaxo opened this issue Sep 15, 2022 · 1 comment
Open

Can we provide a constructor for XlibSurface? #278

stuaxo opened this issue Sep 15, 2022 · 1 comment

Comments

@stuaxo
Copy link
Collaborator

stuaxo commented Sep 15, 2022

I found this comment, which looks like it's out of date -

XlibSurface cannot be instantiated directly because Python interaction with Xlib would require open source Python bindings to Xlib which provided a C API. However, an XlibSurface instance can be returned from a function call when using pygtk http://www.pygtk.org/.

interaction with Xlib would require open source Python bindings to Xlib

python-xlib is an LGPL python binding with a current version (0.3, released Jul 02, 2021), which looks like a good fit.
(It also has an examples directory which helps to get started).

@rjopek also has some C based xlib + cairo examples here, (placed under public domain):
https://github.com/rjopek/xlib-cairo

We currently block instantiation here:
https://github.com/pygobject/pycairo/blob/master/cairo/surface.c#L2323

Maybe we can allow this ?

The current situation leads to people using workarounds
https://stackoverflow.com/questions/63606306/pycairo-how-to-correctly-instance-cairo-xlibsurface

I can't look any further right now as I'm not on my own computer.

@rjopek
Copy link

rjopek commented Sep 19, 2022

Hi,

The glfw-cairo project is oriented towards testing Cairo's ability to create simple user interfaces. I encourage you to use my examples, will be glad to see these examples in pycairo.

gl_08.c
gl_11.c
gl_13.c

https://harbour.pl/glfw-cairo/

-- Rafał

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

2 participants