wxFrame::size There is always a hack to solve your problems.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@1026 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -269,12 +269,12 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) :
|
|||||||
#else
|
#else
|
||||||
wxImageList *imagelist = new wxImageList(32, 32);
|
wxImageList *imagelist = new wxImageList(32, 32);
|
||||||
|
|
||||||
imagelist-> Add( wxBitmap( (const char**) list_xpm ));
|
imagelist-> Add( wxBitmap( list_xpm ));
|
||||||
imagelist-> Add( wxBitmap( (const char**) choice_xpm ));
|
imagelist-> Add( wxBitmap( choice_xpm ));
|
||||||
imagelist-> Add( wxBitmap( (const char**) combo_xpm ));
|
imagelist-> Add( wxBitmap( combo_xpm ));
|
||||||
imagelist-> Add( wxBitmap( (const char**) text_xpm ));
|
imagelist-> Add( wxBitmap( text_xpm ));
|
||||||
imagelist-> Add( wxBitmap( (const char**) radio_xpm ));
|
imagelist-> Add( wxBitmap( radio_xpm ));
|
||||||
imagelist-> Add( wxBitmap( (const char**) gauge_xpm ));
|
imagelist-> Add( wxBitmap( gauge_xpm ));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
wxButton *button = (wxButton*)NULL;
|
wxButton *button = (wxButton*)NULL;
|
||||||
|
@@ -184,21 +184,25 @@ bool wxFrame::Show( bool show )
|
|||||||
{
|
{
|
||||||
wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
|
wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
|
||||||
|
|
||||||
if (show)
|
if (show && !m_sizeSet)
|
||||||
{
|
{
|
||||||
/*
|
// this yield call is required for a configure event
|
||||||
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
|
// to be sent by GTK to its windows. this will among
|
||||||
m_sizeSet = FALSE;
|
// others prompt all GtkScrolledWidgets to calculate
|
||||||
GetEventHandler()->ProcessEvent( event );
|
// if they need scrollbars which in turn is required
|
||||||
*/
|
// for wxWindows to calculate the client size of its
|
||||||
|
// windows.
|
||||||
// here we give wxFrame a chance to do resize updates
|
|
||||||
// before appearing on screen. resize updates have to
|
|
||||||
// be handled in idle time because of GTK's super smart
|
|
||||||
// resize propagation algorithm.
|
|
||||||
|
|
||||||
wxYield();
|
wxYield();
|
||||||
|
|
||||||
|
// by calling GtkOnSize here, we don't have to call
|
||||||
|
// either after showing the frame, which would entail
|
||||||
|
// much ugly flicker nor from within the size_allocate
|
||||||
|
// handler, because GTK 1.1.X forbids that.
|
||||||
|
|
||||||
|
GtkOnSize( m_x, m_y, m_width, m_height );
|
||||||
}
|
}
|
||||||
|
|
||||||
return wxWindow::Show( show );
|
return wxWindow::Show( show );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -184,21 +184,25 @@ bool wxFrame::Show( bool show )
|
|||||||
{
|
{
|
||||||
wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
|
wxASSERT_MSG( (m_widget != NULL), "invalid frame" );
|
||||||
|
|
||||||
if (show)
|
if (show && !m_sizeSet)
|
||||||
{
|
{
|
||||||
/*
|
// this yield call is required for a configure event
|
||||||
wxSizeEvent event( wxSize(m_width,m_height), GetId() );
|
// to be sent by GTK to its windows. this will among
|
||||||
m_sizeSet = FALSE;
|
// others prompt all GtkScrolledWidgets to calculate
|
||||||
GetEventHandler()->ProcessEvent( event );
|
// if they need scrollbars which in turn is required
|
||||||
*/
|
// for wxWindows to calculate the client size of its
|
||||||
|
// windows.
|
||||||
// here we give wxFrame a chance to do resize updates
|
|
||||||
// before appearing on screen. resize updates have to
|
|
||||||
// be handled in idle time because of GTK's super smart
|
|
||||||
// resize propagation algorithm.
|
|
||||||
|
|
||||||
wxYield();
|
wxYield();
|
||||||
|
|
||||||
|
// by calling GtkOnSize here, we don't have to call
|
||||||
|
// either after showing the frame, which would entail
|
||||||
|
// much ugly flicker nor from within the size_allocate
|
||||||
|
// handler, because GTK 1.1.X forbids that.
|
||||||
|
|
||||||
|
GtkOnSize( m_x, m_y, m_width, m_height );
|
||||||
}
|
}
|
||||||
|
|
||||||
return wxWindow::Show( show );
|
return wxWindow::Show( show );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user