Re: First example of g-golf (hello world) not working

David Pirotte <[email protected]> Mon, 5 May 2025 19:08:02 -0300
Newsgroups gmane.lisp.guile.user
Message-ID <20250505190802.2c0ed4e8@tintin>
Hi Zelphir,

> I still had some confusion, as I didn't understand, that the example
> code is run as a script ...

Right, as we (Florian and I) explained in an earlier response to this
thread [1].

> The project I am envisioning relies heavily on a GTKTreeView. Is
> there any example of that anywhere? (I hope it really is
> supported/available in G-Golf!)

Do not use GtkTreView, deprecated in 4.10 and will be removed from
Gtk-5. Instead, carefully read this section (till the very end):

	https://docs.gtk.org/gtk4/section-list-widget.html

> That's another thing I still need to grasp: From where to import what
> and to learn the naming conventions of G-Golf.

You must get (very) familiar with the upstream namespace api you are
using - by that I mean: you should install the GNOME lib doc carefully
read and understand its introduction material, and consult it as you
are developing your app (also carefully read and understand the GOBject
introduction material as well).

The g-golf naming conventions are explained here:

	https://www.gnu.org/software/g-golf/manual/html_node/Naming-Conventions.html

You import from a namespace, and by GI convention, the
gi-import-by-name second arg 'drops' the namespace - see any g-golf
distributed example, in particular adwaita-1-demo  (adw-demo-init)
module.

David

[1]	g-golf guix users - how to run the examples

	guix shell g-golf -D g-golf gtk --no-grafts
	$(guix build g-golf-gtk-4-examples)/share/doc/g-golf/examples/gtk-4/.hello-world-real

	[ *-real are the upstream version of the example

So when working on your own app:

	guix shell g-golf -D g-golf gtk [libadwaita] --no-grafts
	cd your/app-devel/path
	./my-app
signature.asc (application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEhCJlRZtBM3furJHe83T9k6MFetcFAmgZNsIACgkQ83T9k6MF
etddvgf/adyftq9lX9HiiEY7qd6Jc5Eb7lWs8/6/d5OCFRVQ/j4ketCN7o6KERI+
xY/14nT1NF295gpwpYvpGqGdELDqDZJ8fUuOynU1C+6vxwp77mjqh6vkvdRpOFWx
Pq3fiP78slAUfdsbZsRg+AKprDxtQoPBjNnDPAlHf1tWeEry1+tBtTj7jKm6SxcE
sThzYDyk7YyK+Wrp0kMFi2bPXuHsk9Gj68x1wWU2U+VbI3ZeXF7LXUULqvrq7M2a
isESmzGxDl0XoSNnqhac3Bt79cYoJ+RwU5RKJmkkl3SVGNs0bjVt2akMpKjundo7
eZSTA4jTYuOn5RsElOSq5ogWpV4+RQ==
=94jw
-----END PGP SIGNATURE-----