Skip to content

path doesn't work with GtkTreeStoreLeaf #102

@IanButterworth

Description

@IanButterworth

Seems like the subtyping is broken?

ERROR: MethodError: no method matching path(::Gtk4.GtkTreeStoreLeaf, ::Gtk4._GtkTreeIter)
The function `path` exists, but no method is defined for this combination of argument types.

Closest candidates are:
  path(::Gtk4.GtkTreeModel, ::Union{Gtk4._GtkTreeIter, Ref{Gtk4._GtkTreeIter}})
   @ Gtk4 ~/.julia/packages/Gtk4/BHOnE/src/tree.jl:453

Stacktrace:
 [1] (::ProfileView.TreeView.var"#build_treeview##56#build_treeview##57"{Gtk4.GtkTreeStoreLeaf, Gtk4.GtkTreeViewLeaf})(controller::Gtk4.GtkEventControllerKeyLeaf, keyval::UInt32, keycode::UInt32, state::Int32)
   @ ProfileView.TreeView ~/Documents/GitHub/ProfileView.jl/src/treeview.jl:279
 [2] (::Gtk4.GLib.var"#GClosureMarshal##0#GClosureMarshal##1"{Ptr{Gtk4.GLib.GValue}, UInt32, Ptr{Gtk4.GLib.GValue}, Vector{Any}, ProfileView.TreeView.var"#build_treeview##56#build_treeview##57"{Gtk4.GtkTreeStoreLeaf, Gtk4.GtkTreeViewLeaf}})()
   @ Gtk4.GLib ~/.julia/packages/Gtk4/BHOnE/src/GLib/signals.jl:63

I had to define my own

_path(treeModel, iter) = Gtk4.GtkTreePath(ccall((:gtk_tree_model_get_path, Gtk4.libgtk4), Ptr{Gtk4.GtkTreePath},
                            (Ptr{Gtk4.GObject}, Ref{Gtk4._GtkTreeIter}),
                            treeModel, iter))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions