Re: Setting custom Glib::Property values in Gtk::Builder .ui XML

for posterity, it looks like someone else has had the same questions but didn't get much further:

First is that before I load the glade file I have to call the constructor by
creating an object of my problematic custom widget. I don't like it and I
can't find a way around. I marked that place in the source with ///!!! in

Second is that my properties are loaded in the glade file but they are not set to the default value and when I change them from glade I can't get the new values. I marked the place where I try connecting a signal again with ///!!! in area.cpp
Basically, it seems that we can't do what I hoped with glibmm/gtkmm, except by writing a pile of C to glue it properly onto the core GOBject functionality - at which point it's probably best either to go full C or to use a binding that has better integration for creating custom GObjects (and that's before we start thinking about GtkBuilder templates!)

I still want to keep writing C++, but I guess most of the programmatic widget-packing noise will have to remain... I'm not sure that hoisting out only the bits that don't require derived widgets or new properties would be worth doing, given that I'd end up with a mixture of paradigms; it's probably best to stick to one only, even if that's the worst one! (at least I can keep telling myself that'll avoid the overhead of parsing XML...)

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]