make sure style is set on menubar before querying its size
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43974 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
parent
dc7c33c455
commit
8c70a78958
@ -631,20 +631,22 @@ void wxFrame::AttachMenuBar( wxMenuBar *menuBar )
|
|||||||
|
|
||||||
void wxFrame::UpdateMenuBarSize()
|
void wxFrame::UpdateMenuBarSize()
|
||||||
{
|
{
|
||||||
GtkRequisition req;
|
m_menuBarHeight = 2;
|
||||||
|
|
||||||
req.width = 2;
|
|
||||||
req.height = 2;
|
|
||||||
|
|
||||||
// this is called after Remove with a NULL m_frameMenuBar
|
// this is called after Remove with a NULL m_frameMenuBar
|
||||||
if ( m_frameMenuBar )
|
if ( m_frameMenuBar )
|
||||||
(* GTK_WIDGET_CLASS( GTK_OBJECT_GET_CLASS(m_frameMenuBar->m_widget) )->size_request )
|
{
|
||||||
(m_frameMenuBar->m_widget, &req );
|
GtkRequisition req;
|
||||||
|
gtk_widget_ensure_style(m_frameMenuBar->m_widget);
|
||||||
|
// have to call class method directly because
|
||||||
|
// "size_request" signal is overridden by wx
|
||||||
|
GTK_WIDGET_GET_CLASS(m_frameMenuBar->m_widget)->size_request(
|
||||||
|
m_frameMenuBar->m_widget, &req);
|
||||||
|
|
||||||
m_menuBarHeight = req.height;
|
m_menuBarHeight = req.height;
|
||||||
|
}
|
||||||
|
|
||||||
// resize window in OnInternalIdle
|
// resize window in OnInternalIdle
|
||||||
|
|
||||||
GtkUpdateSize();
|
GtkUpdateSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user