Skip to content
This repository has been archived by the owner on Jul 22, 2024. It is now read-only.

boxes.jl this is mistake (GtkTreeRowReference)? #545

Closed
yadmtr opened this issue Dec 26, 2020 · 0 comments
Closed

boxes.jl this is mistake (GtkTreeRowReference)? #545

yadmtr opened this issue Dec 26, 2020 · 0 comments

Comments

@yadmtr
Copy link

yadmtr commented Dec 26, 2020

hi, can anyone explain why in the (boxes.jl) ccall((:gtk_tree_row_reference_copy ... Nothing instead of Ptr{Gtk.GtkTreeRowReference}? in gtk+ doc: GtkTreeRowReference * gtk_tree_row_reference_copy (GtkTreeRowReference *reference); and why return path?

mutable struct GtkTreeRowReference <: GBoxed
    handle::Ptr{GtkTreeRowReference}
    function GtkTreeRowReference(ref::Ptr{GtkTreeRowReference}, own::Bool = false)
        x = new( own ? ref :
            ccall((:gtk_tree_row_reference_copy, Gtk.libgtk), Nothing, (Ptr{GtkTreeRowReference},), ref))
        finalizer(x, x::GtkTreeRowReference->begin
                    ccall((:gtk_tree_row_reference_free, Gtk.libgtk), Nothing, (Ptr{GtkTreeRowReference},), x.handle)
                end)
        path
    end
end

maybe this is more correct

mutable struct GtkTreeRowReference <: GBoxed
    handle::Ptr{GtkTreeRowReference}
    function GtkTreeRowReference(ref::Ptr{GtkTreeRowReference}, own::Bool = false)
        x = new( own ? ref :
            ccall((:gtk_tree_row_reference_copy, Gtk.libgtk), Ptr{GtkTreeRowReference}, (Ptr{GtkTreeRowReference},), ref))
        f = x::GtkTreeRowReference->ccall((:gtk_tree_row_reference_free, Gtk.libgtk), Nothing, (Ptr{GtkTreeRowReference},), x.handle)
        finalizer(f,x)
        x
    end
end
@yadmtr yadmtr changed the title how to use GtkTreeRowReference? boxes.jl this is mistake (GtkTreeRowReference)? Dec 29, 2020
@yadmtr yadmtr closed this as completed Jun 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant