FLTK logo

Re: [fltk.coredev] Fl_Group/Fl_Tree/etc: document how to properly delete widgets/items from container widgets

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.coredev  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Fl_Group/Fl_Tree/etc: document how to properly delete widgets/items from container widgets Gmail Ercolano Jul 13, 2021  
 


On 7/13/21 5:59 PM, Gmail Ercolano wrote:
Fl_Tree::remove(Fl_Tree_Item* item)

    Remove the specified 'item' from the tree.

    'item' may not be NULL. If the item has children, all those are removed too.
    If item being removed has focus, no item will have focus.

    remove() frees the memory associated with the specified Fl_Tree_Item immediately.
    remove() does not affect any FLTK widget assigned to the item with Fl_Tree_Item::widget(),

    To destroy an FLTK widget assigned to the item, you can do that cleanly this way:
    [..]

    Hmm, it might be better to move the description of how to remove a widget assigned to an item
    with Fl_Tree_Item::widget() to the docs for that method, and simply refer to that here
    in remove()'s docs, e.g.

remove() does not destroy any FLTK widget assigned to the item with widget(Fl_Widget*).
For more on how to manage that, see Fl_Tree_Item::widget().

    This way anyone not even using widget() assignment doesn't have to see a lot of detail
    in the remove() docs that doesn't concern them.

--
You received this message because you are subscribed to the Google Groups "fltk.coredev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkcoredev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkcoredev/e48d8cea-03f7-fcf3-4828-93017f68e273%40gmail.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.