JUCE: TreeViewItem::OpennessRestorer Class Reference

JUCE

- Main Page
- Related Pages
- Topics
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Loading...
Searching...
No Matches
Public Member Functions | List of all members
TreeViewItem::OpennessRestorer Class Reference
juce_gui_basics » widgets

This handy class takes a copy of a TreeViewItem's openness when you create it, and restores that openness state when its destructor is called. More...

`#include <juce_TreeView.h>`

## Public Member Functions
| OpennessRestorer (TreeViewItem &)
| ~OpennessRestorer ()

## Detailed Description

This handy class takes a copy of a TreeViewItem's openness when you create it, and restores that openness state when its destructor is called.

This can very handy when you're refreshing sub-items - e.g.

void MyTreeViewItem::updateChildItems()
{
OpennessRestorer openness (*this); // saves the openness state here..
clearSubItems();
// add a bunch of sub-items here which may or may not be the same as the ones that
// were previously there
addSubItem (...
// ..and at this point, the old openness is restored, so any items that haven't
// changed will have their old openness retained.
}
TreeViewItem::OpennessRestorer
This handy class takes a copy of a TreeViewItem's openness when you create it, and restores that open...
Definition juce_TreeView.h:597
TreeViewItem::clearSubItems
void clearSubItems()
Removes any sub-items.
TreeViewItem::addSubItem
void addSubItem(TreeViewItem *newItem, int insertPosition=-1)
Adds a sub-item.

## Constructor & Destructor Documentation

## ◆ OpennessRestorer()

TreeViewItem::OpennessRestorer::OpennessRestorer | ( | TreeViewItem & |  | ) |

## ◆ ~OpennessRestorer()

TreeViewItem::OpennessRestorer::~OpennessRestorer | ( |  | ) |

The documentation for this class was generated from the following file:

- juce_TreeView.h