4 ms·
This isn't some C problem, this is a GTK+ problem. There's no need to be throwing all this up-front known crap into a runtime constructed dictionary. If the w
by pengaru 5y ago
This isn't some C problem, this is a GTK+ problem.
There's no need to be throwing all this up-front known crap into a runtime constructed dictionary.
If the widget has a "clicked" signal, there should be a typedef of the callback function appropriate for that signal and the widget struct should have a clicked_cb member for a list of callbacks of that type. Then there should simply be a unique function for installing the callback on that signal on a widget. At least then the compiler can tell you when you're mixing up callbacks<->signals for API-defined signals. It's not even complicated.
- throwaway82652 5y agoThe C++, Go, Rust and D bindings already do that, as does Vala, the information is all there to generate the necessary code in a statically typed language. It still wouldn't do anything for you if you want to use a dynamic language or use the xml builder functionality.