How to show and hide wxToolbar

Milan Babuskov milanb at panonnet.net
Sat Feb 24 23:46:06 PST 2007


notnot wrote:
>  void MainFrame::OnMenuToggleToolbar( wxCommandEvent& event )
>  {
>       toolBar->Show(!toolBar->IsShown());
>       Layout();
>       SetClientSize(GetClientSize());
>  }
> 
> I've had success with this when hiding the status bar.

I just tried. Doesn't work. It's interesting that when I manually resize 
the frame it does work properly. So I wrote something like:

wxSize s = GetSize();
Fit();
SetSize(s);

This does work, but I don't know if it would have some side effects (for 
example when frame is maximized, etc.). It appears to work with MSW as well.


-- 
Milan Babuskov
http://www.guacosoft.com
http://www.flamerobin.org





More information about the wx-users mailing list