Re: g_object_set_data or subclass?



Hi;

On 24 September 2016 at 15:39, Konstantin P. <ria freelander gmail com> wrote:
What is better for storing a widget state ?

In general, if your language facilities allow it more easily than C,
it's highly recommended to subclass a widget in order to store
additional state.

Using the GDataSet field of GObject is a last resort — reserved for
libraries, for instance, or for code that has to deal with third party
widgets that cannot be modified to, for instance, add an interface.

Even with GObject/C, subclassing is usually recommended for newly
written code, though it can get verbose.

Ciao,
 Emmanuele.

-- 
https://www.bassi.io
[@] ebassi [@gmail.com]


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