idanarye / woab

Widgets on Actors Bridge - a GUI microframework for combining GTK with Actix
https://crates.io/crates/woab
MIT License
14 stars 1 forks source link

Signal handling overhaul #20

Closed idanarye closed 3 years ago

idanarye commented 3 years ago

This is an implementation of the macroless from #15, described in this comment.

idanarye commented 3 years ago

Problem - GDK's FromEvent is private, which means I can't have param_event and have to resort to the uglier API. This was not a problem for the BuilderSignal derive macro, because it could just use downast without having to specify a trait bound, but now that we use generics it becomes a problem.

I opened a ticket - https://github.com/gtk-rs/gtk-rs/issues/392. But I may have to accept this ergonomic hit for now, and add param_event in a future release...

piegamesde commented 3 years ago

I must admit that I'm a bit overwhelmed by the complexity of the current code – or maybe it's just the fact that I lost track of all the approaches and design iterations we already had. There are also quite a few use cases to cover …

idanarye commented 3 years ago

Yes, this is a big change. But so far 62% of it is line deletions, so I consider it a simplification of what we previously had.

idanarye commented 3 years ago

I think the examples are what you should be looking at - after all, they are the thing that represents how the new API looks like.

piegamesde commented 3 years ago

I'd really like to try it out right now, but I fear that I'm blocked on the resolution of #21

idanarye commented 3 years ago

21 should not block you - you can still use woab::route_signal. Take a look at tests/connect_nonbuilder_signals.rs.