Hello Guile Users!

I am trying to use G-Golf to create a tree view (the thing that looks like a table) and for that purpose to create a GtkListStore instance.

The GTK4 docs at https://docs.gtk.org/gtk4/section-tree-widget.html#creating-a-model tell me, that I need to create the store. A simple list store should be sufficient for my purpose for now. The example code they give is:

~~~~
|GtkListStore*store=gtk_list_store_new(2,G_TYPE_STRING,G_TYPE_BOOLEAN);|
~~~~

I am assuming, that using G-Golf I also need to specify the types of the columns somehow. I've not yet found a G-Golf example for using a TreeView, but I am asuming, that the constructor call is something like:

~~~~
(eval-when (expand load eval)
  (use-modules (oop goops))

  (default-duplicate-binding-handler
    '(merge-generics replace warn-override-core warn last))

  (use-modules (g-golf))

  (g-irepository-require "Gtk" #:version "4.0")
  (for-each (λ (name) (gi-import-by-name "Gtk" name))
            '(...
              "ListStore")))

(define my-list-store (make <gtk-list-store> 2 G_TYPE_STRING, G_TYPE_BOOLEAN))
~~~~

The import of "ListStore" seems to work fine, does not produce an error at least. But "G_TYPE_STRING" and "G_TYPE_BOOLEAN" are missing, unbound identifiers. https://www.gnu.org/software/g-golf/manual/html_node/Naming-Conventions.html does not list such things. Maybe under Enums, Flags and boxed types, but I am not sure. And running something like:

~~~~
(gi-import-by-name "Gtk" "G_TYPE_STRING")
~~~~

did not work either. I am thinking that is, because those things are not defined in GTK, but elsewhere.

(1) Is my constructor call correct? Do I need to pass those type indicators? I guess so, because how else is the underlying GTK going to get that info?

(2) How to import the "type indicators"?

Best regards,
Zelphir

--
repositories:https://notabug.org/ZelphirKaltstahl,https://codeberg.org/ZelphirKaltstahl

Reply via email to