Unable to Edit wxWidgets files

30 views Asked by At

I want to override "DismissAndNotify" in "popupwin.h", but it is still calling the in-built function.

class WXDLLIMPEXP_CORE wxPopupTransientWindowBase : public wxPopupWindow {
protected:
    void DismissAndNotify()
    {
        Dismiss();
        OnDismiss();
    }
}
class WXDLLIMPEXP_CORE wxPopupTransientWindow : public wxPopupTransientWindowBase {
    virtual void DismissAndNotify(); // I want to call this function
}

PS: I am new to wxWidgets

1

There are 1 answers

0
VZ. On

DismissAndNotify() is not part of the public API at all, so using it would be a very bad idea even if it worked because your code could easily stop working with a newer wxWidgets version or even with the same version on another platform.

The reason that it doesn't work is that it's not even virtual, so you can't override it as you're trying to do. Instead you could override Dismiss() which is both public (documented) and virtual or maybe OnDismiss() if you just want to react to the popup being dismissed.