Re: [gtkmm] How to derive from TreeModel?



Le mar 02/07/2002 à 13:30, Murray Cumming a écrit :
    On Tue, 2002-07-02 at 11:08, Benjamin Dauvergne wrote:
    > 
    > Is it possible to derive TreeModel without creating a derived class from
    > GTK+ TreeModel i.e linking the vfunc slot  table you find in
    > gtk-2.0/gtk/gtktreemodel.h to your own iterator function ?
    
    I believe that it's now possible. It should be slightly easier than
    deriving in C, but it's still not going to be easy, because the whole
    TreeModel thing depends on some funky use of the GtkTreeIter fields.
    
I don't how it is possible, it seems that code, gtk/gtkmm/treemodel.cc:
/*
  _WRAP_VFUNC(bool iter_next(iterator& iter), iter_next)
  _WRAP_VFUNC(bool iter_children(iterator& iter, const iterator& parent
= iterator()), iter_children)
  _WRAP_VFUNC(bool iter_has_child(const iterator& iter) const,
iter_has_child)
  _WRAP_VFUNC(int iter_n_children(const iterator& iter) const,
iter_n_children)
  int get_n_children() const;

  _WRAP_VFUNC(bool iter_nth_child(iterator& iter, const iterator&
parent, int n), iter_nth_child)
  bool iter_nth_child(iterator& iter, int n);
  _WRAP_VFUNC(bool iter_parent(iterator& iter, const iterator& child),
iter_parent)
  _WRAP_VFUNC(void ref_node(iterator& iter), ref_node)
  _WRAP_VFUNC(void unref_node(iterator& iter), unref_node)
*/
used to do it but it is commented, and the C vfunc like iter_next are
never defined elsewhere.

Maybe it is broken?

    If you really want to do it then you should search the archive for
    "CellRenderer", which can be derived by using a similar "custom GType"
    technique.
    
I don't sees how this two relates since cellrenderepopup is derived from
Gtk::CellRendererText whos represents GtkRendererRext who has already
overrided the vfunc of the abstract Gtk class, GtkCellRenderer.



    
    
    



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