Fixed resize behaviour under certain circumstances.

Disabled GUI threading when using GTK < 1.2.4, better
    than crashing.
  Typos corrected.


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5421 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Robert Roebling 2000-01-15 14:48:00 +00:00
parent 9000c6246f
commit 8f75cb6c75
7 changed files with 79 additions and 23 deletions

View File

@ -210,9 +210,9 @@ void MyTopLabels::OnPaint( wxPaintEvent &event )
{
wxPaintDC dc(this);
m_owner->PrepareDC( dc );
dc.DrawText( "Colummn 1", 5, 5 );
dc.DrawText( "Colummn 2", 105, 5 );
dc.DrawText( "Colummn 3", 205, 5 );
dc.DrawText( "Column 1", 5, 5 );
dc.DrawText( "Column 2", 105, 5 );
dc.DrawText( "Column 3", 205, 5 );
}
// MyRightLabels

View File

@ -558,7 +558,17 @@ void wxApp::CleanUp()
int wxEntry( int argc, char *argv[] )
{
#if wxUSE_THREADS
g_thread_init(NULL);
/* GTK 1.2 up to version 1.2.3 has broken threads */
if ((gtk_major_version == 1) &&
(gtk_minor_version == 2) &&
(gtk_micro_version < 4))
{
printf( "wxWindows warning: Disabled GUI threading due to outdated GTK version\n" );
}
else
{
g_thread_init(NULL);
}
#endif
gtk_set_locale();

View File

@ -128,9 +128,9 @@ static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation*
here in order to make repositioning after resizing to take effect. */
if ((gtk_major_version == 1) &&
(gtk_minor_version == 2) &&
(gtk_micro_version < 6) &&
(gtk_micro_version < 6) &&
(win->m_wxwindow) &&
(GTK_WIDGET_REALIZED(win->m_wxwindow)))
(GTK_WIDGET_REALIZED(win->m_wxwindow)))
{
gtk_widget_size_allocate( win->m_wxwindow, alloc );
}

View File

@ -1707,6 +1707,20 @@ gtk_window_realized_callback( GtkWidget *WXUNUSED(m_widget), wxWindow *win )
// "size_allocate"
//-----------------------------------------------------------------------------
static
void gtk_window_size_callback( GtkWidget *widget,
GtkAllocation *alloc,
wxWindow *win )
{
if (g_isIdle)
wxapp_install_idle_handler();
wxSizeEvent event( win->GetSize(), win->GetId() );
event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event );
}
#ifdef HAVE_XIM
#define WXUNUSED_UNLESS_XIM(param) param
#else
@ -1716,13 +1730,13 @@ gtk_window_realized_callback( GtkWidget *WXUNUSED(m_widget), wxWindow *win )
/* Resize XIM window */
static
void gtk_wxwindow_size_callback( GtkWidget * WXUNUSED_UNLESS_XIM(widget),
GtkAllocation * WXUNUSED_UNLESS_XIM(alloc),
wxFrame * WXUNUSED_UNLESS_XIM(win) )
void gtk_wxwindow_size_callback( GtkWidget* WXUNUSED_UNLESS_XIM(widget),
GtkAllocation* WXUNUSED_UNLESS_XIM(alloc),
wxWindow* WXUNUSED_UNLESS_XIM(win) )
{
if (g_isIdle)
wxapp_install_idle_handler();
#ifdef HAVE_XIM
if (!win->m_ic)
return;
@ -2211,11 +2225,15 @@ void wxWindow::PostCreation()
if (m_wxwindow)
{
/* Initialize XIM support. */
/* Catch native resize events. */
gtk_signal_connect( GTK_OBJECT(m_wxwindow), "size_allocate",
GTK_SIGNAL_FUNC(gtk_window_size_callback), (gpointer)this );
/* Initialize XIM support. */
gtk_signal_connect( GTK_OBJECT(m_wxwindow), "realize",
GTK_SIGNAL_FUNC(gtk_wxwindow_realized_callback), (gpointer) this );
/* And resize XIM window. */
/* And resize XIM window. */
gtk_signal_connect( GTK_OBJECT(m_wxwindow), "size_allocate",
GTK_SIGNAL_FUNC(gtk_wxwindow_size_callback), (gpointer)this );
}

View File

@ -558,7 +558,17 @@ void wxApp::CleanUp()
int wxEntry( int argc, char *argv[] )
{
#if wxUSE_THREADS
g_thread_init(NULL);
/* GTK 1.2 up to version 1.2.3 has broken threads */
if ((gtk_major_version == 1) &&
(gtk_minor_version == 2) &&
(gtk_micro_version < 4))
{
printf( "wxWindows warning: Disabled GUI threading due to outdated GTK version\n" );
}
else
{
g_thread_init(NULL);
}
#endif
gtk_set_locale();

View File

@ -128,9 +128,9 @@ static void gtk_page_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation*
here in order to make repositioning after resizing to take effect. */
if ((gtk_major_version == 1) &&
(gtk_minor_version == 2) &&
(gtk_micro_version < 6) &&
(gtk_micro_version < 6) &&
(win->m_wxwindow) &&
(GTK_WIDGET_REALIZED(win->m_wxwindow)))
(GTK_WIDGET_REALIZED(win->m_wxwindow)))
{
gtk_widget_size_allocate( win->m_wxwindow, alloc );
}

View File

@ -1707,6 +1707,20 @@ gtk_window_realized_callback( GtkWidget *WXUNUSED(m_widget), wxWindow *win )
// "size_allocate"
//-----------------------------------------------------------------------------
static
void gtk_window_size_callback( GtkWidget *widget,
GtkAllocation *alloc,
wxWindow *win )
{
if (g_isIdle)
wxapp_install_idle_handler();
wxSizeEvent event( win->GetSize(), win->GetId() );
event.SetEventObject( win );
win->GetEventHandler()->ProcessEvent( event );
}
#ifdef HAVE_XIM
#define WXUNUSED_UNLESS_XIM(param) param
#else
@ -1716,13 +1730,13 @@ gtk_window_realized_callback( GtkWidget *WXUNUSED(m_widget), wxWindow *win )
/* Resize XIM window */
static
void gtk_wxwindow_size_callback( GtkWidget * WXUNUSED_UNLESS_XIM(widget),
GtkAllocation * WXUNUSED_UNLESS_XIM(alloc),
wxFrame * WXUNUSED_UNLESS_XIM(win) )
void gtk_wxwindow_size_callback( GtkWidget* WXUNUSED_UNLESS_XIM(widget),
GtkAllocation* WXUNUSED_UNLESS_XIM(alloc),
wxWindow* WXUNUSED_UNLESS_XIM(win) )
{
if (g_isIdle)
wxapp_install_idle_handler();
#ifdef HAVE_XIM
if (!win->m_ic)
return;
@ -2211,11 +2225,15 @@ void wxWindow::PostCreation()
if (m_wxwindow)
{
/* Initialize XIM support. */
/* Catch native resize events. */
gtk_signal_connect( GTK_OBJECT(m_wxwindow), "size_allocate",
GTK_SIGNAL_FUNC(gtk_window_size_callback), (gpointer)this );
/* Initialize XIM support. */
gtk_signal_connect( GTK_OBJECT(m_wxwindow), "realize",
GTK_SIGNAL_FUNC(gtk_wxwindow_realized_callback), (gpointer) this );
/* And resize XIM window. */
/* And resize XIM window. */
gtk_signal_connect( GTK_OBJECT(m_wxwindow), "size_allocate",
GTK_SIGNAL_FUNC(gtk_wxwindow_size_callback), (gpointer)this );
}