Re: Wrapping problem




Karl Nelson <kenelson@ece.ucdavis.edu> writes:  
> 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?
> 

The obvious cost of doing this is one pointer per row/node, 
10K nodes * 4 bytes is 40K bytes. Not a huge deal.

Though I think you could easily add the pointer to the C++ wrapper
object for the GTK 1.2 wrapper - 

  class Node
    {
      GtkCTree* parent_;
      GtkCTreeNode* node_;

      public:
        Node(GtkCTree* parent, GtkCTreeNode* node);

        void set_something(int);
    };

  void Node::set_something(int i)
    { gtk_ctree_set_something(parent_, node_, i);}

  Node CTree::get_node() {
     return Node(ctree, gtk_ctree_get_node(ctree));
  }

Granted I'm not sure how this interacts with deriving from
GtkCTreeNode if you want to do that...

Havoc




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