#include <wx/tipwin.h>
The (weak) reference to wxTipWindow.
wxTipWindow may close itself at any moment, so creating it as usual, with new and using a raw pointer to it is dangerous. Instead, use New() to create it and use the returned Ref which is guaranteed to become invalid when the tip window is closed.
Note that the objects of this type can't be copied, but can be moved.
To test if this object is still valid, it can be compared to nullptr or its explicit bool conversion operator can be used, i.e. either this:
or this:
works fine.
Public Member Functions | |
| Ref () | |
| Default constructor. | |
| Ref & | operator= (std::nullptr_t) |
| Put object in invalid state. | |
| bool | operator!= (std::nullptr_t) const |
| Returns whether the object is in a valid state. | |
| operator bool () const | |
| Returns whether the tracked object is valid. | |
| wxTipWindow * | operator-> () const |
| Returns a pointer to the tracked object. | |
| wxTipWindow::Ref::Ref | ( | ) |
Default constructor.
The object is created in invalid state.
|
explicit |
Returns whether the tracked object is valid.
This is equivalent to comparing the object to nullptr.
| bool wxTipWindow::Ref::operator!= | ( | std::nullptr_t | ) | const |
Returns whether the object is in a valid state.
Object is in valid state if it is associated with a still open wxTipWindow.
| wxTipWindow * wxTipWindow::Ref::operator-> | ( | ) | const |
Returns a pointer to the tracked object.
May only be called if the object is valid.
| Ref & wxTipWindow::Ref::operator= | ( | std::nullptr_t | ) |
Put object in invalid state.