On 01/22/2015 12:43 AM, King_DuckZ wrote:
So my questions are:
did I take any "right" approach at any point during my design?
Using builder.connectSignals limmits the amount of information you can
pass to the callbacks. To global data and the information passed as the
userData in the connectSignals call.
How is one supposed to inherit from classes the whose objects are automatically created by Builder?
I don't think you can, GtkBuilder wouldn't know how to instantiate the
derived class.
Is there a way to differentiate the data being passed to events, so that I can pass the correct "this" pointer even if I have more than one window in my program? Or am I obliged to pack all of my "this" pointers into a global structure that is passed to every signal handler and trust them to access the right one? (sometimes it might be tempting to take shortcuts...)
Take a look at the Builder example[0] it connects the signals manually,
that way the callbacks are proper methods/delegates.
[0]
https://github.com/gtkd-developers/GtkD/blob/master/demos/builder/builderTest.d