Comments (2)
You can't create an object like that. gotk4 unfortunately doesn't support subclassing.
You could try to use gioutil.ListModel[T].
from gotk4.
This isn't really an answer, because I'm only currently working with strings, but I'm going through a similar process of trying to get model binding working with the dynamic GTK4 gridviews. In case it's helpful, I've got a version of your code working using a backing gtk.StringList
, rather than the gio.ListStore
:
Rather than calling gio.NewListStore
and then appending an item to it, I create a StringList with:
store := gtk.NewStringList([]string{"Test 1", "Test 2"})
and then the only other relevant change is the data binding, so replacing <lookup name="label">
with <lookup name="string" type="GtkStringObject">
.
After that, I get a view that shows two text labels as expected ("Test 1" and "Test 2").
I'll also need to build a more complex / custom data model, so I'll keep working on this, too.
from gotk4.
Related Issues (20)
- VTE bindings HOT 14
- Add core/glib.PID built-in
- Panic in ListBox.ConnectRowSelected HOT 10
- Error compiling using mingw HOT 6
- Add a definition for GTK_INVALID_LIST_POSITION HOT 2
- GtkListView scroll_to missing HOT 1
- Segmentation fault when calling widget functions inside a goroutine HOT 4
- DragEnd on DragSource not being fired when dragged outside of app HOT 1
- Error when initializing listview with empty list HOT 2
- ConnectCommandLine, how to close remote application? HOT 1
- Missing: Information trees HOT 14
- gtk.Picture memory leak HOT 1
- gioutil.ListModel.Item() not returning concrete Go type anymore HOT 2
- Error Building For Windows HOT 1
- errors when trying to build with GH Actions HOT 3
- PHP Warning: Undefined array key "menudirection" in log HOT 2
- could not determine kind of name for C.g_date_time_new_from_unix_local_usec HOT 3
- Investigate new `unique` package to replace `intern`
- Help Needed: Accessing Child Widget from gtk.FlowBoxChild Causes Panic HOT 1
- gioutil.ListModel memory leak
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.