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

Attachment: pgpZDHWCO0Z51.pgp
Description: OpenPGP digital signature

Reply via email to