Re: G-Golf using GtkBuilder or not

David Pirotte <[email protected]> Wed, 28 May 2025 15:36:56 -0300
Newsgroups gmane.lisp.guile.user
Message-ID <20250528153656.7b7b1136@tintin>
Hi Zelphir,

> > I have little experience using gtk builder, upstream developers
> > convinced me to switch to (always) use templates.  

> I wonder why that is though. I imagine (I don't know that for sure at
> all, so some Dunning-Kruger chance here) that internally Gtk probably
> uses the same machinery ...

Not at all. A template is installed at (GObject) class initialization
time, and as a user, since g-golf provides the adequate machinery, you
won't need to call get-object anymore, providing 'you do the write
thing', you'll get access to those widgets as instance slots: just look
at the <adw-demo-window> class definition, and for example, search for
all occurrences of the word stack, or split-view (or any child-id slot
name ... search in the sxml ui file and in the (adw-demo-window)
module, to see how this works ...

> How could I create the GMenu from a UI file instead?

There are quite a few examples in the adwaita-1-demo, one among others
in the pages/buttons/buttons-ui.scm, %sample-menu ...

David
signature.asc (application/pgp-signature, 488 B)
-----BEGIN PGP SIGNATURE-----

iQEzBAEBCgAdFiEEhCJlRZtBM3furJHe83T9k6MFetcFAmg3V8gACgkQ83T9k6MF
etc4twgAz0KIUSPQ0BJIQW5hCf9UZJXvjVBLMdljqEv53Fmk+BngZJm4UXU19jps
E6+SUGclM0laEtffcf39ckfr3u1FNOrdMrIM9BMpJ7vY0GF4w1OxiS1r+ZzZP4Gv
pqVCYnF3zux6tO858w2DaM2An8mXGVsP1JUmi/575j57ZRvi4EsCcSJ/5ePDtoHu
Vk40bXCldbBCs0ENYGh6MJpDCVH0BVOgho8byNLXamLmrGLkpCZY827f1CkTH/pA
C+BlMEm+qTtjzAnrfV9PF6WkfIPJjJzqPB+aKANcmlXmZMyBR/1nrPIhzL6Ib05O
9nNt2vwjfzXJOhLquKWzSqOt0v8WKA==
=s29z
-----END PGP SIGNATURE-----