Re: Private fields for structures



>  Another approach, used in libzvt is to have a "private" data attached
>  to the widget.   Although maybe this is too much of an overhead for
>  canvas items - i'm not sure if setting object data suddenly bloats the
>  object (generally you dont have more than 1 term window for a given
>  application!).  In practice it isn't a speed performance hit at any
>  rate (the recent speedups actually access this a lot more often).

It should not suddenly bloat the object, since it is very likely that
the dataset hash table will already have been created.  If you are
paranoid about key name lookups, you can use
gtk_object_{set,get}_data_by_id() instead.

>  Replacing data with dummy fields may also break things, if any code
>  wrongly uses those private fields.

For canvas items this should not be a problem.  Applications are
supposed to *not* access these fields; that is what the object
arguments are used for.   All "interesting" properties of canvas items
are queryable via the Gtk+ argument system.

  Federico



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