Comments (5)
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.
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.
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.
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.
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
inpkg/core/glib
.
from gotk4.
Related Issues (20)
- Why go4.org/unsafe/assume-no-moving-gc ? HOT 4
- gir-generate failed to decode gir XML HOT 4
- Gstreamer bindings HOT 17
- Generator Workflow HOT 2
- Unusable GtkBuilderCScope API
- Memory is not freed when destroying Window HOT 1
- `DropTarget` panics when calling the `"drop"` signal handler HOT 10
- Bring back Unref methods
- Switch intern to KarpelesLab/weak
- why build time so slow? HOT 1
- run gtk4/simple get error
- Composite templates HOT 2
- SearchEntry does not appear to implement Editable interface correctly HOT 3
- Support binding Go objects to GObjects with `GObject.set_qdata`
- How to use GTK 4 GridView with gio.ListStore and gtk.BuilderListItemFactory HOT 2
- pkg-config not working from cgo in snap HOT 7
- Apply for GNOME Circle HOT 1
- SIGSEGV: segmentation violation when using a go routine inside gtk.DropTarget.Connect HOT 8
- Migrate g_log to log/slog HOT 1
- Custom glib.LogSetWriter HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gotk4.