From 88cea3c82dd821e652608fcccce229fea0249d08 Mon Sep 17 00:00:00 2001 From: Greg Ercolano Date: Sun, 10 Nov 2013 04:33:44 +0000 Subject: o Added Fl_Tree::item_draw_callback(), letting one define a custom draw function for Fl_Tree_Item's. o Added examples/tree-custom-draw-items.cxx to demonstrate its use. o Fixed small doc error for recent Fl_Tree::get_selected_items() git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10018 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- FL/Fl_Tree.H | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'FL/Fl_Tree.H') diff --git a/FL/Fl_Tree.H b/FL/Fl_Tree.H index f29161c01..ed2a2d526 100644 --- a/FL/Fl_Tree.H +++ b/FL/Fl_Tree.H @@ -96,6 +96,8 @@ /// Items can be found by their pathname using find_item(const char*), /// and an item's pathname can be found with item_pathname(). /// The selected items' colors are controlled by selection_color() (inherited from Fl_Widget). +/// A hook is provided to allow you to redefine how item's labels are drawn +/// via Fl_Tree::item_draw_callback(). /// /// \b SELECTION OF ITEMS /// @@ -465,7 +467,13 @@ public: Fl_Tree_Item_Draw_Mode item_draw_mode() const; void item_draw_mode(Fl_Tree_Item_Draw_Mode mode); void item_draw_mode(int mode); -#endif /*FLTK_ABI_VERSION*/ +#endif +#if FLTK_ABI_VERSION >= 10303 + void item_draw_callback(Fl_Tree_Item_Draw_Callback *cb, void *data=0); + Fl_Tree_Item_Draw_Callback* item_draw_callback() const; + void* item_draw_user_data() const; + void do_item_draw_callback(Fl_Tree_Item *o) const; +#endif int displayed(Fl_Tree_Item *item); void show_item(Fl_Tree_Item *item, int yoff); void show_item(Fl_Tree_Item *item); -- cgit v1.2.3