can-lehmann / owlkettle

A declarative user interface framework based on GTK 4
https://can-lehmann.github.io/owlkettle/README
MIT License
367 stars 14 forks source link

#148 Add custom signal emission utilities #149

Closed PhilippMDoerner closed 6 months ago

PhilippMDoerner commented 6 months ago

This is a first draft of adding startup/shutdown events to the various brew procs.

I tested them manually, so they should all work. The approach is as discussed, introduction of a new datatype AppContext with closure events for startup/shutdown. In the GApplication-variants I use the "shutdown" signal, in the others I just execute the events after the runMainloop proc. In the GApplication-variants I add startup to the "activate" signal, in the others I just execute the events before the runMainloop proc.

I have not proofread this properly yet, this is just a jump-off point to arrive at the final PR. I can definitely confirm that it works at least, as I use this branch with --path: to cross-develop it with appster for better integration.

closes #148

can-lehmann commented 6 months ago

Is this ready for merging from your side?

PhilippMDoerner commented 6 months ago

I honestly expected more to be wrong with it and require a new approach with this more being like a first stab at the problem to learn looking for more solutions. Particularly because I wrote most of this code while sick.

If this woks I'm fine with it, I still don't have the mental capacity to properly proof-read my work here but I'm happy to rely on your review of it :sweat_smile: