Wrapping problem
- From: Karl Nelson <kenelson ece ucdavis edu>
- To: gtk-devel-list redhat com
- cc: kenelson sequoia ece ucdavis edu
- Subject: Wrapping problem
- Date: Mon, 10 Jan 2000 14:31:03 -0800
Gtk-- has a problem wrapping a certain set of objects in the gtk+
system, in this case CList and CTree. The problem is unlike
Menus and other structures, the CList and CTree structures are
not navigable from anywhere other than the top. (There is no way
to get a pointer to the container from the child.)
Ie. We want to use wrappers like....
class Node : public GtkCTreeNode
{
GtkCTree* parent(); // function to get to parent.
public:
void set_something(int);
};
void Node:set_something(int i)
{ gtk_ctree_set_something(parent(), i);}
Thus we would have object that can be manipulated as objects without
the user having to supply the parent.
ctree.get_node().set_something(1);
without it we are forced to fall back to a very c-ish api where
the parent has all the methods of the child.
ctree.node_set_something(ctree.get_node(),1);
Our only other option is to recode specialize lists containing the
parent and the data node, this more code then all of the clist
file!
Thus I propose that we add a pointer to the parent in GtkCListRow and
GtkCListColumn. This would be enough to make both GtkCList and GtkCTree
much easier to wrap. Is there any reason not to do this? Are there
any issues that need to be considered?
Thanks.
--Karl
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]