Sender | Message | Time |
---|---|---|
22 Mar 2024 | ||
chfkch | the suggestion is to create a let binding so it will not get dropped, but i cannot figure out how or if this works in this context at all | 13:33:58 |
chfkch | * i have a box, which should have dynamically created children. i tried to use the following
i have omitted some code for readability | 13:35:40 |
chfkch | or would it be wiser in this context to have a custom component/widget and insert it as a child here? since i think i can construct it beforehand with all necessary data? | 13:38:19 |
Aaron Erhardt | Mhh, I don't think this should happen but I have to look at the macro expansion to give you a proper answer. Maybe I'll find time for that this weekend. | 23:03:31 |
23 Mar 2024 | ||
chfkch | https://codeberg.org/Chfkch/bitritter Here is the repository, if you want to see the full code. | 13:17:33 |
24 Mar 2024 | ||
armadillo9425 | When using TypedListView to build a ListView, how do I create a set_sensitive data binding for list items to disable clicking/selecting certain items? The connect_activate lives on ListView level, so while something like root.add_binding(&BoolBinding::new(self.some_boolean), "sensitive"); in the implementation of RelmListItem.bind can give an item the look of being unclickable it doesn't disable the activation event. | 13:28:23 |
chfkch | In the relm book, chapter Continuous Integration, an action actions-rs/toolchain is mentioned, the repository https://github.com/actions-rs is archived. Is this the one the action points at and if yes, is there a successor? Since i am using Codeberg as forge, i need to set absolute paths anyway, so i can use non-GH aswell. | 14:52:33 |
chfkch | I found this one https://github.com/crusty-pie/toolchain | 14:54:27 |
nazar-pc | In reply to @chfkch:matrix.orgThere are many fokrs, but the gist of it is that you probably do not need it at all. If you only care about reasonably recent version being installed, it already is on GitHub Actions by default, if you need a specific version then create rust-toolchain.toml and it will be installed automatically by cargo when cargo command is called.Either way you just run commands in the shell and it "just works". | 19:21:29 |
Aaron Erhardt | In reply to @armadillo9425:matrix.orgI'm haven't had this problem before, so I don't know how this would be done with regular gtk-rs, but you could try sending a PR to address the issue. The code for TypedListView is rather simple and should be easy to extend. | 21:09:55 |
armadillo9425 | I'm afraid I only have a few weeks of experience with Gtk, gtk4-rs and Relm4 so I'm not sure how I'd approach that yet. I'm still in a phase where I make weird architectural choices due to not having a solid understanding of the guiding design principles behind the libraries. | 21:33:28 |
Aaron Erhardt | That's ok. In general, Relm4 tries to provide more idiomatic abstractions on top of gtk-rs, which means you have to understand gtk-rs first in many cases if you want to solve a problem which is not already abstracted nicely by Relm4 (although | 22:10:10 |
25 Mar 2024 | ||
@bilelmoussaoui:gnome.org left the room. | 00:04:37 | |
chfkch | i know we had this topic before regarding ListBox /FactoryVecDequeue versus TypedListView .I started with TypedListView, which lacked some signaling features i guess, so i switched to ListBox. I was fine that those cannot use filters, since they are ususally not to manipulate the data once it is inserted. But today i stumbled upon the invalidate_filters and set_filter_func methods of ListBox. | 14:26:57 |
chfkch | I struggle get the data of the ListBoxItem inside the set_filter_func, since downcast was my only approach. Has anybody used anything i mentioned and has more experience? | 14:28:01 |
chfkch | In reply to @nazar-pc:matrix.orgI got it working, though i had to manually install nodejs in the container since i do not use Github. It is required with forgejo runner for the actions i think. | 19:03:02 |
26 Mar 2024 | ||
Kdwk | Is it possible to call a method on a widget (that does not accept any input) without using update_with_view()? Something in view!{} maybe? | 06:27:04 |
chfkch | In reply to @kdwk:matrix.orgI think you can put a reference to the widget in your app model and then call methods of it in the update() | 07:26:33 |
Aaron Erhardt | You can actually do method: (), in the view macro IIRC. You can combine that with watch or track as well. | 07:27:53 |
Kdwk | In reply to @aaron:matrix.aaron-erhardt.deAh that is what I was looking for. Thanks | 08:37:55 |
chfkch | In reply to @aaron:matrix.aaron-erhardt.deThat sounds interesting. I have not seen it in the examples/documemtation so far. Do you know if it is there? Or should we work out an example together? | 08:57:10 |
Aaron Erhardt | I think there might be some examples using this trick, but I think it should rather be documented in the book here | 10:22:26 |
armadillo9425 | perhaps also an interesting example: https://github.com/Relm4/Relm4/blob/b2792fb597060d2b4c6dd4650ff0c1b92a6cd2b7/examples/message_stream.rs#L32 you can add present: () to pop open a MessageBox | 20:25:45 |
27 Mar 2024 | ||
@horvbalint:matrix.org left the room. | 19:18:45 | |
28 Mar 2024 | ||
chfkch | say i have a gtk::Box with a name specified with #[name = "detail_anchor"] and i want to append a child to it. i currently use widgets.detail_anchor.append() in my update_with_view() and it works fine, but how can i remove previous childs from it, of which i do not have context.since these children are all SimpleAsyncComponents i thoght i store a reference in a model attribute, but i don't know of which type it would be. | 11:02:55 |
chfkch | hhm i reduced the similarities of the children to be contained in a gtk::Box and now added an attribute detail_box of type Option<Box> to my AppModel. That seems to work for now. | 11:16:25 |
Aaron Erhardt | I guess you can't use factories because you want to add different types of components, right? In this case, you can upcast their root widgets to | 11:19:52 |
chfkch | yes, different components. Ok i will see if i need the upcast, i did not think of this | 11:20:30 |
chfkch | but i think they will all share a box as root, maybe i will already suffice. | 11:21:13 |
Aaron Erhardt | Yeah, if they all use a box, then there's no need to cast anything. It's just good to know that's possible when you need it. | 11:22:00 |