Giter Site home page Giter Site logo

Comments (5)

diamondburned avatar diamondburned commented on May 24, 2024

I'm not sure; I'm not very familiar with the Builder API. Perhaps you'd want to grab each object and attach a signal to them manually?

There is an internal mechanism to allow storing Go data inside any GObject, which can be useful here, but it's not exposed at the moment. If that eases using Builder, I can consider exposing it for the user.

from gotk4.

webracer999 avatar webracer999 commented on May 24, 2024

Yes, manual connecting works.

Like

obj := builder.GetObject("about_button")
obj.Connect("clicked", onAboutButtonClicked)

But it's not as nice as if I can see the handler in the xml file.

I found something about this topic in gnome forum: https://discourse.gnome.org/t/gtk-4-how-to-replace-gtk-builder-connect-signals/3561/3
It says that the language binding needs to implement GtkBuilderScope interface in an ancillary object. (And also some detailed info.)
Does that mean anything to you?

from gotk4.

diamondburned avatar diamondburned commented on May 24, 2024

gotk4 doesn't have the right code to create custom objects that implement GLib
interfaces yet, so that won't work.

GLib interfaces are horribly painful to implement without the caked-up C macro
monstrosity, so it might take me at least half a year of fiddling around before
I can even get a working prototype.

from gotk4.

webracer999 avatar webracer999 commented on May 24, 2024

OK I understand, it's a lot of work.
So it's out of scope now - it's ok!

Thank you for checking!

from gotk4.

diamondburned avatar diamondburned commented on May 24, 2024

I'm reposting this comment that I accidentally made on gotk3/gotk3, thinking
it's gotk4:

This seems valid. If you ever want to PR this directly into the library, you can open one for adding a new function NewSignal in pkg/core/glib.

from gotk4.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.