I have an interface that has two toolbars, one attached to the frame and one embedded in a notebook tab. The one in the frame dutifully shows longHelp strings in the statusbar, the one in the notebook tab does not. How do I tell the one on the notebook tab where to display its help, or do I have to manage enter and leave bindings myself?
A:
from wxPython docs """ longHelpString This string is shown in the statusbar (if any) of the parent frame when the mouse pointer is inside the tool """
so toolbar in notebook doesn't get any statusbar to display long help, so either thru src we should invertigate how it inquires abt status bar and supply a ref to main frame status bar
else i think better way is to just override wxToolBar::OnMouseEnter and display help directly on status bar
Anurag Uniyal
2009-06-20 10:42:06
A:
You have in wxWidgets:
void wxToolBarBase::OnMouseEnter(int id)
{
...
wxFrame *frame = wxDynamicCast(GetParent(), wxFrame);
if ( frame )
{
...
frame->DoGiveHelp(help, id != wxID_ANY);
}
...
}
In C++ program you can override this function (simply changing GetParent() to GetTopLevelParent() should work). In Python you can only, as you wrote, bind enter/leave events and call DoGiveHelp() from handlers.
marcin
2009-06-25 01:32:48