c++user-interfacetooltipwxwidgetswxtextctrl

How to add button in wxRichToolTip, wxWidgets?


I have created a tooltip using wxRichToolTip, but I am unable to figure how to customize it. Like I want to add button in the tooltip.

Here is my code.

wxRichToolTip tip("Caps Lock is on",
        "You might have made an error in your password\n"
        "entry because Caps Lock is turned on.\n"
        "\n"
        "Press Caps Lock key to turn it off.");
    tip.SetIcon(wxICON_WARNING);
    tip.SetBackgroundColour("#003FC0", "#FFFFFF");
    tip.ShowFor(this);

PS: I am new to wxWidgets


Solution

  • wxRichToolTip doesn't support buttons, you will need to implement your own popup window class if this is what you need. You may find the generic, i.e. written using wxWidgets API instead of native API, implementation of wxRichToolTip in src/generic/richtooltipg.cpp useful as an inspiration for your version.