Re: [gtkmm] gtkmm 2.4 questions



Hello!

But another thing about CellRenderer. Is there any reason why
get_size_vfunc is now 'const' ? This is IMHO a very bad idea as everybody
who write it's own CellRenderer is very limited (especially if you
dynamically calculate the cell content).

I don't understand. If the method should not change the instance, then
the method should be const.

Yes, that is right.

Do you think that this method should change the instance?

You know before that other developer want todo? Why you assume that get_size_vfunc don't change the instance? If I see this right Gtk::CellRenderer is supposed to be a base class for self defined renderers. So you can't know before how what they like todo.

If you need to change member data without really changing the instance,
then you need to use the mutable keyword. Const is whatever you define
it to mean.

Adding tons of mutable keywords to most of my own instance data just to be able to add the 'const' qualifier to lot of other private methods (that are called by get_size_vfunc) is not a good style or solution. At least I don't see a reason why this is good or better only to have get_size_vfunc as const method.


Regards,
Frank



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