Diamond

Results 394 comments of Diamond

> Also, by custom window controls I meant that you have minimize and close buttons on your screenshots, where by default GTK4 only has close button (You can change this...

You could either use [`gioutil.ListModel[T]`](https://pkg.go.dev/github.com/diamondburned/gotk4/pkg/core/gioutil#ListModel) to pass in arbitrary Go pointers or [`gtk.StringList`](https://pkg.go.dev/github.com/diamondburned/gotk4/pkg/gtk/v4#StringList) to pass in strings. Each of these list model types have their own functions to get the...

You could see how Dissent does it: https://github.com/diamondburned/dissent/blob/main/internal/sidebar/channels/channels_model.go It still uses the legacy `StringList` model; I haven't had the time to port it over yet. It should be similar either...

If you're using `gioutil.ListModel[T]`, you'd want to use `gioutil.ObjectValue[T](obj)` to get your Go object back. You can get additional type safety by using [`gio.ListModelType[T]`](https://pkg.go.dev/github.com/diamondburned/gotk4/pkg/core/gioutil#ListModelType) which wraps both at once: ```go...

> is there a way to update the rows that contain in the list views What do you mean? Each row in the list view should reflect data from some...

> I updated the value that gets set on the label in my go struct, but I'm unsure how to get the bind to happen again. You will probably have...

(You can consider each item in the `ListModel` immutable: modifying each item separately, even if they're pointers, won't cause the list to actually update until you intentionally set it again.)

> OK, that makes sense. I did see the splice method. Is there an availability to splice with a TreeListModel? You'd splice one of the relevant list models within the...

You'd probably use [`TreeListModel.get_child_row`](https://docs.gtk.org/gtk4/method.TreeListModel.get_child_row.html) for that. Normally, GTK signals should give you the right child row as part of the parameters though.

6cord and cordless are both TUI applications.