wxWidgets Checkbox Tooltips

I need to post this so that no one else experiences the same pain with wxWidgets (2.9.4). Tooltips weren’t working for me when I hovered over checkboxes. This has bothered me for about 2 years and Google doesn’t seem to throw up a solution.

We are using wxWidgets for FreeDV, as we needed cross platform support. That has actually worked out pretty well, with Linux, Win32, OSX and recently FreeBSD working just fine.

So, the Tooltip problem is something to do with the checkbox being inside a StaticBox. Here is what works and what doesn’t for me:


#define WORKING_CHECKBOX_TOOLTIPS
#ifdef WORKING_CHECKBOX_TOOLTIPS
    wxStaticBoxSizer* sbSizer_testFrames;
    wxStaticBox *sb_testFrames = new wxStaticBox(this, wxID_ANY, _("Test Frames"));
    sbSizer_testFrames = new wxStaticBoxSizer(sb_testFrames, wxVERTICAL);
 
    m_ckboxTestFrame = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
    sb_testFrames->SetToolTip(_("Send frames of known bits instead of compressed voice"));
    sbSizer_testFrames->Add(m_ckboxTestFrame, 0, wxALIGN_LEFT, 0);
#else
    wxStaticBoxSizer* sbSizer_testFrames;
    sbSizer_testFrames = new wxStaticBoxSizer(new wxStaticBox(this, wxID_ANY, _("Test Frames")), wxVERTICAL);
 
    m_ckboxTestFrame = new wxCheckBox(this, wxID_ANY, _("Enable"), wxDefaultPosition, wxDefaultSize, wxCHK_2STATE);
    m_ckboxTestFrame->SetToolTip(_("Send frames of known bits instead of compressed voice"));
    sbSizer_testFrames->Add(m_ckboxTestFrame, 0, wxALIGN_LEFT, 0);
#endif

Leave a Reply

 

 

 

You can use these HTML tags

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>