-
Notifications
You must be signed in to change notification settings - Fork 70
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
Cairo Native Interop? #317
Comments
I should add, removing the override from function window:on_draw(__ctx)
local ptr = __ctx._native
local cr = cairo.Context(ptr)
cr:set_source_rgb(0, 0, 0)
cr:paint()
cr:set_source_rgb(1, 1, 1)
cr:rectangle(10, 10, 100, 100)
cr:fill()
return true
end |
Found a workaround for at least this specific issue: local lgi = require("lgi")
local cairo = lgi.cairo
local core = require("lgi.core")
local ctx_ptr = some_C_controlled_call()
local context = core.record.new(cairo.Context,ctx_ptr) And it works! But it also seems like a janky workaround. Feel free to close if this is the best intended method. |
I actually do not have Lua installed anymore and cannot try this myself, but AwesomeWM does the following: Besides that: Dunno. Your guess is as good as mine. |
Taking this as my basic example for lack of better explanation
Is there a proper way of retrieving the actual
cairo.Context
object being used with lgi here, or should a workaround be found?The text was updated successfully, but these errors were encountered: