Re: [gtk-list] How private is "internal" data supposed to be



>  The same abstract data concepts can be done in C but you cannot protect
>  the user of your data item from accessing implementation details.  So on
>  to my question:

struct Public {
	int public_int;
	char *public_string;

	void *private_data;
};

Look at the GnomeIconList widget, for example, to see how it uses
internal private data.

>  How abstract are the data items (i.e. widgets) in GTK+ supposed to be? 
>  Take for instance a CList.  Am I supposed to dive in and grab the
>  "selection" GList?  My C++ experience tells me no.  But there is no
>  accessor function to get a list of the currently selected items from a
>  CList (that I can see anyway).

The CList API is broken in this regard.  This is not an inherent GTK+
limitation, it is just a bad design.

  Federico



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